In this lab, you will use everything you've learned about loops and conditionals to construct a simple model for gravity.
-
Save your project as Lab3.2.
Write a script for the Dino sprite so that:
-
When the
green flag
is clicked, Dino goes to the top of the stage. -
When the
green flag
is clicked, Dino falls to the bottom of the stage in a forever block. -
When Dino touches the ground, Dino stops falling.
When using the touching color block, change the color by clicking on the color box, then select anything in the color palette or stage that has the desired color.
-
Modify your script so that when the
green flag
is clicked, Dino will move to the top of the stage and it will move to a random x-coordinate between -240 and 240. Use the pick random block in the scriptoperators category. -
Modify your script so that the Dino sprite stops falling when it touches the ground or it is touching the Platform.
-
Modify your script so that when the
spacebar
is pressed, Dino will jump up. -
Have Dino jump by using a repeat block with a change in y block in it that will move Dino up. Dino will have to move up faster than you think since it will be fighting the forever block that causes it to always go down.
-
Modify your script so Dino can only jump while on the ground or the platform?
-
Add script so Dino will move left and right with the
arrow
keys?
Criteria | Points |
---|---|
2.1 Goes to the top of the stage | 0.3 |
2.2 Falls to the bottom of the stage | 0.3 |
2.3 Stops falling when touching the ground | 0.3 |
3.1 To a random x-coordinate | 0.2 |
3.2 Touching the ground OR touching the platform | 0.3 |
4.1 Jump up | 0.4 |
5.1 Jump Up: Ground or Platform | 0.5 |
5.2 Movement using left and right arrow | 0.2 |
Total | 2.5 |