top of page

Senior project, post 05: Initial gameplay

Updated: Nov 9, 2019

This week, I moved on from preproduction and started actually working on my game! As I've mentioned in previous posts, my number one priority is getting the gameplay to be functional. I've decided to get it to work in singleplayer first before worrying about the multiplayer side of things.


Essentially, I have three systems I need to create. The first is the player controls. At its core, my game is about dodging and weaving, so it's an important first step. The player won't be controlling their speed, as it's fixed - only their direction.

The first line calculates the new rotation, the second applies it, and the third makes the player move in that direction. Note that I've also made the player model lean as they turn, imitating a motorbike.

Connected to the player controls is the camera. I want a fixed third-person view, but I can't just parent the camera to the player because the leaning would make it tilt. Instead, I made a basic "follow player" script that only considers the player's rotation on the y-axis.

The "target" transform here is the player. The "+ 90" accounts for the fact that player model faces +z instead of +x.

Getting walls to spawn is fairly straightforward. I spawn a cube prefab behind the player, then unparent it. By continuously calling this function, I create something that resembles a long wall when in truth it's made up of a bunch of small sections that overlap.

Wall spawning is simple, it's just continuously spawning small sections. The spawn position is parented to the player object, so it needs to be de-parented so it stays in place.

2 views0 comments

Comments


bottom of page