I'll explain MagiKnight's code so everyone can understand better. MagiKnight's character (we'll call it char1) is 64*64 pixels in size and has 5 frames in it's animation. His bitmap is 512*384 so I assume his bitmap contains not only the animation for (char1) but other animations as well. However the animation for (char1) consists of only the first five images you will grab (or get). Each frame of the animation is 64*64.
for y = 0 to 384 - 63 step 64
for x = 0 to 512 - 63 step 64
get image seq1, x, y, x + 64, y + 64, 1
inc seq1
next x
next y
This code is essentially grabbing the seperate 64*64 frames from the 512*384 bitmap and placing them into images. To go even more in depth, here is the order in which the code is grabbing the images:
The first image grabbed has the perameters: for x = 0 and y = 0
(img#, left, top, right, bottom, texturestate)
1,0,0,64,64,1
The second image grabbed has the perameters: for x = 64 and y = 0
2,64,0,128,64,1
The third image grabbed has the perameters: for x = 128 and y = 0
3,128,0,192,64,1
etc. etc. ...
That statement continues until x = 320 and y = 448 thus grabbing a total of 48 images.
BUT REMEMBER, (char1) only has 5 frames of animation and it just so happens that the first five images that were grabbed make up the animation. The next segment of code is what actually runs the animation:
ani = 1
` puts us in control of screens refresh rate
sync on
do
` past image whatever ani is eqaul to, at xpos, ypos, and don't show any black pixels
paste image ani, x, y, 1
` move to next image#
ani = ani + 1
` if you've shown image five then go back to image one
if ani > 5 then ani = 1
` I added this so that the animation would slow down to a more viewable state
sync : sleep 1000
loop
This just so happens to be a never ending loop so you'll have exit using F12. I hope that helps everyone understand a little better.
As a warning to you SmokieMcPot. Most sprites people use are 32*32, 64*64, 128*128 and so on. This is because some video cards cannot support irregular sizes. I've never seen this happen but it's a good precausion to take. In the case of your bitmap this is how you would enter the code:
seq1 = 1
load bitmap "Novice_Small.bmp" , 1
for y = 0 to 100 - 49 step 50
for x = 0 to 100 - 49 step 50
get image seq1, x, y, x + 50, y + 50, 1
inc seq1
next x
next y
delete bitmap 1
ani = 1
sync on
do
paste image ani, x, y, 1
ani = ani + 1
If ani > 4 Then ani = 1
sync : sleep 1000
loop
This assumes you have one 50*50 object to animate with 4 frames on a 100*100 bitmap.
I wish I was able to post some images on the web so you could get an even better idea, but hopefully everything makes more sense now. I hope this helped
I've got DB Classic and PS Skillz and I'm not afraid to use um!