Asteriods Clone - WIP screenshots and demo

Miscellaneous Forums/Blitz Showcase/Asteriods Clone - WIP screenshots and demo

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.

Just wrap the x and z coords ( assuming the camera is looking straight down at the ship ) like you would in a 2D game with x and y.

So if the ship is always at 0,0,0


PseudoCode

factorx=screenwidth/2
factorz=screenheight/2
newx=entityx(asteroid)
newz=entityz(asteroid)
wrap=false

if entityx(asteroid)>factorx or entityx(asteroid)<-factorx
newx=-newx
wrap=true
endif

if entityz(asteroid)>factorz or entityz(asteroid)<-factorz
newz=-newz
wrap=true
endif

if wrap=true then positionentity asteroid,newx,0,newz



You would have to adjust factorx and z to account for how far away the camera is from the ship to compensate for perpective but thats the general idea.

I liked the control method and the sense of scale that 3D brings, try bumpmapping the asteroids to make it even more realistic looking.