Thanks for posting this info on scores; it's a help.
One suggestion, for beginners, would be to also include the coding required for getting bonus lives with hitting enough points from multiple enemies.
LCL offered the following coding tip for the above addition:
viewtopic.php?f=4&t=7025&hilit=plz&start=15Then, the score question.
There's one thing you'll have to fix right away. And that is the fact that you're trying to use textNumber as a variable holding the score. I know that the Game Editor's built-in caveman tutorial tells you to do this, but there is a reason why you should never use textNumber for anything else than showing numbers on the screen. And that is the fact that textNumber isn't reliable when you try to do coding with it. Even a simple if condition like the following one won't work:
Code: Select all
if (textNumber == 5)
{
DestroyActor("Event Actor");
}
All you have to do to get rid of this problem is to create a global integer variable named as you want, and then use this in the draw actor event of the text actor you want to be showing the score:
Code: Select all
textNumber = myScoreVariable; //myScoreVariable is an exapmle of the score variable name
Now you can do all the conditions, additions and subtractions with the myScoreVariable and it will be 100% accurate. Only use textNumber to show the value of the variable.
Then, for getting a 1-UP every time the score reaches a multiple of 1000, just use this code:
Code: Select all
if (myScoreVariable % 1000 == 0) //Check if the remainder of myScoreVariable equals 0. If it does, that means that myScoreVariable is evenly divisible by 1000, so it must be a multiple of 1000
{
myLivesVariable ++; //Notice that you'll want to get rid of using textNumber for storing lives, too. Oh, and "variable ++" means the same as "variable += 1"
}
Thanks. Scoring points is good, but without any bonus life rewards, not as meaningful.