PDA

Click to See Complete Forum and Search --> : Which is better?


May 17th, 2000, 03:41 AM
Which is better for a character? BitBlt Animation? Or just moving an Image or PictureBox when they key is pressed.

ChillyCode
May 18th, 2000, 04:11 AM
You should use BitBlt cause then you can make the backround transparent and it is faster. Pluss you can do double buffering. If you need n e more help or want to start a game w/ me. E-mail me

May 18th, 2000, 07:08 AM
How would you detect collision then? With a control, all you need to do is check is the Image's Top or Left property Surpasses a certian point. Is there a way to detect collision?

SteveCRM
May 18th, 2000, 08:46 AM
I've been having trouble finding out collision detection in BitBlt, tell me if you get anything.

I've tried things like:

If Enemy.x > Shot.x > Enemy.x then this should tell when shot is 'in' the enemy, but it doesn't :(

May 19th, 2000, 02:52 AM
But when using BitBlt, you do not know where the character is on the screen. Unless you record the position in a Variable. Is that what you are using as well?

May 19th, 2000, 02:54 AM
By the way, i think i have a solution for your problem.
If you have both coordinates stored in a variable, make sure that both X AND Y are in the correct position.

Emeny.x could be greater than Bullet.x, but their Y coordinates could be 100's of units apart.

KENNNY
May 19th, 2000, 05:29 AM
general point here: when making games, forget all "normal" VB. Dont use activex controls (ie img boxes, picboxes, etc) as it's slow and inflexible. Everything is stored in variables, types, etc.
And use directx :)

SteveCRM
May 19th, 2000, 05:30 AM
Back to work then...By the way, who ever won the race to the 1000 post mark? Im guessing Kedamen but just curious.

May 19th, 2000, 05:37 AM
STEVECRM: Kedaman won.


KENNY: I'm still learning some things about Game Programming. I haven't got into DirectX yet, though.

I've stopped using VB and am starting to learn a lot of C++ now. I believe it will help me a lot more in the long run.

Xero
May 20th, 2000, 09:00 PM
Kenny: I wanted to use DirectX, but I learn best from examples of what I want to do(tile-based rpg engine) and I couldn't find any. Do you know where any are? Or, do you know any websites that could help me out?

Fox
May 20th, 2000, 09:49 PM
There are BitBlt and DirectX samples on my website (http://foxmccloud.tsx.org).

parksie
May 23rd, 2000, 12:25 AM
2D graphics, use DirectX every time.

If you want to use DirectX for 3D, prepare for months of late nights banging your head against the wall due to Microsoft's sadistic desire to make developers do things the hard way. OpenGL is much easier to use, and there are open source implementations of it. Sure, it doesn't provide direct access to the hardware, but the M$ software driver is quite fast. Then watch it on a GeForce and your jaw will plummet through the floor.

Fox
May 23rd, 2000, 01:26 AM
OpenGL isn't that much easier. After initializing D3D it's nearly the same. And with D3D you have support for the latest hardware and newest effects ;)

And BTW: Good programmers only use D3D / OpenGL to draw their pre-calculated polygon arrays to the screen :).

KENNNY
May 23rd, 2000, 06:56 PM
yes, D3D is extremely dodgy :)
all the tutorials I've seen are totally different yet doing the same thing. You need a map editor for anything more complex than a cube, 'cos hard-coding vertices *really* isnt good :)

gl support for VB is pretty poor; there's no documentation (i think), but if u wanna try it get the typelibrary from patrice scribe's site.

D3d will get better, hopefully, as m$ release new dx versions. dotn hold your breath though :)

parksie
May 24th, 2000, 02:44 AM
Fox: Yeah, and initialising DX takes forever. With OpenGL (especially GLUT) you're there in about 50 lines. DX is coming up on hundreds, especially in VB.

KENNNY: There's tons of documentation for OpenGL, and since it's function-based rather than interface-based, it's dead simple. Quick Tip: remember VarPtr (get a pointer to an array). Do a search for "Ryan Myers" to get some decent tutorials.

KENNNY
May 24th, 2000, 04:20 AM
ok thanks, I'll try that
I have a couple of samples on GL, but I haven't got the time to do 3d at the mo. :(

May 28th, 2000, 12:33 PM
how do I use bitblt if I dont have a picbox?

parksie
May 29th, 2000, 12:16 AM
Use the device context for whatever it is you want to paint onto. Form.hDC, UserControl.hDC, ...

May 29th, 2000, 03:41 AM
Some controls like the ImageBox don't have an hDC property.

parksie
May 29th, 2000, 07:53 PM
yeah, I know, it's a bit of a shame. why m$ can't get it sorted and let you get at the useful stuff I have no idea. looks like you'll have to use a picturebox anyway, or use the form's DC and the coordinates from the image control.

May 30th, 2000, 08:00 AM
an ImageBox is basically just for decoration. It doesn't use up any resouces either. It's ust a small to for displaying images.

Well, I suppose it is convienient in it's own way.