Skip to main content
Inspiring
July 7, 2011
Answered

game: character walks around and stops walking when hits a hole

  • July 7, 2011
  • 1 reply
  • 540 views

Hi

I have a game where the character walks around the screen and stops if she hits a wall or a hole etc... - typical. HOWEVER - I coudn't get her to stop walking. Is there any standard code for this. If you tell to stop walking then she can't walk back out either etc... Also, she walked into the hole a little so being in the hole she definately couldn't walk any more not even back out as she would be walking inside the prohibited zone.

This topic has been closed for replies.
Correct answer kglad

typically the character movieclip would play (to display walking animation) and the background or character would move (to convey the character's movement within the game).

stopping the character's animation requires only a stop() applied to the character movieclip and stopping the character from moving requires some other movieclip be stopped or some tween stopped or some code adjusted.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
July 7, 2011

typically the character movieclip would play (to display walking animation) and the background or character would move (to convey the character's movement within the game).

stopping the character's animation requires only a stop() applied to the character movieclip and stopping the character from moving requires some other movieclip be stopped or some tween stopped or some code adjusted.

Inspiring
July 7, 2011

Thanks - I'll have a few goes as it should be easy.


kglad
Community Expert
Community Expert
July 7, 2011

you're welcome.