Can some one help me in my GAme

09-28-2001, 05:47 AM
Hi, every body; nice to meet u all of you I am very new at this plate form and also in VB programming. My friend introduce my here I hope that I will get valuable knowledge from all of u n transfer my possible knowledge to u. now days I am making a game and I want to know that how to move a picture very smoothly on screen with arrow keys.

09-28-2001, 08:18 AM
I put together a really quick VB program to move Mario around the screen using the arrow keys.

09-28-2001, 08:47 AM
You said "smoothly".......that means learning DirectX

"I do not agree with a word you say, but I will defend to the death your right to say it" - Voltaire

09-28-2001, 10:31 AM
Good luck, just hope you know what you're letting yourself in for....... images/icons/smile.gif<P ID="edit"><FONT class="small"><EM>Edited by Squirm on 09/29/01 06:24 AM.</EM></FONT></P>

09-28-2001, 10:38 AM
I think it is good to start with what interests you. And at that age, that means games.

"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder

10-22-2001, 12:29 PM
Orufet, you only have to learn DX for smooth animation if you don't know anything about WinAPI programming. DX is not the answer to every problem. For newbies, DX is not the way to go. You can do very smooth double-buffered animation just using WinAPI code in VB.

Jonathan S. Harbour

10-22-2001, 12:32 PM
Describe what type of game you would like to build. For starters, I would recommend you just get a ball to bounce around on the screen. That is usually the best place to start learning to program a game. If you can manage to load a background image and display it, then load a sprite and animate it on the screen transparently, that is a GIGANTIC hurdle to cross over....after that, it's pretty easy to write an actual game. I'd be happy to help you get to that point by showing you how to load bitmaps and sprites and so on.

Jonathan S. Harbour

10-22-2001, 12:50 PM
That Mario demo is frightening!!! Hahahahaha! Sorry, no offense intended.

Okay, check out the attachment to this message. It does not use any bitmaps or sprites, so it is an easier way to get started and helps to learn the process. This program loads a background image and a sprite. The sprite image and mask are blitted using the WindowsAPI function BitBlt (which stands for bit-block transfer, and is commonly used to draw graphics quickly). You can BitBlt an image directly onto a PictureBox and speed things up quite a bit (rather than "moving" the image around on the screen, like the Mario demo). First, you BitBlt the mask using vbSrcAnd (a method that combines the destination bits) and then BitBlt the sprite using vbSrcPaint, which combines the AND'ed mask bits with the the sprite bits. The result is a transparent image. The code in the program bounces the image off the edges of the screen. The important thing about this demo is that it shows you how to write a real-time game loop that is needed for animation. You could actually write a game using this demo, but there are even better ways to do it (without DirectX)....

Jonathan S. Harbour

10-22-2001, 12:52 PM
You're right, it is pretty frightening. But it was the fastest thing I could put together in about 10 minutes. Granted, I didn't have any pre-built sprite or bmp libraries to use... :-) If you want some better looking stuff, please check out my Reversi, Yahtzee, or Asteroids games (posted within the last 3 months).

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum