PDA

View Full Version : Is it possible?!


Guichone
02-20-2002, 07:48 PM
Heys!

Is it possible to make a character controled by the arrow keys
and when he passes the screen limit go to another scene?!
How?!

(Sorry my english is very bad)

Thanks!

orox
02-21-2002, 05:13 AM
Sure u can use on (keyPress " ")

jimburton
02-21-2002, 10:46 AM
rather than the button's keypress handler, the movieclip events that relate to keys are more suitable for some things like character movement cos you can have more than one at a time (ie if <LEFT> and <UP> are pressed at same time curve upwards) and there is more choice: was the key pressed down or released, is it still pressed, what key was it etc etc ! Search the forum for specific code on keypress.

Then check the characters _x and _y pos to see if it's passed off the edge of the screen and go to the next "page".

zoomfreddy
02-21-2002, 10:56 AM
the movieclip events...that's the way to go for moving ... and to make it easier than _x and _y properties, use hittest against other mc's, so your charater(movieclip) can triger several actions deppending on the hitted movieclip (each ovieclip must have their own actions).



:cool:

btw...search in... movies/games, somebody posted a fla that makes the character movements

jimburton
02-21-2002, 11:07 AM
dead right zoomfreddy except if you're using a lot of repetitive hitTests in, say, a platform game this will slow things WAY down. So If there's a way round it, avoid hitTest.

Often that's easier said than done and it's a hell of a shame hitTest is so costly.