Game

Hi I’m making a game but I’m not that good at Flash so I have a problem.

I know how to control objects using your keyboard, like in tutorial, and i usethis to move an object to left and right ( i disabled DOWN and UP keys). now it has to drop something by presssing Ctrl or so. Any idea how to do this?

Luster

Can you rephrase that please

I’m not quite sure what you’re asking but i think you should be able to use


on (keypress"<Ctrl>") {
(put your actions here)
}

sorry, my mistake you’ll probably have to use the space bar instead. like this


on (keyPress "<Space>") {
	(your actions)
}

If it’s for a game… Then place this in your main game loop.

[AS]
if(Key.isDown(Key.CONTROL))
{
dropSomething();
}
[/AS]

There you go man… Or you can do the onpress factor of that… But… If it’s for a game… I’d suggest this style right here.