TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
How to record a high score for later use?
Pages:
1
How to record a high score for later use?
Beckb
Posts: 72
November 07, 2017, 11:49:17 am
I'd like to record the value of a number attribute (the high score) at a specific point in time so I can save it for later.
I'm creating a score counter where every collision increases the score to +1. I want to record the highest number of hits a player can reach within a given time, and save that value as their "high score" for future use.
Anybody got any tips? Many thanks in advance - you guys are always helpful.
choppedupmonkey
Posts: 602
November 07, 2017, 11:52:21 am
create a new attribute named "highscore" and set score = to highscore
Beckb
Posts: 72
November 07, 2017, 12:54:14 pm
Quote from: choppedupmonkey on November 07, 2017, 11:52:21 am
create a new attribute named "highscore" and set score = to highscore
I'm with you so far, but what do I do when the score changes? Won't the high score change with it since they're equal?
FYI - Using your example, I would like to save the "highscore" attribute as the value of the score at a specific point in time.
xplosion28
Posts: 275
November 07, 2017, 01:12:19 pm
If the score is less than the high score, don't change it.
choppedupmonkey
Posts: 602
November 07, 2017, 04:35:56 pm
exactly ^ i forgot to add that.
if score > highscore
set highscore to score
NickamonPoppytail
Posts: 1141
November 09, 2017, 04:39:00 am
Also, when you're saving the highscore, it's a good idea to make the game save itself, so if the game crashes or your computer runs out of battery, for example, the value of the highscore attribute isn't lost.
Upcoming Projects
Poppytail 5
and
Pixeltail
: Fifth and sixth main instalments in Poppytail series.
A Game About Trimming Hedges: Final Version
: An updated version of the original AGATH.
One Million
: Last-one-standing style small project.
The Poppytales
: Platformer boss rush with character collecting.
Skies n' Fall
: Boss rush shooter prequel to Rise n' Brawl.
Precious
: Weird platformer.
Christmas Time 2
: Sequel to Christmas Time 1.
Pages:
1