Destructible Terrain

Get help using Construct 2

Post » Sat Nov 03, 2012 6:30 pm

Hi this is my first post and i am new to Construct 2.

Is it possible to create a terrain or object and destroy it by pixels rather than sprites. What i mean is to have something which you could break down with anything ranging from 1 pixel to 100 * 100 pixel. So i could create a game with tunnels created by the player.

Thanks

ps I have bought the program so am not limited by restrictions placed on the free version.
B
44
S
15
G
9
Posts: 1,096
Reputation: 11,013

Post » Sat Nov 03, 2012 6:50 pm

Visually, it is possible. However you won't be having a fun time with collision.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Nov 04, 2012 12:49 am

Oh

Thanks for the reply.
B
44
S
15
G
9
Posts: 1,096
Reputation: 11,013

Post » Sun Nov 04, 2012 11:47 am

based on what your looking for here are some thoughts. I'm not an expert I'm still pretty new here myself.

1. each pixel is a sprite or at least 2x2 or 4x4 sprite.
I'm hesitent to this approach as this is a sprite draw for each object on screen.

2. Use the canvas plugin. This allows you to directly manipulate the pixels. however I think it requires a lower level coding rather than C2 Higher events programming less system.

3. Program your game in a language.

Your best bet is to work with the canvas plugin and use somekind of canvas sprite.... honestly I'm not familiar with the canvas plugin. But I think it's your best direction.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sun Nov 04, 2012 12:29 pm

Unfortunately, I'm not sure that the canvas function supports collision. I'm afraid this is one of the few things that C2 just isn't made for.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Nov 04, 2012 1:40 pm

I've seen some pretty good examples with the canvas plugin, however, as sqiddster mentioned: The canvas plugin doesn't handle collision, so it's visuals only. I agree that this is something not very well suited for C2.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Nov 04, 2012 1:52 pm

Check the thread for the plug, @pode did a subversion that added collision detection for the object. Its not per pixel, and only covers the bounding box, so it's not terribly helpfull.

Also keep in mind the Canvas object doesn't play well with webgl.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sun Nov 04, 2012 10:48 pm

Relevant examples:
http://www.scirra.com/forum/destruction-of-ground_topic55414_post345920.html?KW=worms#345920
http://www.scirra.com/forum/how-do-i-simple-worms-game_topic47872_post300449.html#300449

The per pixel collision detection is what takes most of the events in the examples, but it's pretty simple. The canvas object is used to get the opacity of pixels and for drawing a visualization of the terrain.
B
79
S
24
G
54
Posts: 4,745
Reputation: 40,753


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, mallorcaredes and 2 guests