This is probably a stupid question, but I am really terrible with math and haven't been able to figure this out. I am writing a side scrolling game that needs to offset objects with scrolling. When a player shoots a bullet that uses sin/cos for an angled shot, how would I go about moving this bullet backwards as the player runs forward? I've tried changing the X, Y origin, but this changes the whole path of the bullet.
Here is example code (not bmax because im lazy)
Here is example code (not bmax because im lazy)
Graphics 640, 480, 16, 2 SetBuffer BackBuffer() A = 290: R = 0 X = 320: Y = 240 While Not KeyDown(1) Rect R * Cos(A) + X, R * Sin(A) + Y, 4, 4 R = R + 3 ;X = X - 1 Flip:Cls Wend:EndIf you uncomment the X line, the bullet path changes instead of moving backwards while still traveling at the same angle. How do I accomplish this?