Nan or 0 Highscore Problem

Get help using Construct 2

Post » Tue Jan 14, 2014 5:56 pm

Hello every1!

I was trying to make an highscore, and watched alot tutorials and browsed here in the forum but nothing helped so i try it with an new topic

-----------------------------------------------------
Global Number: Highscore
Global Number: Score

On Start of Layout: Local Key "Highscore" Exist - Set "Highscore" to int(WebStorage.LocalValue(Highscore))
---Set Text to "Highscore" & Highscore
(else)
---Set SessionKey "Highscore" to "0"
   Set Text to "Highscore" & Highscore


Keyboard: On W pressed - Restard Layout
Keyboard: On S pressed - Lear Local Storage
Keyboard: On A pressed - Add 1 to "Score"


Score > "Highscore" Set Local key "Highscore to "Score"

Every Tick - Set Text to "Score: " & Score
--------------------------------------------------------------




Thank you,
-Astronaughtyastronaughty2014-01-14 18:08:05
B
2
Posts: 1
Reputation: 177

Post » Sun Feb 23, 2014 6:26 pm

I have the same problem... Please someone can help?
B
4
S
1
Posts: 11
Reputation: 414

Post » Sun Feb 23, 2014 6:54 pm

@Falkons

From the examples you typed I would say you have some qoute misplacements, but seeing as they are typed over, there is really no way of saying ... anyways

Things I see typed wrong:

On Start of Layout: Local Key "Highscore" Exist - Set "Highscore" to int(WebStorage.LocalValue(Highscore))


the bold part should be

int(WebStorage.LocalValue("Highscore"))

Highscore should passed as a string which references the name of the variable in web storage.
Without qoute, it will try to use the Highscore value (likely a number) as a name to reference the web storage variable.
and

Score > "Highscore" Set Local key "Highscore to "Score"


the bold part should be

Score

Beacuse::
Score is a variable, if you place it between qoutes it becomes the string "Score" and not a variable.
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572


Return to How do I....?

Who is online

Users browsing this forum: DolyGamesCosmos and 28 guests