Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Direct X / Game Programming

Post new topic   Reply to topic
Game Help
View previous topic :: View next topic  
Author Message
aaj2006
Newbie


Joined: 28 Mar 2005
Posts: 9
Location: Honduras

PostPosted: Apr 3rd, 2005 05:11 PM    Post subject: Game Help Reply with quote

Ok so i was thinking about making a game like star craft or age of empires or any other game where you create and controll many different units. one where if you cilcked on a tank for example, you could then click on a place on the map and it would go there. the problem is that i would have to use bitblt to prevent that damn flickering, but since bitblt DRAWS the image to the screen, its not really an object that i can click on or select in any way. so how would i do this??? any suggestions? i dont need a whole explination, just an idea because i dont even know how it is done or where to beggin or anything. to me, its impossible right now. any pointers would be nice. thanks.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
DXGame
Newbie


Joined: 12 Jul 2005
Posts: 3

PostPosted: Jul 12th, 2005 03:36 PM    Post subject: Reply with quote

Hi,

Assuming you are already familiar with using bitblt then you might want to consider thinking of your game in terms of a "tile map". Where you store your tiles inside a picture and then blit them to build your game screen.

The good thing about this technique is you can then divide the game screen / tile width and then you can easily convert the mouse into a tile location. Something like:

xpos=int(gamewidth/tilewidth)
ypos=int(gameheight/tileheight)

And finally you have an array something like:

tile(xpos,ypos)

Yah, you pretty much have to roll your own when bit blitting, but the rewards are usually worth the effort. Wink
_________________
[link] - High level DirectX 2D game engine for use with VB6.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Direct X / Game Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic