Quote: "So how would I animate a sprite?"
In a nutshell, create the images needed to give the illusion of movement. Code it so that the images are played in a fluent manner.
You could use the CREATE ANIMATED SPRITE command, but I normally do not use it myself, as there is at least one issue with it. I like to do like Van B's first idea, make a sprite sheet and pull the images off of it within a game.
Here is some example code that may help you:
` grabbing images off of a sprite sheet - LBFN
sync on : sync rate 60
backdrop off : autocam off
randomize timer()
dim speed(3)
ScrWid = (screen width() - 32)
load bitmap "Emmy.jpg",1
restore ImageData
for img = 1 to 3
read x1,y1,x2,y2
get image img,x1,y1,x2,y2
next img
delete bitmap 1
set current bitmap 0
for s = 1 to 3
sprite s,rnd(500) + 40,rnd(300) + 50,s
speed(s) = rnd(7) + 1
next s
repeat
for s = 1 to 3
sprite s,sprite x(s) + speed(s),sprite y(s),s
if (sprite x(s) > ScrWid) or (sprite x(s) <= abs(speed(s))) then speed(s) = speed(s) * -1
next s
sync
until spacekey() = 1
end
ImageData:
` x1, y1, x2, y2
data 0,0,31,31,64,0,95,31,0,32,31,63
It is a simple program to show you how to pull images off of a bitmap. Once grabbed, the images are used by three sprites to move horizontally back and forth across the screen. The bitmap is attached to this post.
EDIT: It is worth noting that the sprites are not animated. This example is only intended to show you how to pull images off of a bitmap.
So many games to code.......so little time.