To the horizon demo

Worked in a team of three programmers. Each of us tackled different tasks. I Was the primary programmer working on the core mechanics of player movement. I also worked on obstacle generation. The game was a demo to showcase variation in mechanics.

3 / 3
Gameplay

    Player Controller and Flying Mechanics

  • Implemented core mechanics of the gameplay loop. This included player movement (up-down and strafing) as well as forward motion of the player. .
    1. When formulating ideas for gameplay, my team and I had to first decide what actions the player should be allowed to do. Since this was a feature-demo, we decided to keep it simple and allow the player free X-Y movement, while fixing the velocity on the Z axis.
    2. Top-down movement was implemented by interpolating between forward speed and the vertical input by the vertical acceleration for each frame. Strafing was implemented similarly by interpolating between strafe speed and horizontal input with intervals of horizontal acceleration for each frame. The player's final position was calculated with the summation of their up and right transformations with the computed vertical and strafe values based on their input, per frame. The x and Y values were clamped so that the player does not leave the screen.
    3. The bank angle was calculated by getting the horizontal input from the player and rotating it around the Z axis using Quaternion.Euler(). The direction of banking was determined by the strafe speed and calculated by interpolating between the current rotation and target rotation by each frame.
  • Obstacle AI Programming

  • Procedurally generated obstacles in randomized positions for player to dodge while flying forward.
    1. The obstacles were spawned based on the position relative to the ground tile. The tile had 4 empty game objects attached to it. Three for spawning the obstacles (left, right, center) and one for spawning the next tile.
    2. The obstacle prefab would be instantiated at one of the three spawn points based on a random number generated between zero and three.
    3. The ground tile also had a box collider attached to it. When the player exits the collider, it would trigger the script to spawn the next ground tile at the spawn point.