Backgroundissues

Get help using Construct 2

Post » Thu Aug 04, 2016 11:18 am

Hello,

i have a little problem with my background. In my "Menu" layout i have moving clouds in the background.
It´s a sprite wich i move 2px every tick. When i click the startbutton the game loads a new layout which looks basicly the same and the clouds start moviing from their original position.
Is there a way how i can say my clouds on Gamelayer to start where teh Menuclouds stopped?

Thank you in advance
Bighouser
B
7
S
2
Posts: 7
Reputation: 443

Post » Thu Aug 04, 2016 12:13 pm

Just to clarify, is this one single sprite of a cloud or is this many sprites of single clouds that move? I have a way to do it with sprites and global variables but it gets convoluted if you have lots of objects. This might be better to do with an animation?
B
45
S
15
G
73
Posts: 2,007
Reputation: 43,396

Post » Thu Aug 04, 2016 12:24 pm

Message: Bighouser can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
It´s one sprite that moves.
You can see a version of the game here:
https://www.scirra.com/arcade/sports-games/juggle2-9956
B
7
S
2
Posts: 7
Reputation: 443

Post » Thu Aug 04, 2016 12:28 pm

Make two global variables CloudPosX and CloudPosY that every tick store the CloudSprite.X and CloudSprite.Y. On loading the second layout, set Cloud position (CloudSprite.x=CloudPosX, CloudSprite.y=CloudPosY). That works although there could be a simpler way. REMEMBER to include Event sheet 1 (the one with the global variable) on the second layout's event sheet.
B
45
S
15
G
73
Posts: 2,007
Reputation: 43,396

Post » Thu Aug 04, 2016 12:41 pm

You are brilliant! Thank you so much. I pushed that problem away and away and now you fixed it.
I´m so happy. But what do you mean with include event sheet 1?
B
7
S
2
Posts: 7
Reputation: 443

Post » Thu Aug 04, 2016 12:59 pm

No problem. If you have variables on Event Sheet 1 linked to Layout 1, they won't work on Layout 2 unless you 'include' Event Sheet 1 on Event Sheet 2. This is because they are separate by default, however you may have the one event sheet linked to all layouts which is also fine. You can do this by right clicking the event sheet and selecting 'include event sheet'.
B
45
S
15
G
73
Posts: 2,007
Reputation: 43,396


Return to How do I....?

Who is online

Users browsing this forum: adamebastin, ketramtu18 and 8 guests