 |
| View previous topic :: View next topic |
| Author |
Message |
aaj2006 Newbie
Joined: 28 Mar 2005 Posts: 9 Location: Honduras
|
Posted: Apr 3rd, 2005 05:11 PM Post subject: Game Help |
|
|
| 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 |
|
DXGame Newbie
Joined: 12 Jul 2005 Posts: 3
|
Posted: Jul 12th, 2005 03:36 PM Post subject: |
|
|
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.  _________________ [link] - High level DirectX 2D game engine for use with VB6. |
|
| Back to top |
|
|
|
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
|
|