How do I make a sprite visible once in forever in another la

Get help using Construct 2

Post » Sat Sep 06, 2014 7:48 am

Dear all,

I need help to make a sprite visible in 2nd layout when I click a sprite on 1st Layout (FOREVER).

In detail: Let's say I have a sprite 1 in Layout 1 and the sprite 1 is not visible. When I click something in the Layout 2, the sprite 1 in the Layout 1 should be visible forever.

What I have tried: I have made On start of layout 1: Set sprite 1 not visible. And in Layout 2, on collision make the sprite 1 visible. But again when opening the layout 1 the sprite 1 goes invisible. I understands that on start of layout does not works, but any other option.

Help needed!!!
You do not have the required permissions to view the files attached to this post.
Last edited by Madrasmadnes on Sat Sep 06, 2014 8:35 am, edited 1 time in total.
Image
B
31
S
7
Posts: 197
Reputation: 2,497

Post » Sat Sep 06, 2014 8:05 am

here's one option:
You do not have the required permissions to view the files attached to this post.
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

Post » Sat Sep 06, 2014 8:17 am

Thanks @Littlestain. That's simple and easy one.

What if I have multiple sprites in the Layout 1 which has to be unlocked from other layouts 2, 3, 4, 5.... Let's say like a levels page. Is it advisable to add maore Global Variables
Image
B
31
S
7
Posts: 197
Reputation: 2,497

Post » Sat Sep 06, 2014 8:40 am

It probably would be better to make the objects global and use (boolean) instance variables in that case, for global variables would clutter things up..
It all depends on how your game is set up..
Using an (global) array to hold all the (visibility) values would be another option..

Also if you wanted to create a level-unlock-thingie, there are multiple examples in the forum and one or two tutorials in the tutorial section..

It would involve adding to the global variable and checking if level number is less than or equal to that variable, I guess..
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

Post » Sat Sep 06, 2014 11:04 am

THanks @Littlestain but I am not that bright logically to get everything you said. I am gonna post another question maybe here itself with another capx, which I guess will help me much more easily.
Image
B
31
S
7
Posts: 197
Reputation: 2,497


Return to How do I....?

Who is online

Users browsing this forum: rayolf and 18 guests