score

Get help using Construct 2

Post » Tue Oct 18, 2011 4:39 pm

Soo heres what I am stuck on.

I have variable "points"
on collision between "enemy" and "player" store data.

What I must do to do that:

on start of layout set text to this data I saved?

I hope you will understand what I mean, if not please ask :)
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Tue Oct 18, 2011 8:48 pm

Is your variable a global variable? Try making sure it's at the top of the event sheet - if it's a local variable you can't access it anywhere other than the subevents next to it.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Tue Oct 18, 2011 8:55 pm

What you can do is make points a global variable, and do something like

System
-Every Tick
--Set [text] to 'vpoints'

vpoints being whatever you want to call your global variable for points. To add a global variable, right-click on an event sheet.

That way the score is displayed regardless of layouts, IF that event sheet is not layout-specific.
Meaning, you have an event-sheet with all your settings for points, controls, etc.

THEN you go to say, level 1 or layout one's event sheet, right-click, and INCLUDE that event sheet.

If this sounds confusing I can clarify.

Hopefully that helps.
B
19
S
3
G
2
Posts: 148
Reputation: 1,945

Post » Wed Oct 19, 2011 5:31 am

Thanks.
B
11
S
3
G
6
Posts: 193
Reputation: 4,234


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, Matthew de, Skebab, spcsmrf, Yahoo [Bot] and 6 guests