Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1002 Bytes

py01-ball.md

File metadata and controls

38 lines (24 loc) · 1002 Bytes

Py01: Ball

Introduction

Now for something completely different! Welcome to Python! Python is complicated compared to Scratch but can do much more. By the end of the term, you'll be doing network games and maybe many other things.

This first exercise gives a very simple 'game' where you can move a ball around the screen.

Screenshot

For the first half of the exercise, copy the code presented to you. For the second half, there's a challenge.

Part One: Writing the game

Just do what the guide tells you!

Challenge One

You can only move the ball left and right, using the left and right keys.

Improve the game so you can move it up and down as well.

Challenge Two

Add another ball. Use the keys I and K to move it up and down, and J and L to move it left and right.

The key codes you need are:

  • K_j
  • K_l
  • K_i
  • K_k

Hint: you do not need to add a new class.