Ok, here is my code. I am trying to animate a car. I also want it to use up as accelerate, no matter which way it is facing. So that makes the animation a bit tricky. All I can do (until my registered DBPro with tutorials shows up) is get the thing spinning around. It is for a super sprint styled game and I can't use sprite rotate as the cars are isometric. Hope someone can help and please don't laugh at my code, it's my first day trying!!
[code]rem sets up screen
hide mouse
if check display mode(1280,1024,32)=1 then set display mode 1280,1024,32
rem this sets invisible color to that weird blue green.
rem set color key choose invisible colour. 255 is max.
set image colorkey 000,255,255
rem loads sprite graphics into memory
rem the 4, 4 means four frames across and four frames down on the bmp.
rem the picture that I have loaded has sixteen frames on animation
create animated sprite 1, "Drift Graphics\F50\Digitized F50 Sprites\All Frames 02.bmp", 4, 4, 1
rem this loop enables the car to be controlled by joystick
rem the number at the end is speed. -1 means axis y up, +1
rem means axis y down etc.
do
sprite 1,300,300,1
sprite 1,player1x,player1y,1
if joystick up()=1 then play sprite 1,2,5,1: player1y=player1y-1
if joystick down()=1 then play sprite 1,6,9,1: player1y=player1y+1
if joystick left()=1 then play sprite 1,10,13,1: player1x=player1x-1
if joystick right()=1 then play sprite 1,14,16,1: player1x=player1x+1
if joystick fire a()=1 then player1x=player1x+2
loop
[/code]
rem sets up screen
hide mouse
if check display mode(1280,1024,32)=1 then set display mode 1280,1024,32
rem this sets invisible color to that weird blue green.
rem set color key choose invisible colour. 255 is max.
set image colorkey 000,255,255
rem loads sprite graphics into memory
rem the 4, 4 means four frames across and four frames down on the bmp.
rem the picture that I have loaded has sixteen frames on animation
create animated sprite 1, "Drift Graphics\F50\Digitized F50 Sprites\All Frames 02.bmp", 4, 4, 1
rem this loop enables the car to be controlled by joystick
rem the number at the end is speed. -1 means axis y up, +1
rem means axis y down etc.
do
sprite 1,300,300,1
sprite 1,player1x,player1y,1
if joystick up()=1 then play sprite 1,2,5,1: player1y=player1y-1
if joystick down()=1 then play sprite 1,6,9,1: player1y=player1y+1
if joystick left()=1 then play sprite 1,10,13,1: player1x=player1x-1
if joystick right()=1 then play sprite 1,14,16,1: player1x=player1x+1
if joystick fire a()=1 then player1x=player1x+2
loop[/code]