PDA

View Full Version : 2d space shooter help! (PS2 C++ codeing)


Sent1nel
10-31-2007, 08:44 AM
Hi, I've been tasked with creating a 2d sprite based game on the PS2 and so far it seems to be pretty simple. However I'm trying to create the ability of the player to be able to shoot more than one laser at a time (ie so that the player can press corss twice within a few miliseconds and fire 2 lasers etc etc).

Whats the best way to go about doing this, as i recall having the same problem when coding in flash for a scrolling shooter?

Jare
10-31-2007, 10:48 PM
An array of N bullets. When you shoot, find one bullet in the array that is "dead". When a bullet dies (it goes off the screen, or hits an enemy, or has flown for X time) then mark it as "dead". You can have a total of N bullets at any one time.

Definitely the simplest way, and in some circumstances the best.