Satellite in 2D Shooter

BlitzPlus Forums/BlitzPlus Programming/Satellite in 2D Shooter

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi!

Im currently coding a 2D Space Shooter. Now I have added a satellite flying around the player ship. The code is something like that:

Satellite\Pos=Satellite\Pos+1
If Satellite\Pos>360 Then Satellite\Pos=Satellite\Pos-360
If Satellite\Pos<0 Then Satellite\Pos=Satellite\Pos+360
		
Satellite\X = Sin(Satellite\Pos)*50
Satellite\Y = Cos(Satellite\Pos)*40
		
Satellite\Frame = (360-Satellite\Pos)*8 / 360
If Satellite\Frame>7 Then Satellite\Frame=Satellite\Frame-8

DrawImage SPR_Satelite,Player\X-Satellite\X,Player\Y-Satellite\Y,Satellite\Frame


Of course, the satellite should fire some shoots in the correct direction and i don't know how to calculate the Shoot\DX and Shoot\DY Values. I move every shoot like this:

Shoot\X=Shoot\X+Shoot\DX
Shoot\Y=Shoot\Y+Shoot\DY

I hope you know what I mean.