Click to See Complete Forum and Search --> : Sector-based game
One Eyed Jack
Jul 13th, 2001, 11:17 PM
Okay I have a new idea for my game. I want to use a single picture as the map (rather than tiles in bitblt). I want this to be a topview but from an angle (sorta like CHASE MODE in action games). Anyone ever play Darksun ? well thats what I mean. I will have the pictures for all of the players and monsters etc. I plan on defining walls and special areas by SECTOR. Like I'd draw a square on the area i want a wall at, and combine this with the bmp map. The sector would be a square with four points, the points being the pixel (X,Y) coords for ease of use. HELP
Zaei
Jul 14th, 2001, 12:55 AM
When you "Draw" on the map to create walls, just put the drawings into another bitmap image. "Walls" should be black, anything else, white. Then, in the game, each time a character moves, check to see what color he is on, in the other bitmap. If you get a 0 for the color, you cant go there.
Z.
kedaman
Jul 14th, 2001, 11:53 AM
You could use GDI regions to list up the rects, and then perform region operations like combinergn, rectinrgn and pointinrgn to speed up your game, rather than coding the equivalents in vb.
progeix
Jul 16th, 2001, 04:11 AM
you could just load the map up, and have the map have values, 0 and 1.
0 is walkable. 1 isn't.. (or you could set speeds, 0 - no movement, 1 - slow, 5- fast
then just load that in an array
then when your program calls the movement of the player.. say it's moving 2 left.
it'll move ONE LEFT, is it moveable? , if it is 0, then just STOP and don't move there
if you can move.. then move, and then check the next square,
Rather, rinse.. repeat
or you can check what image is on your map.. and if your charcater runs into the side of the image.. then just stop
this probably isn't the best way.. but oh well
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.