Make Highscore and screen movement
by Liam Shalon · in iTorque 2D · 07/16/2012 (5:16 pm) · 4 replies
Ok,
So I'm making this app, and in the app a character flies. There are land blocks that try to hold the character back. The screen moves and once the character can't fly any more, he dies.
So here are my questions:
Can someone show me how to right a code to make the screen gradually increase?
Can someone show me how to create a highscore where the score is by the amount of time that you can stay in? And if you beat the highscore it takes you to a screen that saids "you have beat your highscore!" And show the score, and if they don't beat it, then it just shows the score?
Lastly, how do I make the character's speen gradually increase?
Thanks!
So I'm making this app, and in the app a character flies. There are land blocks that try to hold the character back. The screen moves and once the character can't fly any more, he dies.
So here are my questions:
Can someone show me how to right a code to make the screen gradually increase?
Can someone show me how to create a highscore where the score is by the amount of time that you can stay in? And if you beat the highscore it takes you to a screen that saids "you have beat your highscore!" And show the score, and if they don't beat it, then it just shows the score?
Lastly, how do I make the character's speen gradually increase?
Thanks!
About the author
Associate Andy Hawkins
DrewFX
2. Store high score as $hiScore = 1000; and $bonusAmountPerMillisecond = 0.1; Store $firstTimeCheck = getTime(); In Torque editor add a sprite that is full screen that is the high score beaten screen, call it HighScoreBeatScreen, and hide it under Scene Object setting (set Visible to false). Create another for just your score and call it YourScoreScreen and hide it. Add a text object called ScoreFinal and hide it. Then do this during game.
On completing the game check this.
if ($myScore > $hiScore) { $hiScore = $myScore; HighScoreBeatScreen.setVisible( true ); ScoreFinal.setVisible( true ); ScoreFinal.setValue("you have beat your highscore!" @ $myScore ); } else { YourScoreScreen.setVisible( true ); ScoreFinal.setVisible( true ); ScoreFinal.setValue( "Score:" @ $myScore ); }3. Set your character speed to 0.1; $mySpeed = 0.1; Then use this code over time. Store current time before starting as $firstTimeCheck = getTime();Adjust the 0.1; to whatever suits.
Hope this helps.