Cannon
This is an educational game. While playing the game one will learn about the dynamics of a projectile fired from a cannon.
The distance where the cannon ball will land from the base of the cannon depends upon:
- Height of the cannon above the ground level. This can be modified using the keys ↑↓ or by clicking on ↑ ↓
- Angle of the cannon's muzzle. This can be modified using the keys ← → or by clicking on ← →
- The velocity of the ball on exiting the muzzle (i.e. gunpowder amount). This can be modified using the keys n and m or by clicking on -n +m
- The gravitational strength. On earth it is normally 9.81 m/s2. This can be modified using the keys f and g or by clicking on -f +g
- The strength and direction of the wind. The game will randomly change this making the game harder to play.
Other actions:
- The tank will start out at a random distance from the cannon's base and will have a random speed and direction. You will need to adjust the parameters and then fire the cannon using the Space Bar or clicking Space Bar.
-
You can make the tank become a stationary target by using the key t or pressing Stop (t). This will make it easier to shoot it. Once you stop the tank the key t or pressing Start (t) will start it
moving again.
-
You can pause the game using the key p or pressing Pause (p). Using the key p again or pressing Unpause (p) will resume the game. This can be useful to pause the cannon balls to observe their
trajectories.
The score will be calculated depending on:
- The number of tanks destroyed.
- The distance of the tank destroyed from the cannon's base.
- The number of cannon balls used.
- When a tank reaches the cannon's base the score will be halved
You have 100 cannon balls, and when all are fired the game is over.
The dynamics of the cannon balls will be calculated by:
- dx = (V0*Cos(θ)+Vw)*dt
- dy = (V0*Sin(θ)-g*t)*dt
where
- dx = the incremental increase in the horizontal distance (meters) of the ball from the firing muzzle's exit point. Positive is to the right.
- dy = the incremental increase in the vertical distance (meters) of the ball from the firing muzzle's exit point. Positive is up.
- V0 = the speed of the ball as it exits out of the muzzle (meters/sexcond).
- θ = the angle of the cannon's body (degrees) measured from the positive horizontal direction.
- Vw = the speed of the wind in the horizontal direction (meters/second). Positiove is to the left.
- g = the accelleration due to gravity. On earth it is 9.81 meters/second2.
- t = the current time in seconds.
- dt = the incremental time (seconds)
___