pxt-calliope/docs/reference/js/lessons/pong/quiz.md

41 lines
1.1 KiB
Markdown
Raw Normal View History

2016-03-26 00:47:20 +01:00
# pong quiz
create the game Pong #LED #number #math #acceleration #docs
## Name
## Directions
Use this activity document to guide your work in the [pong tutorial](/microbit/lessons/pong/tutorial)
Answer the questions while completing the tutorial. Pay attention to the dialogues!
## 1. Create two variables that will keep track of the x-position and y-position of the ball, and assign the variables to their initial values.
<br/>
## 2. Create two variables that keeps track of the velocity (or the speed and direction) of the ball, and assign the variables to their initial values.
<br/>
## 3. Write the code that plots the initial position of the paddle and the ball.
<br/>
## 4. Write the code that moves the paddle up when Button A is pressed. (Don't worry about setting 'game running' to true.)
<br/>
## 5. Write the code that moves the paddle up when Button B is pressed. (Don't worry about setting 'game running' to true.)
<br/>
## 6. Write the code to update the y-velocity. (Hint: look at the function "update y velocity".)
<br/>
## 7. Write the code to move the ball. (Hint: look at the function "move ball".)
<br/>