BallTrajectory

Description: Ball moves under the effects of gravity, friction and restitution
Programmer: Felix Thompson
Compiler: Smart Mobile Studio 2.2

Introduction

Felix shows how to use Physics to make the ball move in a realistic manner. (Sometimes the implementation of the effect of gravity uses a technique that is chosen for speed of execution rather than for strict adherence to the laws of nature). As usual, Felix comments the code thoroughly for your benefit. The code follows the graphic in action. Refresh the screen for a different output; the ball will restart from the centre of the box with a different random velocity. If BallTrajectory does not run in your current browser, please try another (such as Chrome).

Features

Ellipse, FillRectF, BeginPath, Fill, ClosePath