Posts

Showing posts from April, 2018

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

Image
Friction Resistance: In my game, I have included some sloped platforms which are affected by a friction resistance. Friction is a force which resists the movement of an object. A force is added to my player's velocity which is calculated by the Cross Product between normal of surface, and the downwards Vector. Script used for the friction resistance Momentum: In my game, I have included a series of bouncing spherical objects which can lose momentum over time. In the animated clip, you can see a red object slowing down and losing momentum over time, before stopping completely. Script used for the momentum of bouncing objects. Local Friction on Harmonic Motion Platforms In my game, I was keen to add a feature to allow the player to be able to jump onto a harmonic motion platform, and allow them to move freely on it.  The game has been programmed, so the player becomes a parent object of any harmonic motion platform. This means the player can keep

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

Image
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.

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

Image
In my final game, I intend to produce a 2D platform style game where the player can flip the gravity, and travel on the floor and ceiling of the game. The basic movement and gravity mechanics will be controlled by the physics mechanics described below. Distance: Distance is the measurement of how far apart two objects are. This is calculated by the square Root of (x2 - x1) 2  + (y2 - y1) 2  + (z2 - z1) 2. . In the game, the player can track their progress throughout the level. The counter will help the player work out how far away they are from the end goal. This can be useful if there are different paths to the end goal. In the script, I take two Vector3 components, and subtract the X/Y/Z axes between each other. I then get the power of each axis, and get the square root of the values added together. Formula: SqRt( (x1+x2)^2 + (y1+y2)^2 + (z1+z2)^2 ) Displacement: Displacement is the motion of moving an object from one position/vector to a second position/vector