Final Game #2: Harmonic Motion, Projectile Motion and Buoyancy

In this blog post, I review some of the advanced mechanics which I have implemented into my game.

Harmonic Motion
Harmonic Motion is the concept of oscillating motion, where a force is proportional to the displacement of the equilibrium (starting) point.

Within my game, I have included several harmonic motion platforms which move horizontally (left-right), vertically (up-down), diagonally (top-right to bottom-left) and in a circular motion.

The below example demonstrates harmonic motion in my game, which is a white platform moving in a circular direction.
The Harmonic Motion script. The Time*speed needs to have a constant increase over time.

Circular Harmonic Motion. Top is Game view; bottom is scene view

Projectile Motion
Projectile Motion (also called Parabolic Motion) is when an object is being thrown towards a specific curved path, at an angle. Within my game, I have implemented a cannon which shoots enemies out of a cannon at a pre-determined angle.


This is the script for the projectile motion.


Buoyancy (Water Mass Resistance)
Buoyancy is an upwards reactive force for liquids which opposes the weight/mass of an object. Within my game, I have added a series of areas which contain water pools. These have got a mass resistance based on water.


This is the script for the buoyancy. It needs to be a trigger because the player needs to move through the water object.  I give the player a density, and use Archimides Law to return a new density (buoyancy).

Comments

Popular posts from this blog

Final Game #4: Conclusion

Final Game #3: Friction Resistance, Momentum and Local Platforms

Final Game #1: Distance, Displacement, Acceleration, Velocity and Gravity