How do I re-use sprites on other layers?

Get help using Construct 2

Post » Mon Feb 17, 2014 12:43 am

Sure. You have one event sheet for all layouts. This event sheet is doing only one thing

object is overlapping different object -> go to level 2
object is overlapping different object -> go to level 3

This is that loop I was talking about.
Every time you enter a layout - doesn't matter which one, You will always go to level 2. Because this is your very firs event.

To avoid that I'v inserted a simple condition to compare on what level you currently are.

If you are on level 1
object is overlapping different object -> go to level 2
If you are on level 2
object is overlapping different object -> go to level 3
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,599
Reputation: 34,825

Post » Mon Feb 17, 2014 12:46 am

Weird, for me, on lvl 1, after walking thru the doors, it goes to lvl 2, but it isn't going to lvl3 next.... So I don't understand how to solve for that. Sorry if this is confusing, I'm new to this :)
B
4
Posts: 12
Reputation: 249

Post » Mon Feb 17, 2014 12:56 am

No worries.
What you saying is and will be true.
Look again on your events

1. object is overlapping different object -> go to level 2
2. object is overlapping different object -> go to level 3

Events always run from top to bottom.

If you start game on level 1 you will go to level 2,
If you start on level 2 you will go to level 2
if you start on level 3 you will go to level 2
and so on...

Basically your events are saying "no matter what" always go to level 2
It's happening because that's the way how events work.

"2. object is overlapping different object -> go to level 3"
This event will never be active and you will never go to level 3 because before that you are going to level 2.

Like I said before, you need to specify on what level you are and where you want to go next.

You could do that very easily with global variable.
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,599
Reputation: 34,825

Post » Mon Feb 17, 2014 1:02 am

How would I do that with a global variable?
B
4
Posts: 12
Reputation: 249

Post » Mon Feb 17, 2014 1:13 am

Here you go

I've added one more event 'On start of layout" to check on what layout you currently are and to set global variable with appropriate level number, so you can test your game from any level and go to next one without changing global variable.
ImageImageImageImage
B
157
S
66
G
41
Posts: 2,599
Reputation: 34,825

Post » Mon Feb 17, 2014 5:10 pm

I have version 158.2, looks like you are running 1.6 (a paid version I assume?)...
B
4
Posts: 12
Reputation: 249

Post » Mon Feb 17, 2014 5:11 pm

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Previous

Return to How do I....?

Who is online

Users browsing this forum: evillair, marcinkowski, unicornspitfire and 13 guests