offsetting objects

BlitzMax Forums/BlitzMax Programming/offsetting objects

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.

Please help me out here, I'm still stuck on this. When the player reaches the center on the screen (the point where map scrolling begins), how can I have the bullet move backward as you move forward, and still keep the player centered?

Graphics 640, 480, 16, 2
SetBuffer BackBuffer()

A = 290: R = 0

PX = 20: PY = 260
While Not KeyDown(1)

Origin X, Y
Rect R * Cos(A), R * Sin(A), 4, 4
R = R + 3

Origin PX, PY
Rect 0, 0, 4, 4

If KeyDown(205) Then
	If PX < 320 Then PX = PX + 1 Else PX = 320
EndIf

If KeyDown(203) Then PX = PX - 1

If KeyHit(57) Then A = 290: R = 0: X = PX + OX: Y = PY

Flip:Cls
Wend:End
Use left/right to move and space to shoot.