how would i code a way to have it so that if you press the left or right key twice in a certain amount of time it will gotoAndStop the running frame but if you only press left or right once it will gotoAndStop the walking frame
Joined: Fri Mar 27, 2009 8:55 pm Posts: 282 Location: Why do you want to know you perv!
Gender: Male
Skype: lomeli1241
Currently Playing: Kingdom Hearts Re:Coded (JP)
I've been having the same problem, but instead of/along with changing frames, mine needs to change speed. What code are you using? I'm using X2i's code for platform games.
BICURIOUS GEORGE daniel King Master X12 Neo_Fire_Sonic Racerx52 Sora Tycron Tyli User Avatar yoh Envoyez-moi un message pour ĂȘtre mon ami! Ha! That's French 4 Pm to be Friends
Thu Sep 24, 2009 7:37 pm
x2i
Joined: Mon Aug 11, 2008 1:09 pm Posts: 166 Location: England lol
Gender: Male
Currently Playing: Minecraft
You could use a timer between keypresses, eg check if a key has been pressed twice in a set time limit. Or using keyframes, do a check for the keypresses on two separate frames so that if the user presses it right it will work... if you really need code I'll see what I can do.
You could use a timer between keypresses, eg check if a key has been pressed twice in a set time limit. Or using keyframes, do a check for the keypresses on two separate frames so that if the user presses it right it will work... if you really need code I'll see what I can do.
I don't know how to check if a button is pressed twice and I'm not exactly sure what kind of timer you are talking about, but i do know how to make timers and it would be nice if you could put the code, but if you could explain how to code it you can do that also whichever would be easier
You could use a timer between keypresses, eg check if a key has been pressed twice in a set time limit. Or using keyframes, do a check for the keypresses on two separate frames so that if the user presses it right it will work... if you really need code I'll see what I can do.
Can you show an example code. Like a timer code, you start walking then running. Because i can use friction to make a good movement set.
Sat Dec 05, 2009 5:14 pm
Reashaun14
Joined: Mon Jul 06, 2009 11:54 am Posts: 57
Gender: Male
Ahhhh yes my friend you see i couldn't figure this out either until i looked at a tutorial on youtube! I really can't explain all of it in this one post so i will post my own tutorial in this section to help you ^_^ and if it still doesn't work i will even provide a flash file!
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum