That's strange... I put the code in the code box below the message box... Oh well, guess I'll have to post it again. Maybe it has something to do with the fact that I'm a new member. Since I'm a new member it takes hours for my message to actually be posted because it has to be evaluated, maybe the code was lost during the process. I'll try posting it again. Just so you know, its going to be a Yoshi's Island style game, so that's why there's a lot of images in there titled "Yoshi". Here's the code (hope it works this time!):
sync on
gosub images
gosub variables
backdrop off
for y=0 to 14
for x=0 to 19
read map
if map=1 then paste image ground,x*tilesize,y*tilesize
if map=2 then paste image sky,x*tilesize,y*tilesize
if map=3 then paste image block,x*tilesize,y*tilesize
next x
next y
Do
cls
`debug counters that will later be removed, just here now so I can keep track of the animation timers and x and y coordinates.
text 25,25, Str$(A)
text 25,35, Str$(E)
text 25,45, Str$(B)
text 25,55, Str$(C)
text 25,65, Str$(D)
text 25,75, Str$(yoshi_x)
text 25,85, Str$(yoshi_y)
gosub animation
`movement
If rightkey()=1 then inc yoshi_x,3
If leftkey()=1 then dec yoshi_x,3
`direction
If rightkey()=1 and D=1 and shiftkey()=0 then mirror sprite 1:D=0
If leftkey()=1 and D=0 and shiftkey()=0 then mirror sprite 1:D=1
`Eventually I'll put some gravity coding here, I removed it because I don't know how to make the sprite collide with the tiles, and I don't want him to just fall off screen.
`yoshi sprite
sprite 1, yoshi_x, yoshi_y,B
set sprite 1,0,1
sync
loop
images:
load image "groundtile.bmp",1
load image "sky.bmp",2
load image "ground2.bmp",3
load image "yoshi1.bmp",11
Load image "yoshi2.bmp",12
Load image "yoshi3.bmp",13
Load image "yoshi4.bmp",14
Load image "yoshi5.bmp",15
Load image "yoshiwalk1.bmp",16
load Image "yoshiwalk2.bmp",17
Load Image "yoshiwalk3.bmp",18
Load Image "yoshiwalk4.bmp",19
Load Image "yoshijump.bmp",20
return
variables:
ground=1
sky=2
block=3
tilesize=32
Yoshi_x=320
Yoshi_y=240
return
animation:
`sprite animation timers
inc A
Inc E
`idle animation
If rightkey()=0 and leftkey()=0 then C=1
If C=1 then E=0
If A>=0 and A<=4 and C=1 then B=11
If A=5 then B=12
If A=10 then B=13
If A=15 then B=12
If A=20 then B=11
If A=25 then B=14
If A=30 then B=15
if A=35 then B=14
If A=40 then B=11
If A=45 then B=12
If A=50 then B=13
If A=55 then B=12
If A=60 then B=11
If A=80 then A=0
`Walking animation
If rightkey()=1 or leftkey()=1 then C=2
If C=2 then A=0
If E>=0 and E<=4 and C=2 then B=11
If E=5 then B=16
If E=10 then B=17
If E=15 then B=16
If E=20 then B=11
If E=25 then B=18
If E=30 then B=19
If E=35 then B=18
If E=40 then E=0
return
map:
`map data obviously
Data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
Data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
Data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
Data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
Data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
Data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3
Data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3
Data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3
Data 2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3
Data 2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3
Data 2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3
Data 2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3
Data 2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3
Data 2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3
Data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
`end of code
It'll be my luck the code doesn't show again even though I've put it in a snippet.