How do I delete all objects on a specific layer

Get help using Construct 2

Post » Thu Jun 09, 2016 12:54 pm

Hello everyone,

I have a problem with my level selection.

I have a game with 3 levels, separated in 3 layouts.
And each level has 3 difficulties.

I built the difficulties on different layers in the layouts. (EasyLayer, MediumLayer, HardLayer)

What I want to do now when starting a Layout:

- Check which difficulty was selected.
- Set the chosen "DifficultyLayer" visible.
- Delete all objects on the other layers, because the colliders affect the player, even if the layer is set to invisible.

Thanks for a new perspective... @_@
B
4
Posts: 3
Reputation: 206

Post » Thu Jun 09, 2016 1:06 pm

Probably not the best way to do it, honestly. You'd be better off creating the additional objects (at the start of the layout) based on the difficulty, that way you can have everything on one layer.

The only solution I can think of to the way you did it would be to use "Pick All" on every instance of that object, test if it is on a certain layer number/name, and then destroy it if it is.
Ruby Winds: a top-down adventure game inspired by the Oracle series of Zelda games.
Twitter - Devlog/Site
B
14
S
6
G
13
Posts: 54
Reputation: 7,503


Return to How do I....?

Who is online

Users browsing this forum: DarkRoomGames, ismailsawan, ketramtu18, mekonbekon and 11 guests