Ok so im trying to make a 2d shooter game. And i thought a good place to start was with character movements. So i have found a sprite sheet with various pictures for movement and attacks. But what i want is for it to look like he is moving in the direction as the arrow key im pressing.
Here is some code i have pulled from various places, but need some help refining it.
sync on
rem Set the ink to white and paper color to black
ink rgb(244,214,210),1
rem Load a bitmap on to the screen
load bitmap "protoman.bmp"
rem Grab image 1 from bitmap
get image 1,0,0,39,53
rem Now we will make a sprites
sprite 1,100,100,1
if upkey()=1 then y=y-3
if downkey()=1 then y=y+3
if leftkey()=1 then x=x-3
if rightkey()=1 then x=x+3
sprite 1,x,y,1
FOR y=0 to 1
FOR x=0 TO 6
GET IMAGE 1+x+(y*7),(x*89),(y*120),(x*89)+89,(y*120)+120
NEXT x
NEXT y
rem Delete character bitmap
DELETE BITMAP 1
xpos=0
ypos=300
image=1
rem Begin Loop
DO
rem Run right and wrap
xpos=xpos+6 : IF xpos>640 THEN xpos=-64
Rem Animate runner and wrap
image=image+1 : IF image>12 THEN image=2
rem Update sprite
sprite 1,xpos,ypos,image
Loop
P.S. im using dark basic pro, but it needs to work in dark basic, are there any differences in the way the code is written?