How do I animate a person, so that he doesn't just float over the ground?
Animation
BlitzPlus Forums/BlitzPlus Beginners Area/Animation 1) Make multiple animation cells
2) Instead of LoadImage, use LoadAnimImage and specify the sizes and numbers of cells
3) When drawing your sprite, there is an additional (optional) parameter where you can specify the cell number... So use a counter or timers, and cycle through the different frames when you draw your sprite.
2) Instead of LoadImage, use LoadAnimImage and specify the sizes and numbers of cells
3) When drawing your sprite, there is an additional (optional) parameter where you can specify the cell number... So use a counter or timers, and cycle through the different frames when you draw your sprite.
By 'Make multiple animation cells' do you mean draw the person in different stages of movement? What is a 'sprite'? Please explain it more simply(sorry I don't get this; I'm a beginner)?
1) Lets say your man is 32 pixels wide and 64 pixels tall, this would be 1 frame (a rectangle). You may need something like 8 frames or more (each showing a slightly different picture) to give the impression of walking (animation). So make a bitmap in paintshop pro or something that is 8x32 pixels wide and 64 pixels tall. You will find it useful to draw 8 rectangles (32 pixels wide) side by side on the blank bitmap. Then you can draw each frame within the rectangles. There are also some tricks to making the man walk smoothly (the same amount each frame) but that's for another day.
2) Now use LoadAnimImage and use the parameters to say you have 8 frames, and each are 32 pixels wide.
3) Make a variable in your program that says which frame the man is on i.e. start it at 0 and when it goes past 7 put it back to 0. Then when you draw your man with DrawImage, just show the correct frame. You will need a decent delay between each frame (i.e. when you add one to the variable mentioned earlier) or he will walk way too fast.
Your man is a "sprite" this is an object that moves around and interacts with the game world. Other sprites are enemies and bullets etc. Background scenery is not a sprite unless it is a moving lift or something. There are no "Sprite" commands as such in Blitz, it is just a very old game programming term.
hope this helps
2) Now use LoadAnimImage and use the parameters to say you have 8 frames, and each are 32 pixels wide.
3) Make a variable in your program that says which frame the man is on i.e. start it at 0 and when it goes past 7 put it back to 0. Then when you draw your man with DrawImage, just show the correct frame. You will need a decent delay between each frame (i.e. when you add one to the variable mentioned earlier) or he will walk way too fast.
Your man is a "sprite" this is an object that moves around and interacts with the game world. Other sprites are enemies and bullets etc. Background scenery is not a sprite unless it is a moving lift or something. There are no "Sprite" commands as such in Blitz, it is just a very old game programming term.
hope this helps
So let me get this straight. I draw all the frames on one bitmap? Thanks for helping me.
Note that the DrawImage command has a fourth parameter for setting the frame to draw.
DrawImage image, x,y [,frame]
Parameters:
image = variable image pointer previously designated
x = the 'x' location of the screen to display the graphic
y = the 'y' location of the screen to display the graphic
frame = the frame number of the AnimImage to display (optional: default is 0)
Parameters:
image = variable image pointer previously designated
x = the 'x' location of the screen to display the graphic
y = the 'y' location of the screen to display the graphic
frame = the frame number of the AnimImage to display (optional: default is 0)
So let me get this straight. I draw all the frames on one bitmap? Thanks for helping me.
That's by far the easiest, since it will allow you to change a single variable in the drawimage command to cycle through the steps of your animation.
What is a good drawingprogram to merge drawings to 1 animation. I did not succeed with photoshop and other drawingprogram you can only 'stitch' but that won't work either because you lose a strip from your drawing?
Anybody can recommend a good and easy drawing prgram to merge discrete drawings to 1 animation?
Anybody can recommend a good and easy drawing prgram to merge discrete drawings to 1 animation?
Check the BlitzBasic.com Toolbox; there's an excellent program there called GraphicsGale, specifically geared towards creating "sprites." When you install GG, follow this procedure for each image, to put them into one.
1. Start a new image in GG, and set the width & height values to the dimensions you need.
2. Open the first image that you want to insert, but open it in Microsoft Paint (my recommendation.)
3. Press CTRL + A to select the entire image, then press CTRL + X to "cut" it out.
4. Return to GG, and press CTRL + V to paste the image.
For every additional frame, click "Add Frame" (second toolbar, far left) and repeat steps 2-4. Note that all frames must be the same size, if they're in a single image. Good luck!
1. Start a new image in GG, and set the width & height values to the dimensions you need.
2. Open the first image that you want to insert, but open it in Microsoft Paint (my recommendation.)
3. Press CTRL + A to select the entire image, then press CTRL + X to "cut" it out.
4. Return to GG, and press CTRL + V to paste the image.
For every additional frame, click "Add Frame" (second toolbar, far left) and repeat steps 2-4. Note that all frames must be the same size, if they're in a single image. Good luck!
OK thanks for the program