Worms surface
Hey...
I'm sorry if this issue has been already discussed before, but I couldn't find anything about it anywhere...
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!
I'm sorry if this issue has been already discussed before, but I couldn't find anything about it anywhere...

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!
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
-wyrmmage
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

-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com/forum/
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.
wyrmmage Wrote:Worms uses "poxels" (a word that, AFAIK, they made up), which are a mixture between voxels and polygons.Interesting... but I think those algorithms are far too complicated for my needs.
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
-wyrmmage
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!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| A whole new can of worms: In-App Purchases from Free Apps | AnotherJake | 12 | 4,209 |
Nov 9, 2009 10:42 PM Last Post: cmiller |
|
| Direct screen surface access for iPhone | Nosredna | 15 | 6,683 |
Feb 15, 2009 10:35 AM Last Post: Nosredna |
|

