Click to See Complete Forum and Search --> : Single Bitmap Animations(NEED HELP)
Warmaster199
Oct 6th, 2000, 04:20 PM
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.
dangerousdave
Oct 7th, 2000, 12:51 PM
BitBlt. That and the other windows API graphics functions are your answer. Although if your making something as big as Red Alert you may wanna learn DirectX.
Once you know BitBlt's brother StretchBlt:
Private Declare Function StretchBlt Lib "gdi32" Alias "StretchBlt" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Err, ok, I'm not gonna explain all that, but as I was saying, once you know stretchblt you can see that you specify the Start X and the Start Y and then the width and height within the DC (picturebox) that you are copying from. I.e. you specify a selection within the picture that you are copying from and then you copy it to another DC (picturebox)... or even to a different position in the same DC.
Damn I'm bad at explaining things. Hope you understand.
Warmaster199
Oct 7th, 2000, 01:33 PM
Can you show me how someone would go around doing this (Post the code for doing it here)? I was told how to do this with the PictureClip OCX, but I need a Timer for each seperate picture. That can get VERY nasty and slow as it is quite in-efficient for the graphics I need it for. I'm quite good with DirectX and I've seen this done with just DirectX in the SpaceShooters2000 game from the SDK. But that has 100's of lines of code and is VERY complex. Can someone simplify it to just the code I need?
/\/\isanThr0p
Oct 7th, 2000, 10:38 PM
Hi Warmaster.
I'm not one of those people making fun of people who want to make projects in VB. Actually I'd really like to do a role play game (i'm not really into this stuff, because I have nobody for a good story) or a Command and Conqer like game. I'm always searching for people serious interested in bigger projects! BUT here my advice: Visual Basic isn't the fastet language, so use it's capabilities and make the game in DDraw! It is really great! Animation isn't hard at all with DDraw, it workes just the same way like with the bitblt, when you use bltfast it is even easier!
Vuen
Oct 8th, 2000, 11:36 PM
Hi man cool I'm also writing an RTS-style game (also single-handedly). And yes I also do it for FUN :)
So anyways, if your going to make an RTS in VB, you HAVE to use DirectX. Thats the only way VB stands a chance at makin a game good like C&C. Otherwise it's just too slow. There's a kick-butt tutorial on DDraw on this very site www.vb-world.net, (almost the only tutorial that the code shown works), and from there, you can go do anything. Keep in mind the fact that you are the GOD of your game :) and so ask lots of questions here and maybe get the DX sdk (but its 100megs so use getright/gozilla), I'm not gettin it too long to d/l. Besides, you can find out anything by just asking here.
check it out this is one of the units to be in my game (this one's only a mere 85 feet tall)
http://www.geocities.com/vvuueenn/bigelec.gif
Warmaster199
Oct 9th, 2000, 08:18 AM
I have a bit of experience in DirectX. I do have the SDK, and I've even created my own 3D Graphics engine; I3D. The site is http://www.geocities.com/warmaster2000us I am planning on using DirectX but I don't know how to run these Single Bitmap Animations using DirectDraw.
If anyone would like to help, Email me.
warmaster199@Hotmail.com
I need lots of help in making the graphics too. I have the graphics but they are individual pictures(1 per frame). I need them put into Single Bitmap format like the bitmap I shown here. This will be very time consuming because some of the units(men) have about 400-500 frames each(ouch!). I am actually getting these graphics from RedAlert itself using a Mix file Extractor utility.
Email me and I'll email you some graphics to work with if you would like to help. :)
[Edited by Warmaster199 on 10-09-2000 at 09:25 AM]
/\/\isanThr0p
Oct 9th, 2000, 05:48 PM
Man that's so easy, or I didn't got your question! Just put the graphics into one bitmap, than you have an variable for the animation state, use this var times the width of your pics to define your source!
Vuen
Oct 9th, 2000, 07:07 PM
WOW do you mean just how to grab one bitmap out of there and blit the next in succesion at every timer tick? OMG
Let's say these are my sprites I want to blit for an animation, so each sprite is 50x50:
http://www.geocities.com/vvuueenn/move.gif
Ok. Let's say the direction is the variable bytDir, MoveSrf is the surface you have, and Ctr is a counter that starts at 0 and on every timer tick it goes up one and after 7 it goes back to 0, this is your source Rect for blitting:
Rect.Top = 50 * Ctr
Rect.Left = 50 * bytDir
Rect.Bottom = 50 * (Ctr + 1) - 1
Rect.Right = 50 * (bytDir + 1) - 1
That's it. Just set bytDir to the direction the animation is, then make a loop, and each time in the loop Ctr goes up 1 unless it was 7 in which case it goes back to 0. Then in the loop put that Rect code in, and BltFast. That simple.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.