@zDough BoyZ
I have edited your code. You actually had a few problems in it.
Load Music "Music\01 Lazy Generation.mp3",1
Play Music 1
backdrop on
color backdrop rgb(255,255,255)
sync on :sync rate 60
x=200: y=200 : a=0
load image "Bitmap\Galactic Wars.bmp" ,1
playersprite=1
sprite playersprite,x,y,1
flip sprite playersprite
offset sprite playersprite, sprite width(playersprite)/2, sprite height(playersprite)/2
do
oldx=sprite x(playersprite)
oldy=sprite y(playersprite)
if upkey()=1 then move sprite playersprite,5
if leftkey()=1 then a=wrapvalue(a-5) : rotate sprite playersprite,a
if rightkey()=1 then a=wrapvalue(a+5) : rotate sprite playersprite,a
If sprite x(playersprite)<0
sprite playersprite,oldx,oldy,sprite image(playersprite)
endif
If sprite x(playersprite)>screen width()
sprite playersprite,oldx,oldy,sprite image(playersprite)
endif
If sprite y(playersprite)<0
sprite playersprite,oldx,oldy,sprite image(playersprite)
endif
If sprite y(playersprite)> screen height()
sprite playersprite,oldx,oldy,sprite image(playersprite)
endif
sync
loop
You had not set the playersprite variable to one. Also, there is no 'position sprite' command in DBP, you just put 'sprite #,X,Y,IMAGE'
Agent Dink was correct in his code
(my apologies Agent Dink), because I missed it that you had offset the sprite to the center. Still, half of the sprite goes off the screen. If you are looking for something other than that, then your code would have to be altered.
The code could be done more efficiently, but I didn't want to edit it beyond what I had so that you could see what I did.
LB