Computer Science
4.3 Maze Game -Day 3
Collect Items
PseudoCode | |
If Banana is touching Ball? | Reset …… |
| |
Score: | |
PseudoCode | |
If Banana is touching Ball? | Reset …… |
Hide Sprite | Show Sprite |
Score: Add to Score | Reset Score |
Tip: Make it work with one sprite
then duplicate sprite, so code will also duplicate!
When Green Flag ( Reset )
………...show
If touching Ball...
………..hide
B. Create Score variable
Variables: A place to store information.
to keep track of the number of bananas collected.
Create variable.
Variables:
Data Commands
Variables:
a place to store
Information.
Create a “Variable” to hold the Score.
Count stuff. ( using the variable).
If banana is touching the ball sprite
Reset
4.4 Extra Time?
User needs to collect all bananas to finish level: ….Hint: use operators!