Project 442: Infinite Flying Game

2. (Group Activity) Coordinates and Gravity

This game will use a unique moving mechanic, so let's regroup to talk about how we're going to make the hero move up and down.
Starting point link for this challenge

Your goal

Steps

1. Where's X and Y?

Where on the graph are the X and Y axes? 

2. Moving Up and Down

If we want the spaceship to move up and down, which axis is going to be important? 

3. Build 1st version of controls together

We want to be forever checking if the mouse is clicked down, then we'll change Y by a certain number to fly upwards. Otherwise, we'll change Y by a different number to let the hero fall down. 

4. What feels off about these controls?

They feel stiff and robotic! It'd feel more realistic if the hero had acceleration (flies up slowly, then picks up more speed) and gravity (falls down slowly, then picks up more speed.)

Why is this happening in our first version? Why do the controls feel too stiff and static? 

5. A solution to the problem

The controls feel so static because they are static. The Y value of our hero is changing by a static, unchanging number. We need to create a variable, because variables can hold changing numbers.