PDA

View Full Version : Arrow key events


jrrTolkien
03-03-2014, 10:19 AM
Hi, so I am trying to make an 8-bit game, and I am having a little trouble. :( I have a 2-D square as the background, and it is coloured black. I have another square with the texture map of an 8-bit person, and I made events like "When 'down' is pressed, do" and then a method for moving the square (The method changes the texture map of the square and moves it in whichever direction the key is pointing [up makes the square go up, etc.].). I can get it to actually look like the person is moving, and I am starting on making collision detection.The only problem is that you need to press the key once every time the person moves. You can't just hold the button down. I could make an event saying "Let the arrow keys move" the square, but then there would not be the texture map switching, and the person would just move the square around without animation. What I am asking is: Is there any way to make an event that does not require you to press the arrow key repeatedly?

-J.R.R.

MrMoke
03-03-2014, 11:16 AM
in version 2 you can right-click the "When Key Pressed" event and change it into a "While Key Pressed" event which used to do what you want to accomplish. It also gives you the ability to create Begin and End events to supplement the While.

Unfortunately, changes made to version 2.4.1 damaged the functionality of this event, and it no longer works properly. This makes many programs that worked flawlessly in the past non-functional. I notified the development team about this problem in December, but it has not been repaired.

If you are using 2.3.5 or older, it will work.

jrrTolkien
03-03-2014, 02:55 PM
Wow! Thanks so much! It would have taken me weeks to figure that out on my own-and I'm not exaggerating! :o This should make it much easier for me to create my game! I may even post it in the future if it works properly!:D

Thank you,
-J.R.R.