2D Guidance needed
Hiya! My goal is to make a Worms-type clone (http://wormsarmageddon.team17.com/main.html?page=mult&area=scre). I've spent a couple hours sorting through all of the posts on the various forums on this site, and I've tried to put together everyone's responses into one comprehensive method, but I still have some questions. So I'd appreciate any comments or source that might help me get started.
Apparently Worms used 1 bit monochrome bitmaps and then converted those into 8bit 256 color textures. The bitmaps would have two colors: black is terrain and white is sky. This comes into play when you texture the land, and with collision detection\explosions. Since the land is deformable, you find the coordinates of an explosion, and create a circle with a certain radius - then you convert that section of the terrain to white (sky.. or transparent). So I guess you would have to store the black white values in a multi-demensional array [800][600] and then would you need to have another heightmap array which will tell you if your worm is standing on land? I just need a way to always know where the worm is, and what type of land he's (she's) standing on. My guess is that this could get pretty slow - I mean, if you're inching up a hill that's one thing, but what if you get blown off a cliff and are sailing through the air, wouldn't it be pretty slow to check every pixel (unless you could calculate the trajectory ahead of time and see if it would hit ground).
I also still have some questions about how to texture the area which is designated with land. I've done some game programming in OpenGL, but I think I should do DirectX for this game (a couple of posts said it would be better with pixel manipulation). If I do use DirectX, should I use 9, or 8.1? And can you just do "Texture the all of the 'black' land with this 50x50 texture"? Or do I have to divide it up into triangles and texture that? Or is there a way to run each pixel of the texture through the array and print that pixel out if there is ground there? Just looking for the best method. I am going to keep doing research before I get started, but I was hoping to get some input. Thanks!
Jim
[edited by - jimothygu on October 16, 2003 12:51:40 PM]
I''ve thought about doing a game like this before. I think you should just use pixel collision on each worm or character when they move. It shouldn''t take too long because it''s the only big calculation that''s going on during those frames. You shouldn''t need to update AI when something is moving. If that ends up being to slow you might just want to try using bounding boxes for the worms and checking each backroung pixel against it.
There''s no reason the collision check with each pixel would be slow, because you don''t have to check with each pixel, only the surrounding pixels. If you''re certain that the moving object will NEVER move more than one pixel per iteration, you only have to check the 8 pixels surrounding the current location. That''s very fast. If it''s possible that it would move 3 or 4 pixels per iteration, then expand the search area likewise. The number of checks would still be small.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement