Be a Supporter!

Walking animation help?

  • 278 Views
  • 10 Replies
New Topic Respond to this Topic
spartan2744
spartan2744
  • Member since: Sep. 10, 2009
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Walking animation help? 2010-11-10 15:36:53 Reply

I'm making a platformer type game but am having trouble with a walking animation. Instead of only playing when he is walking, it plays constantly. How to i fix it? and what codes do i use?
Any help would be appreciated.

and i know a lot of you are gonna call me lazy.. I'M NOT LAZY!! I'm just not sure of how to correctly do this. For you trolling, FUCK OFF! I'M TIRED OF YOUR SHIT!

But to you helpful people, thank you


Click this link to get free xbox360 games and accessories!!

BBS Signature
offspringscott
offspringscott
  • Member since: Oct. 19, 2010
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Walking animation help? 2010-11-10 15:57:04 Reply

...you made a platform game, but you dunno stop(); ?


sorry for my poor english
icitte c'est francais tabarnak!

BBS Signature
offspringscott
offspringscott
  • Member since: Oct. 19, 2010
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Walking animation help? 2010-11-10 15:58:41 Reply

well... if it's something else, I think it'd be hard to help without an fla


sorry for my poor english
icitte c'est francais tabarnak!

BBS Signature
spartan2744
spartan2744
  • Member since: Sep. 10, 2009
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Walking animation help? 2010-11-10 16:01:58 Reply

At 11/10/10 03:57 PM, offspringscott wrote: ...you made a platform game, but you dunno stop(); ?

i know the stop function...it's doesnt work that way though, it'll just play through the animation and stop and it won't do anything unless i restart flash


Click this link to get free xbox360 games and accessories!!

BBS Signature
Marsume
Marsume
  • Member since: Oct. 22, 2006
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Walking animation help? 2010-11-10 16:13:22 Reply

At 11/10/10 04:01 PM, spartan2744 wrote:
At 11/10/10 03:57 PM, offspringscott wrote: ...you made a platform game, but you dunno stop(); ?
i know the stop function...it's doesnt work that way though, it'll just play through the animation and stop and it won't do anything unless i restart flash

:Pesudo-code

if(character is walking && player.currentFrame != walkFrame){
player.gotoAndStop(walkFrame)
} else {
player.gotoAndStop(stand/idleFrame)
}

//"Character is walking" is a boolean, set to true once you hit the movement key, and is set to false once you release the key/press a different key.
//The best way I've found to SET UP your character is to put it in a mc (named,...player) and on each frame inside that mc there is another mc with the walking sequence mc on frame1, idle frame mc on frame 2...etc

Hope that helps
spartan2744
spartan2744
  • Member since: Sep. 10, 2009
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Walking animation help? 2010-11-10 17:58:52 Reply

Pesudo-code
if(character is walking && player.currentFrame != walkFrame){
player.gotoAndStop(walkFrame)
} else {
player.gotoAndStop(stand/idleFrame)
}
Hope that helps

is that action script 3? It doesn't look familiar is why i'm asking


Click this link to get free xbox360 games and accessories!!

BBS Signature
Innermike
Innermike
  • Member since: Sep. 11, 2009
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to Walking animation help? 2010-11-10 18:06:17 Reply

At 11/10/10 05:58 PM, spartan2744 wrote:
Pesudo-code
if(character is walking && player.currentFrame != walkFrame){
player.gotoAndStop(walkFrame)
} else {
player.gotoAndStop(stand/idleFrame)
}
Hope that helps
is that action script 3? It doesn't look familiar is why i'm asking

You should really go and learn the basics first. Really.


nobody

spartan2744
spartan2744
  • Member since: Sep. 10, 2009
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Walking animation help? 2010-11-10 18:10:49 Reply

is that action script 3? It doesn't look familiar is why i'm asking
You should really go and learn the basics first. Really.

i already know the basics


Click this link to get free xbox360 games and accessories!!

BBS Signature
gekko007
gekko007
  • Member since: Jul. 2, 2006
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to Walking animation help? 2010-11-10 18:11:34 Reply

Nope, it's AS2. Here's the same, but the bold parts are to be switched with code/variables you have set yourself

if(character is walking && player.currentFrame != walkFrame){
player.gotoAndStop(walkFrame)
} else {
player.gotoAndStop(stand/idleFrame)
}

For instance, the "stand/idleFrame" is the frame in which your character is standing still.


Conspiracy :O | Best story thread ever!
"I guess my kick made his penis explode since blood started gushing down his leg." - Stoptalking

BBS Signature
Marsume
Marsume
  • Member since: Oct. 22, 2006
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Walking animation help? 2010-11-10 20:29:19 Reply

It was pseudo-code: It isn't language specific.
:it was done with AS3 in mind, as far as I know that all the operators in that will work in either AS2 and AS3.

YoinK
YoinK
  • Member since: Jan. 5, 2001
  • Offline.
Forum Stats
Member
Level 60
Game Developer
Response to Walking animation help? 2010-11-11 01:03:29 Reply

spartan2744, the answer is to use variables... and if statements.
check out this video.
http://www.youtube.com/watch?v=UTaV1qXur N0


Kanye West Did What??????
They should make a black guy the manager, they know how to run shit!
2 Girls 1 Cup .... THE SONG!!!!