Go Back   Flash Flash Revolution > General Discussion > Chit Chat
Register FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 09-29-2007, 12:00 PM   #11
MRichards
FFR Player
 
MRichards's Avatar
 
Join Date: May 2006
Posts: 91
Default Re: Programmers out there o/

Don't use a loop to move the arrow: while the loop is going round, the key press code won't be called. So your program isn't working because it only accepts key presses before the arrow moves and after it has gone off the top of the screen

In all games you need an Update procedure that is called periodically. In this procedure, you move the game objects by a single small step. This will make the objects move over time, but also allow other code (like key press code) to have a chance to run.

Here's a VB project that does just that. It uses a timer to call an update procedure, called the timer tick. Otherwise it works like your program (press 'A' key for up):
http://www.latent.demon.co.uk/downloads/VB-FFR1.zip

To have multiple arrows, you will need to use an array. Here's an extension of the above program showing the idea, plus a few other niceties:
http://www.latent.demon.co.uk/downloads/VB-FFR2.zip
If you can't understand this program then you need to try something simpler.

BTW: The programs were built in Visual Studio 2005, if you can't load them, then you'll just have to look at the .vb file to get the idea.
__________________

Last edited by MRichards; 09-29-2007 at 12:04 PM..
MRichards is offline   Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 10:37 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution