Worms surface

Nibbie
Posts: 4
Joined: 2009.06
Post: #1
Hey...
I'm sorry if this issue has been already discussed before, but I couldn't find anything about it anywhere... Annoyed
I'm trying to develop a game with a surface like the Worms game has.
I've been looking into some guides, and discovered I should create a two dimensional array (BOOL type is sufficient, isn't it?) representing where the surface exists and where it isn't (free space).
Now, my only problem is, how can I convert this array to the surface itself?
Let's say I have two images, one is the background, and the second is the surface (both full screen size), how can I layer those images so the surface image will only appear in the surface area as defined in the array? Is there a bitmask option or something?

I'm considering using cocos2d, so a solution involving cocos2d's features will be great as well.

Thanks!
Quote this message in a reply
Moderator
Posts: 373
Joined: 2006.08
Post: #2
Worms uses "poxels" (a word that, AFAIK, they made up), which are a mixture between voxels and polygons.

Reading the wikipedia entry on the Marching Cubes algorithm may help get you started, since it's what you'll be trying to do, but in 3D.

TomorrowPlusX has a lot more experience with this kind of thing than I do; looking over his thread here: http://idevgames.com/forum/showthread.php?t=15018 should give you some good information (especially his post in the second page).

Hope that helps Smile
-wyrmmage

Worlds at War (Current Project) - http://www.awkward-games.com/forum/
Quote this message in a reply
Member
Posts: 161
Joined: 2005.07
Post: #3
You want to make a 2D Worms game? Seems like you should use a series of RGBA textures for the ground, then keep the data in memory and modify the alpha channel and reload the texture whenever part of the ground needs to be destroyed. You can use the alpha channel for your collision detection too. For example, when a big bomb goes off, draw a white circle to the alpha channel and reload the texture.
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2009.06
Post: #4
wyrmmage Wrote:Worms uses "poxels" (a word that, AFAIK, they made up), which are a mixture between voxels and polygons.

Reading the wikipedia entry on the Marching Cubes algorithm may help get you started, since it's what you'll be trying to do, but in 3D.

TomorrowPlusX has a lot more experience with this kind of thing than I do; looking over his thread here: http://idevgames.com/forum/showthread.php?t=15018 should give you some good information (especially his post in the second page).

Hope that helps Smile
-wyrmmage
Interesting... but I think those algorithms are far too complicated for my needs.


imikedaman Wrote:You want to make a 2D Worms game? Seems like you should use a series of RGBA textures for the ground, then keep the data in memory and modify the alpha channel and reload the texture whenever part of the ground needs to be destroyed. You can use the alpha channel for your collision detection too. For example, when a big bomb goes off, draw a white circle to the alpha channel and reload the texture.
Sounds great! I will look into it.


Thank you both!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  A whole new can of worms: In-App Purchases from Free Apps AnotherJake 12 4,810 Nov 9, 2009 10:42 PM
Last Post: cmiller
  Direct screen surface access for iPhone Nosredna 15 7,255 Feb 15, 2009 10:35 AM
Last Post: Nosredna