How To Lose Lives On Scratch
Oct 12, 2011 “Score” You can then choose to display the variable “Score” by leaving a check in the box, or invisible by leaving the checkbox empty. Finally, a little bit of script to reset the variable “Score” to zero at the beginning of the game and increment it by 1 each time a particular event happens, eg. Cat scratch fever is a bacterial disease. You can contract the disease from cats infected with Bartonella henselae bacteria, either from a bite or a scratch. You can also get the disease through.
- How To Lose Lives On Scratch Online
- Scratch Live 2.5
- How To Lose Lives On Scratch Free
- Scratch Live Pro
This maze game has been adapted for school use from a lecture written by Carl Gustafsson.
Scoring
Each time the player picks up a diamond we will add 5 points to the score. We will give them 50 points for reaching the target. Add the 'Set the Score' action (from the score tab) to both the diamond and the target object in the collision event with the person. For the diamond object, in the properties make the new score 5, but make sure that you tick relative Relative means that 5 will be added to the existing score. If you don't tick relative, then the total score would be set to 5. For the target object collision with person event, you will need to add in 'Set the score relative to 50' immediately after Play sound |
|
Sep 05, 2014 Deleted Crate files end up in your trash or recycle bin. To recover deleted crates restore the crate file(s) to your Serato library. Note in that in newer versions of Scratch Live the Serato folder is named Serato. To prevent deleting crates in the future you can enable Protect Library. Jan 04, 2019 Cat scratch fever is an infection that can occur when a cat that is carrying a specific bacteria then bites, licks or scratches someone.
Ending the Game more Gracefully: Showing a High Score Table
We need to now look at what happens if the player is in the last room. As it is at the moment, if the next room doesn't exist, the game will just end.
It would be better if we could show a high score table before ending the game. Luckily Game Maker has a built in high score table we can use.
After playing the sound and setting the score, the game should pause for a second before moving to the next room. This is just to give the player time to hear the sound and work out what is happening, so we will add in a Sleep action.
|
|
Displaying the Score more Attractively
You can display the scored more attractively by creating your own score object.
You will need to import a font to use for drawing the score. Right click on Fonts, or choose the 'Add a Font' icon Choose a suitable font. Create a new object called objControllerMain The controller object does not need a sprite, as you do not see it. It is used to manage the score in the game. | ||
Add the draw event to the new object.
Add 'Set a font for drawing text' action After the font is set, you can now draw the score using the 'Draw the score' action Leave the x and y coordinates at 0, and tick relative. This means that the score will be drawn in the same place as the objControllerMain Virtual dj 8 app for android free download. Now place the objControllerMain in the room where you want the score to appear. It will appear as a blue ball with a question mark. When the game runs, you will see the score. |
How To Lose Lives On Scratch Online
|
Setting Lives
The number of lives the player has left is saved in the lives variable. You can set the number of lives when you load your first room. Choose the creation event for an object in your room. On the score tab, set lives to the number of lives you want.
The player's score and number of remaining lives will appear in the title bar when you play the game. |
Decreasing the number of lives
During the game, events will occur (such as collisions) that will mean the player should lose a life. You add this in the actions for the event that has caused the player to lose a life. When all lives are lost, you will want the game to end.
To your collision event (or whatever event will cause a loss of life), add a 'Set the number of lives' action (from the score tab) Set the lives to be -1 and Relative. -1 relative causes -1 to be added to the existing lives, giving the effect of subtracting a life. |
Instead of ending the game immediately, you may wish to show the highscore table)
|
Scratch Live 2.5
Using a Health Bar
A health bar is created in the Draw event for an object. You can create a controller object with no sprite that does this. When you draw the health bar, you need to give the coordinates for the top left corner of it (x1,y1) and the coordinates for the bottom right corner of it (X2,y2)
How To Lose Lives On Scratch Free
In the create event for an object, you will need to set the initial health to the value you want. (between 1 and 100)
Then in the event that causes you to lose health, take off health by setting its value to -10 (or whatever value you want) relative.
Scratch Live Pro
Click here for an example you can download that shows you how a healthbar works.