[Open Source] Destroyable Tiles

Show us your completed creations made in Construct 2

Post » Fri Nov 15, 2013 8:40 am

I decided to share a .capx while I'm learning how to use tiles.

It would be useful for kind of games like Breakout, Platformer with destroyable terrain, etc.

https://dl.dropboxusercontent.com/u/76227787/DestroyableTiles.capx


Feel free to improve this source code.

Bye.
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Fri Nov 15, 2013 8:54 am

B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Fri Nov 29, 2013 6:26 pm

Cheers - nice examples, thanks for sharing
B
37
S
9
G
5
Posts: 437
Reputation: 6,098

Post » Sat Jan 11, 2014 10:01 am

Great examples @Joannesalfa, they are very usefull

Thanks
B
16
S
3
Posts: 14
Reputation: 1,498

Post » Sat Jan 11, 2014 1:45 pm

@Joannesalfa
hey did you tried this?

ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 36,003

Post » Sat Jan 11, 2014 7:12 pm

Yes very great eamples! You should place these in the CapX Tutorial Section,since you need very little info about the file you upload there.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Thu Jan 16, 2014 1:24 pm

Nice.. any idea how to make it so a tile is destroyed when another object e.g. a bullet hits it? I have tried and it's very random. Sometimes the tile is destroyed sometimes not.
B
20
S
6
G
2
Posts: 157
Reputation: 3,116

Post » Sun Jan 19, 2014 2:19 am

@silkc2

I've just been dealing with this in my own game, transitioning from a simple roll-your-own tilemap system based around objects to a proper tilemap. Here's what I've found:

1. Using 'Is overlapping?' and 'On Collision' does not seem to be reliable for tilemaps when fast moving objects -- bullets -- are in play. If the bullet moves too far into a tilemap section without destroying the tile or itself, you can't get collision information. Example: Is overlapping will come up 'no'.

2. Ashley explained how tilemaps are automatically broken into square sub-sections when you have large areas full of the same kind of tiles. I assumed that you could still tell when an object is inside on of those squares, but apparently you can't. It's almost like the interiors of the sub-sections are simply tiled backgrounds. All you can reliably collide with are the borders.

What I did about it:

I just bypassed the 'on collision/is overlap' commands by rolling my own. I'm just testing each bullet once per tick and seeing if there is a tile at the same position. If there isn't, I move on to the next bullet; if there is I do further filtering by tile type to decide what to do (Tile A: bounce bullet, Tile B: destroy tile, Tile C: Destroy bullet & tile, etc...). This seems to be working perfectly.

Hope that helps,
Tim

P.S. The other thing I've done is switch from the built in bullet behavior to using the Custom Movement behavior. This has resulted in a MASSIVE speedup for my application. I can now put a couple thousand fast moving bullets onscreen with no slowdown and faultless tile collision.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sun Jan 19, 2014 3:50 am

@shinkan

I re-implemented with your method, it's working, nice simple implementation.


@silkc2 @TiAm
https://dl.dropboxusercontent.com/u/76227787/BreakTiles.capx
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Sun Jan 19, 2014 4:05 am

@Joannesalfa:

Hey, breakout! Neat. The bullet seems to be flying out into the abyss for me though (real slow on my netbook, have to move it over to the desktop)

BTW, thanks for starting this thread; your examples were a help these last couple days as I've been trying to learn my way around tilemaps.

Cheers, T
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Next

Return to Completed Creations

Who is online

Users browsing this forum: GabeCH and 3 guests