Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Destructable Terrain

Author
Message
sixblades
21
Years of Service
User Offline
Joined: 30th Jul 2004
Location:
Posted: 21st Mar 2005 01:01
Does anyone know how to or of a good tutorial that shows how to make destructable terrain? I have tried this many times and I can never come up with a reliable method THAT RUNS FAST. I am going for a Worms type terrain. Can anoybody help?
Jess T
Retired Moderator
22
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 21st Mar 2005 20:38
I've never done it before myself, but here's how I would go about doing it;

If you're simply after a Circular style of destruction, then what you want for your terrain ( the image ) is just a filled circle routine.

Simply fill the circle with whatever colour is your transparent colour ( default is black ), and you're done!

If you want something more random ( for what, or what kind, I don't have a clue ), then do a combination of filled circles

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Chris K
22
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 22nd Mar 2005 04:42
Check out my compo entry in the showcase called Tankoids.

http://www.thegamecreators.com/?gf=2004compo_view&i=64

It comes with the source.

It's very very fast detructable terrain code, it works like this:

Have an array - Floor(4000) - that contains the starting floor height for the level (assuming level is 4000 pixels wide).

Then you need another array that contains the positions of the holes. Then to check for collision check whether it is under the ground and whether it is within 100 pixels or whatever of the holes.

The actual holes are just circled coloured the same as the sky.
Avan Madisen
23
Years of Service
User Offline
Joined: 12th Sep 2002
Location: The Castle Anthrax
Posted: 22nd Mar 2005 07:15 Edited at: 22nd Mar 2005 07:15
Have a look at my Lemmings remake:

http://www.geocities.com/avanmadisen/projects/pages/lemmings.html

The landscape handling is almost identical in it's final effect to both lemmings and worms. The source code wouldn't help you much because my code never looks anything like anyone elses, but I'm thinking of writing a tutorial on my method of doing it, so if you want I'll do it soon.

I don't suffer from insanity:

I enjoy every minute of it!
dj chainz
21
Years of Service
User Offline
Joined: 25th Sep 2004
Location: England
Posted: 27th Mar 2005 06:21
memblocks are probably the way to go... You could write a collision system with that as well.

I am the lead programmer at red spark studios
http://www.brazilianhotties.tk

Login to post a reply

Server time is: 2026-07-14 00:28:24
Your offset time is: 2026-07-14 00:28:24