"Health" is just a variable set to a certain number, in this case it is called health and set to 100.
Scratch code |
Scratch code |
This is an example of a health boosting varible. Once applyed to a sprite and the proper sequence is acheved it will increase the players health to a maxium of 100 and then disappear for a set amount of time.
Scratch code |
This is my final example of a varible, a timer. Time is not concept in scratch commands. This is why a varible, time, must be created. To simulate a timer ticking down we first set the time varible to 200 in this case. Then we add a band that will continue the contained code forever. We then add code to change the time varible by -1 and to wait for 1 second intervils to repeat the prosess.
No comments:
Post a Comment