Lab 3.2 - What Goes Up

In this lab, you will use everything you’ve learned about loops and conditionals to construct a simple model for gravity.

Part 1: Before You Start

Go to the starter project at https://aka.ms/Intro-lab3-2. Log into Snap! and save your own copy of the project by choosing Save as button from the file menu. Be sure to click the Share button in the Save dialog box. Highlight the URL in the address bar and copy it.

Part 2: Channeling Newton

Write a script for the Dino sprite so that:

2.1) When the green flag is clicked, Dino goes to the top of the stage.

2.2) When the green flag is clicked, Dino falls to the bottom of the stage in a forever block.

2.3) 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.

Part 3: What goes up, Must Come Down

3.1) Modify your code 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 operators category.

3.2) Modify your code so that the Dino sprite stops falling when it touches the ground or if it is touching the Platform.

Part 4: Jump Up

4.1) Modify your code 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.

Part 5: Challenge

5.1) Modify your code so Dino can only jump while on the ground or the platform?

5.2) Add code so Dino will move left and right with the arrow keys?

Grading Scheme/Rubric

Lab 3.2 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.3

5.1 Jump Up: Ground or Platform

0.5

5.2 Movement using left and right arrow

0.2

PROJECT TOTAL

2.5 points