transfer score to next layout

Get help using Construct 2

Post » Sat Aug 10, 2013 6:09 pm

Hello,
I created GLOBAL variable called Score with initial value 0.

Like this:
OBJECT - on collision with OBJECT2 > OBJECT2 destroy
                                                                > System - Add 1 to Score
                                                                > ScoreText - Set text to Score

and the same on the second Event sheet + Layout 2.

When I destroy the OBJECT2 and then move to Layout 2, the score bar starts again with value 0. I want it to start with the previous value from Layout 1.

What is interesting --> when I finished with score 20 and in the next Layout I kill monster for another 20 points it shows 40 but initial value (on start layout) is 0 and no 20 from previous layout

Where is problem?trance2013-08-10 18:09:55
B
14
S
4
Posts: 110
Reputation: 1,538

Post » Sat Aug 10, 2013 6:16 pm

Sounds like you need to also set the ScoreText in 'On start of layout'. The score is still good, but the text object is being reset.
ImageImageImage
B
71
S
22
G
242
Posts: 3,734
Reputation: 134,994

Post » Sat Aug 10, 2013 6:22 pm

im not sure what do you mean by this action set the scoretext...could you be please more specific?

trance2013-08-10 18:23:18
B
14
S
4
Posts: 110
Reputation: 1,538

Post » Sat Aug 10, 2013 6:54 pm

add:
On start of layout > ScoreText - Set text to Score
ImageImageImage
B
71
S
22
G
242
Posts: 3,734
Reputation: 134,994

Post » Sat Aug 10, 2013 7:00 pm

Set the text to text.score but do it every tick not just on start of layout
B
28
S
6
G
2
Posts: 86
Reputation: 3,267

Post » Sat Aug 10, 2013 7:00 pm

such a simple thing to do...ok problem solved, thx
B
14
S
4
Posts: 110
Reputation: 1,538


Return to How do I....?

Who is online

Users browsing this forum: badmoodtaylor, Yahoo [Bot] and 25 guests