bgt programming issue

Hi, I was wondering if someone would be able to help me with an annoying problem I'm having. After fiddling with the language for a few months, I'm finally trying to program a very basic game in bgt. My goal at this point is to be able to have multiple enemies go across the screen from left to right, and for them to die when the user presses space bar and they're in the center of the screen. At this point I've got the basic game set up. I've got a reloadable gun, an ememy class, so I can hopefully branch out into different types of enemies later, and theoretically a way for enemies to move across the screen. My problem comes when I attempt to spawn multiple enemies on the screen at once. At this point, that pretty much breaks the program. The dropbox link to code is below.
https://www.dropbox.com/s/lhngszvcfz20yi3/game.bgt
As you can see, the problem is with the for loop in the move function. The break statement causes the function to stop after it moves the first enemy. If I take the break statement out however, the first time the move function is called the enemy bounces from the left to the right side of the screen instantly, because the for loop doesn't end, and the next space in the array will never be null, because the enemy has already been put there. If that makes sense. Does anyone have any ideas as to how I could get this to work? It's been driving me slightly insane, so... smile
Thanks!

URL: http://forum.audiogames.net/viewtopic.php?pid=159205#p159205

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
http://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • [Audiogames-reflector... AudioGames.net Forum — Off-topic room: Dranelement

Reply via email to