Adding Score to a Game

Still struggling with adding a "Score" and "HighScore" in my game..Can anybody help me with some sample examples ....Please help me if any one can..Please please ....

This is already possible so not really a feature request, unless you are trying to suggest some kind of new API? (If so, please elaborate.)

To show a score you would do newText and update it with the current score value each time points were scored.

For a highscore you would simply save the first score on gameover then in the future compare the current score to the highscore and if greater save the new highscore.

Peach :)

I am extremely sorry for the mistake that I have done.I should have posted this in Game Development Forum.Should i re post it on Game Development Forum?

@Peach :help me with the score.I have tried CWL then I discovered that it is Third party Tool and I am not getting help from their side.Now, I am discovering "Ice" so that i can use it.Can you help me in other way to the "Scoring System".?Please help me so that I can add it in my game...Please Help me....

@ rahulsingh2k10

Dont worry about re-posting this Topic I think peach will move it to the proper place. As for your question, the answer peach gave you is basically all there is to it. Ill post useful links below for you to check out. Peach has a great tutorial on this which ill post below and you can definitely find some similar question on the forums if you search or code exchange. But truly all there is to this is as Peach said you write a text (number) and update the score when player gains score according to your game. Once game over you save the score, and for High score you can have a timer or Runtime check if the new score is higher then the previous score and save the new high score.

Peach Tutorial: http://techority.com/2011/01/26/how-to-add-a-score-to-your-iphone-app/

Very helpful website: http://www.LearningCorona.com/

@ LeivaGames: Thanks for the Help.You know that at first I had used that same thing in my scoring that Peach have provided in techority.I was Facing a problem that when the Game got over and i wanted to restart or go to menu page I got error.So, i thought of going to other ways.Now what I am using is Ice .if you can help me on that..please..

@ rahulsingh2k10

I havent used ICE before but do you just need help on saving or updating the score too? Since you have not posted any code is a bit hard to know what you got done so far regarding your question. For example is your scored being updated already as the player gains score? Or you need help updating the score and saving it or just saving it?

As of now I can do score update and score saving.even Highscore is working fine.But the only thing that is not happening is the score is not being displayed while playing.Moreover I cant set different Highscore for different levels since I am doing that using ICE .Can you suggest me any other way out for doing all the thing without using ICE?

@ rahulsingh2k10

Well you seem to be getting somewhere, how are you able to tell score is working properly if its not displaying while playing are you using prints? or it displays if you not playing? If you took the route using ICE might be best post some code for people to see and land you a hand including myself because by posting some of your code we can see what you doing wrong or suggest changes ect. As for suggestion what to use truly im not sure it depends which one you feel comfortable with im sure there are lots of help in this topic. I just use my own method which is basically what peach suggested earlier I display and update the score and once game over I save it then when you check score you can load the saved scores (values) and when you high score basically check if current score greater then previous score and if so then replace it with current score. Its a bit late where I am 3.16 A.M if you have not solve this later on ill give you some samples on how I do it. Keep us updated if you run into problems or solve it.

Best of Luck,
LeivaGames

Please provide me some sample if you can so that it can make me understand better..Thanks for helping me out.

have you tried js.lua it handles high scores and saving and loading u can get it from code exchange or www.j-strahan.com

you can use beebegame class and save high score with no headache)
its pretty simple to use, just download it from code sharing here http://developer.anscamobile.com/code/

and do this:

1
2
3
4
5
game = require( "beebegames" )
 
 
local high = game.loadValue("score.data")
--it will load your score data and if there's no such file than it will create one

I'm going to be a ornery antagonist.

These libraries are great and all and their developers put plenty of effort into doing things to make our lives easy..... but ......

Keeping score, displaying the score, and tracking high scores are fundamental to every game. Its a basic skill and one every developer needs.

If you are a new developer wanting to make games, you need to roll your own score system and not depend on libraries to do it. Later on, once you're programming skills are better, then a library can save you time, but its not a short cut a new programmer should take.

Its a good way to learn various things about the api, like the string.format() api call. Its a good way to practice putting text on the screen. And the math is uber simple and the logic for high scores is some of the most basic you can program.

If you can't manage these, you're going to have a hard time managing other aspects of your game.

Just sayin!

+1 rob

views:2307 update:2012/1/1 13:29:50
corona forums © 2003-2011