I'm making a little jet combat game and I'm trying to figure out the best way to shoot machine guns at a target. Right now I'm creating a sphere and setting to the location of the plane, changing it's angles to match the planes facing and then moving it forward. The problem is the bullet seems to go backwards? My other question is... Is there a better way? Like using a particles to create a small burst of machine gun fire?
Shootguns and
UpdateBullets are both subroutines called in my main game loop. Here is the code:
shootguns:
REM Fires the Machine guns and checks for hits
if BulletLife=0
Position sound 11,X#,Y#,Z#
if sound playing(11)=0 then Play Sound 11
Position object 3,X#,Y#,Z#
rotate object 3, object angle x(10),object angle y(10), object angle z(10)
show object 3
set object collision on 3
Endif
return
UpdateBullets:
If BulletLife > 0
move object 3,speed#+cBulletSpeed
if object collision(3,0)>3
text 10,10,"HIT"
score=score+1
endif
Dec BulletLife
If BulletLife = 0
Hide object 3
set object collision off 3
endif
Endif
return
Any help would be greatly appreciated.