-
HEy Yeah thats right im making a simple little duck duck goose game, but no matter how simple i still need help, what i need is, when you pick someone (i can do that) you run by pressing right arrow then left arrow then right arrow then left arrow etc. but i cant do this i need it so you cant just hit left then left again!
PLease help
thanx!
P.S.
if ya have any cool ideas for a duck dcuk goose game, tell me here!
-
Come on guys i know sometimes it takes a while to answer this stuff but i think some you guys know! come on all i need is how to make the right left right left control!
thanx!
-
if(Key.isDown(Key.LEFT){
if(lastdown=="right"){
run();
}
lastdown="left";
}
if(Key.isDown(Key.RIGHT){
if(lastdown=="left"){
run();
}
lastdown="right";
}
Something like that?
-
Okay I get it kinda but can you break that code down a little, im not to good with action script!
-
Put the following on your main guy:
//Run this every new frame.
onClipEvent(enterFrame){
//If we're holding down left
if(Key.isDown(Key.LEFT){
//If we just pressed right
if(lastdown=="right"){
//Insert whatever running script you have here.
}
//we just pressed left.
lastdown="left";
}
//If we're holding down left
if(Key.isDown(Key.RIGHT){
//If we just pressed left
if(lastdown=="left"){
//Insert whatever running script you have here.
}
//we just pressed right.
lastdown="right";
}
}
See it more clearly?
Ignore the meaningOfLifeX btw. that's just my sig.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|