End of game
mrcameron999
Member Posts: 182
Hi in my game i have it where if your previous score is not higher than your high score then i interpolate the camra down. If your score is better than what you got interpolate camera up.
I tried lots of ways of doing this but could find the right one. So what i basically need is if high score is higher go up And if high score is lower go down i tried this but it all ways ends up going down any ideas any one
I tried lots of ways of doing this but could find the right one. So what i basically need is if high score is higher go up And if high score is lower go down i tried this but it all ways ends up going down any ideas any one
Comments
If you can type out or post a screenshot of your rules, we can figure out why it's not working.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
RULE
if game.lose =< 0
If game.highscore < game.score
DO
Interpolate camera to 960 for 2 seconds using esae in and out.
Change attribute game.score to game.higscore
Save game.highscore as score
ELSE(I wasn't too sure what this was for and it sound right where i should put the rest)
game.lose =< 0
game.score =< game.highscore
DO
interpolate camera to 0 with ease in and out for 2 seconds
Hope this helps(My print screen doesn't work so i had to type it)
The "else" section just means that if the rule condition(s) is(are) not true. I assume you have the rule set to ALL conditions and not ANY? If so, then the else section will run whenever game.lose > 0 or game.highscore >= game.score. But since you have another set of rule conditions inside of the else section, that portion of your code will NEVER run because the conditions contradict each other. Game.lose can't be > 0 and also <= 0.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
and how do say then that i the rule with game.highscore is < than score do this one not
game.hoghscore > game.score
If game.score > game.highscore
Interpolate scene.camera.origin.Y to 960
change attribute game.highscore to game.score
save attribute game.highscore
else
Interpolate scene.camera.origin.Y to 0
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
One way to troubleshoot is to use a DisplayText actor or a log debugging statement with game.lose in the expression editor and watch the actor Debugger window to see what value game.lose is actually starting with.
Also, unless you have other camera rules somewhere or have changes the default value, the default value for scene.camera.origin.Y is in fact zero.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
interpolate it works?
And what happened with the DisplayText/debugging? What did you discover about the value of game.lose at the start of the game?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Log Debugging Statement ["1"]
If attribute game.lose ≤ 0
Log Debugging Statement ["2"]
If game.score > game.highscore
Log Debugging Statement ["3"]
Interpolate scene.camera.origin.Y to 960
change attribute game.highscore to game.score
save attribute game.highscore
else
Log Debugging Statement ["4"]
Interpolate scene.camera.origin.Y to 0
When you do that, what does the Debugger window show?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
http://gamesalad.com/blog/question-of-the-week-using-the-debugger
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
1 4
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User