-
I am making a game that is sort of like Command and Conquer Red Alert. But with a different concept in mind. But right now, I need to know how I'm supposed to do this: Play an animation using a single bitmap. I have the bitmap here:
http://www.geocities.com/warmaster2000us/FPower.bmp
It's a bitmap with 29 Frames or sections each are 17 Pixels wide and 23 Pixels high. It is supposed to be about 2-3 seconds long. Just download the bitmap and save it to disk. Then work with it from there. As soon as you see this bitmap, you will figure out exactly what I'm talking about here.
Note: The animation is of the Fire-Power upgrade for Command and Conquer Red Alert. How I extracted these animations from Red Alert is from a utility called Ramix. http://come.to/tesla Thanks for any help.
-
Warmaster199,
Here is how u can create amimation from a single bmp. Add a Microsoft Clip Control to your form. Also add a imagebox and a timer. Set the Picture Property of the PictureClip1 to your picture(Fpower.bmp).
Code:
Dim y As Integer
Private Sub Form_Load()
PictureClip1.Cols = 5
PictureClip1.Rows = 6
Timer1.Enabled = True
Timer1.Interval = 100
End Sub
Private Sub Timer1_Timer()
y = y + 1
If y = 29 Then y = 0
Image1.Picture = PictureClip1.GraphicCell(y)
End Sub
-
The most wonderful thing for
making games is DirectX and
if you take some time to learn
it now, it will save you ALOT
of time and effort that will
just make you want to quit.
I would go to http://www.planet-source-code.com
and look up DirectX in the VB section
and then see what you can find.
-
Danial, that code is VERY helpful and good. It works like a charm. Also, I looked into the bitmap I posted here and found that it is 24 pixels high, not 23. all the other dimensions are fine. But your code didn't even need those dimensions. Thanks alot.
One thing, how do you make it so it doesn't loop?
-
OK. I found how to stop it from looping, but, Isn't there a more efficient way than using a timer, PictureClip, and Image control for each one? I know I can change the PictureClip and Image to another thing, but what about the Timer? DirectX is very fast and I know a bit of things in it, but how would I do this stuff using DirectX?
-
If you want to do the same thing in directx, then I think www.themasoft.cjb.net is one of the best sites to start. It has some excellent examples.
-
I didn't find that much on that site. Do you have another site?
Oh, is anyone interested in this game?