Can you explain how I should store my sprites in layouts?

Just started using Construct 2? Post your questions here

Post » Thu Jul 09, 2015 2:52 pm

My game has a layout per level, but I noticed you only have to store objects in one layout for them to be usable in every layout... MY question is... Can I have one dedicated layout (that is never used) as an "object store" with all the usable objects in it that aren't part of the level-layout specificallys? (created by event instead).
B
8
S
2
Posts: 59
Reputation: 686

Post » Thu Jul 09, 2015 3:07 pm

You can put all your sprite outside of your first layout (or the one you are using them in, if the game is bigger) and just destroy them all "at the start of the layout".

You can use object families to remove them more conveniently. Say you have sprite that are explosions and other effects. Just put them into "FX" family and destroy that familty at the start of the layout.
B
7
S
2
Posts: 68
Reputation: 645

Post » Thu Jul 09, 2015 3:11 pm

OK, good suggestion. So in any layout following the first I can have a clean sheet to work from and it'll keep the data loaded from Layout1?
B
8
S
2
Posts: 59
Reputation: 686

Post » Thu Jul 09, 2015 3:14 pm

Best method:

Put all your sprites and objects you do not want to be on the layout on layout start, in a dedicated layout for that.

near ALL my projects have a "Objects" layout. In which I stuff and prepare all my sprites.

And create/spawn the objects you need on the layout you want to run.


So yes, the "Object Store" is a very very good method.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Thu Jul 09, 2015 3:16 pm

lennaert wrote:Best method:

Put all your sprites and objects you do not want to be on the layout on layout start, in a dedicated layout for that.

near ALL my projects have a "Objects" layout. In which I stuff and prepare all my sprites.

And create/spawn the objects you need on the layout you want to run.


So yes, the "Object Store" is a very very good method.


Great. Do you need to explicitly start with the Object Store and immediately "on start of layout" move to the first intended layer?
B
8
S
2
Posts: 59
Reputation: 686

Post » Thu Jul 09, 2015 3:21 pm

No, simply add a new layout, rename it to whatever you fancy (ie Objects) I always add an event sheet to it with just: On start of layout go to menu.
This to circumvent accidental loading of the objects layout :P

You do not load or use the Objects layout.
You only use it in the editor in construct 2, to update variables or behaviors etc

When you start a game layout and require an object on it from the objects layout, you can just use create object or spawn object on the desired layout.

Having all your objects on dedicated layout keeps it nice and tidy. And will remove the need to "on start of layout destroy meh"
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572

Post » Thu Jul 09, 2015 3:22 pm

yeh, it's gonna be nice removing all this clutter from around the edges and the unnecessary "destroy when outside of layout" to get rid of some of them...

Thanks for your help.
B
8
S
2
Posts: 59
Reputation: 686


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests