Page 1 of 1

Destructible Terrain

PostPosted: Mon May 19, 2008 11:50 pm
by hero_bash
Could someone telkl me how it works or how to do it. I don't know using canvas, there's just too much that isn't documented.

Re: Destructible Terrain

PostPosted: Tue May 20, 2008 7:12 am
by Rich
The example shows it as it is.

Create a Canvas with your terrain. Create a separate Sprite (for example, in worms, a bazooka hole) which will be erased from the canvas.

Use 'Paste into canvas' with this sprite, then Update collision mask. A hole will be made in the terrain and can be collided with/into.

Re: Destructible Terrain

PostPosted: Tue May 20, 2008 11:08 pm
by Drew Carey
[quote="Rich":1mmen17r]The example shows it as it is.

Create a Canvas with your terrain. Create a separate Sprite (for example, in worms, a bazooka hole) which will be erased from the canvas.

Use 'Paste into canvas' with this sprite, then Update collision mask. A hole will be made in the terrain and can be collided with/into.[/quote:1mmen17r]

Another note is that the "Paste into Canvas" uses that objects X and Y values, so you need to have an instance of the object where you want it to be pasted. A good idea, if you're using a mask with say a bullet, is to add the mask object to the bullet objects container, and add an event to place the mask object at the bullets position. Alternatively, use "On Bullet overlaps Canvas" -> "Bullet: Create Object 'Hole' at Image point 0" or wherever to erase it.

Re: Destructible Terrain

PostPosted: Sat May 24, 2008 3:57 pm
by Casho
Could I see an example I'm also wanting to do this but I don't understand how you do it.

Re: Destructible Terrain

PostPosted: Sat May 24, 2008 4:08 pm
by Ashley
The example is in the uploads forum.