General Description
This program is designed to demonstrate the effect of speed and gravity on the course of a moving object. The simulation is in the form of an archery contest. The instructions for the game appear on the screen when the program is started. The game requires for the user to set the angle of elevation (from 20 to 70), and the speed of the arrow's flight (which can be from 50 to 140). Points are awarded according to which part of the target (if any) is hit with each of your five arrows:- 30 for a bullseye, 20 for the middle ring and 10 for the outer edge.
Press any key to start.
Detailed Description
Lines 10-60 Credits.
70-100 Set up variables.
110-120 GOTO procedure for instructions.
130-150 Setup colours, sounds and characters.
160 Set D = distance and X = distance to plot target, also goes to procedure to display target.
170-260 Display score, distance and asks for angle of trajectory, and speed in metres per second.
270 Changes degrees to radians.
280-320 Erases old arrow.
330-360 Has arrow hit target?
370-390 Display arrow in new position.
440-430 Do it again until arrow hits something.
440-540 Procedure to display target.
550-590 Add to score.
600-670 Display ratings.
680-850 Procedure to display instructions.
Educational Note
Whilst this simulation is primarily just for fun, its use does encourage users to take into account the consequences of two different variables on their arrows' flight, and witness the outcome of their decision before their very eyes! The game is probably best run with two players taking alternate goes.
NB For projectiles under gravity the following formula was used:
Y = X * TAN(a) - (X * X * G) / (2 * U * U * COS(a) * COS(a))
Where x=distance from target; U=initial velocity; a=angle of trajectory; G=9.81 (force of gravity); Y=height of projectile.