Basic Movement


Basic movement uploaded for testing purposes, in addition to a prototype system for flight designed to be inherently unstable and difficult to control accurately. This feature will be used throughout the game as a challenge requiring the player to perform precision flying to complete a stage, however it is still a work in progress and, as it's central to the game, will likely be iterated on heavily throughout the entire development process.

Controls are currently hard coded as follows:
When on the ground: AD to strafe, Space to jump. 
When using basic flight: Left Shift to fly, AD to turn side to side. 

An example of the player using the new flight mechanic

Testing/Feedback

Controls:

Shift might not be the best key due to some players having Sticky Keys enabled on Windows machines.
Possibly change jump from Space to W.

Mechanics:

Flight is good, and is easy to understand but still has a high skill ceiling
Feels like you should be able to strafe in the air.

Regarding air-strafing, this was intentionally omitted to force the player to use the flight more. However, as it was mentioned several times, a form of air strafing may be implemented that allows you to do so in a limited capacity. One way that may work is that the player may only strafe when they are close to the ground. Alternatively, it may be unrestricted, but be very slow to limit control.

Art/Visuals:

Feels cute and is consistent
Flight/fall animations & rotation are funny

Implementation

The implementation was fairly simplistic, and implemented two different movement mechanics that alternate depending on whether the flight key is being held, and whether the player is on the ground.

When on the ground, the strafe keys modify the player's velocity through Unity's native Vector3 damping function, that allows for the smooth transitions between direction of travel. Jumping is a single instant of force that gets applied to the player.

The flight and tilt mechanics are slightly different, in that there are two conditions that determine when to use them over standard movement. When the player is flying, the strafe keys now cause the player to tilt from side to side to allow them to change directions in an intentionally unstable manner. The second condition is whether the player is actually in the air; when the player is not flying (i.e. falling), but was flying since the last time they touched the ground, they will be able to tilt still. This allows players to tap the flight button and change directions without actually flying.

Flight itself is simply implemented as exerting the negative force of gravity on the player with a multiplier. When this multiplier is 1 (and the player is facing straight upwards), the player will float as the force will balance with gravity perfectly. When this is 2, (and the player is upright still), the player will "fall" upwards. The instability of the system comes from the direction in which that force is applied.

The force for flight is applied to the player's local up vector, which means if they're horizontal, they will experience the force of gravity as normal, but be flying sideways incredibly quickly. This forces the player to balance on that force; if they turn sideways too much, they'll hit the ground. By setting the multiplier from above higher than 1, this causes there to be an angle at which the player will negate gravity perfectly and still have horizontal motion. Further, this also allows the player to travel upwards instead of floating in the air aimlessly, and even up-and-diagonally.

It also has the further effect of being hilarious when the player accidentally accelerates straight down with 3x the force of gravity.

Credits

This build utilises several works of free to use art assets from several sources.

Wizard Sprite & Magic particles -- GrafxKid on OpenGameArt.org
All Tileset Art -- @JoeCreates on Twitter

Get Magic Is Hard

Leave a comment

Log in with itch.io to leave a comment.