External Exam Download Resources Web Applications Games Recycle Bin

Simple Bounce


theory
Simple Bounce Algorithm
We can calculate a simple rebound angle of a ball on a paddle via the following algorithm:

Rebound angle = 180 – direction at collision




implementation
1. Draw sprites
Make sure ball and paddle sprites are centred:



2. Add scripts

ball script:



paddle script:




questions
  1. adjust controls and speed for paddle to your pleasing. Do you prefer keyboard or mouse?
  2. try the breakout challenge below before you go improving this game