360 shooter.... scrolling background

BlitzMax Forums/BlitzMax Beginners Area/360 shooter.... scrolling background

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.

Your not offsetting the enemies from the players central position..

' Some constants to control the radar

Const radarScale = 40 '8000/200
Const radarOffset = 200 '100*2
Const radarWidth = radarOffset*2

'Calculate radar position as an offset from the player

RadPx = ((e.x-px)/radarScale)
RadPy = ((e.y-py)/radarScale)

'ensure radar wraps around player - only use if game arena wraps around player 

RadPx = wrap(-radarOffset,radarOffset,RadPx)
RadPy = wrap(-radarOffset,radarOffset,RadPy)

'wrap function ensures radar image wraps around game arena

Function wrap(min,max,value)
 local width:int = max-min
  if value > max then 
    value:-width
  else if value < 0 then 
    value:+width
  endif
end function


Hope this helps