I want to add a feature to a script i have, basicaly need to add a scoring system to a game. record the number of attempts made, if the score for say level 1 is better than before, replaces the score.
I have been able to get it to do this, but it always adds another number to the score list. so if the score for level 1 is entered, it adds a number into level 2 and i don't see why it does that.
if someone can help, i can send you the game to look at
Offline
tibstar wrote:
I want to add a feature to a script i have, basicaly need to add a scoring system to a game. record the number of attempts made, if the score for say level 1 is better than before, replaces the score.
I have been able to get it to do this, but it always adds another number to the score list. so if the score for level 1 is entered, it adds a number into level 2 and i don't see why it does that.
if someone can help, i can send you the game to look at
Do you have it add or replace the score? Could you show us your script?
Offline
Ok, so I imagine you have a 'level' variable and a 'score' variable. You'll also want a highscores list to save your per-level highest score. Once you finish your level, you should broadcast something like 'level finished'. You could then do something like
when I receive [level finished! v] repeat until < ((length of [highscores v]) + (1)) > (level) > add [0] to [highscores v] //list should be long enough end if <(score) > (item (level) of [highscores v])> replace item (level) of [highscores v] with (score) say [You've beaten your previous record!] for (2) secs end
Offline
You need to be more specific... i can't really help without enough info on your problem.
Offline
JSO that looks like what i need.
I'm not sure how to show you the code on here, could i send someone the scartch file, and they look at it? i will explain in the the email what i need to do.
it's a very cool program, just so frustrating when you get stuck.
kind regards
Offline
tibstar wrote:
JSO that looks like what i need.
I'm not sure how to show you the code on here, could i send someone the scartch file, and they look at it? i will explain in the the email what i need to do.
it's a very cool program, just so frustrating when you get stuck.
kind regards
Try implementing the code example above, and see how it goes If you can't get it to work, just upload the project to your account and I'll look into it if you want.
Offline