Character automatically moving
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Character automatically moving

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    4

    Character automatically moving

    I have created a game that was working flawlessly until I added an instruction screen that displays before the game starts. Basically it's your typical game where things fall from the top of the screen and the characters have to catch them by taking keyboard input. Before, stuff would fall from the top of the screen as soon as that frame displays but I felt it didn't give the user enough time to get ready before the game began. So I added a button object that displayed until any key was pressed down before I called the enter frame function.

    This works perfectly fine the first time you play the game. But...when you click play again, it simply sends you back to the first frame and you can start the game again. Everything should work the same way as it did the first time as far as I can see but instead, if I press a key, the character moves by itself all the way to the right of the screen and I have to press a combination of keys such as right and left over and over to break it out of this and start moving again as normal. Again, this was not an issue before I added the instruction graphic that displays before the game starts.

    I hope this is clear. Let me know if I need to elaborate. I appreciate any help you can provide.

  2. #2
    Junior Member
    Join Date
    Feb 2013
    Posts
    4
    Okay, I fixed the problem. Moved some code to a separate function and the problem went away. Thanks for reading anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com