Week 9


Player Movement

This week I finished up player movement and tested it out with two players in split screen. Split screen was very easy to create and I follow this tutorial to learn how to do it. 

Using this split screen I tested how the players moved in the scene together and fixed the one bug that occurred from it which was to do with camera movement and panning. The two balls can collide with each other and work perfectly with the improved movement code that I worked on.

The balls also work with different kinds of surfaces and friction values.


Player Triggers and Doors

This week I have created triggers in unity. These triggers can be used to trigger unity events and do actions like open doors. There are may settings for these triggers that allow most types of door triggers to be activated. These include triggers that require one player and ones that require two player, triggers that don't need players and triggers that need to be activated with other triggers.



Level Design - "Follow the Line"

This week's level design focused on building the "follow the line" level (I don't know if that's going to be the actual name but it's the code name for now). 

There was little modelling involved as I could just use a LineRender with some large index sizes. I started off by learning how to draw a line from Tarodev:


This was done in Unity 2D so I had to rearrange some code around for it to work in 3D, the main issue being that the line would only draw at the camera's position as shown by Figure 1 below, but it was ultimately successful as shown by the gif below.

Figure 1 - Line getting caught on the camera position




I then got onto building a line generator as the there needs to be 2 sets of lines (per player). One line needs to be a line to be traced which is what I wanted to be created using a line generator. The second line is generated follows behind the player much like how the normal drawing on the gif above. The second line was very easy to create and I'll be testing it out on the player movements next week once it is ready.

However, the line generator caused so many problems all week. For starters, as shown in Figure 2 below, the line wouldn't update to new positions and would constantly get stuck in the centre of the world.

Figure 2 - Lines only drawing to the centre of the world


The lines would also draw on top of each other, effectively going nowhere, to which I figured out somewhere in the code it was reading an previous index's position, therefore not updating its own.

There were also many other numerous problems, but eventually, I managed to get the lines to draw with some randomness, shown in Figure 3.

Figure 3 - 2 lines generating randomly. The random horizontal slash through the blue line is just camera angle issues

Considering how much time this took, I have scrapped the idea of getting the line to reach from one end to the other and instead will just make it so that the lines instead go whether they want within the boundaries. The lines will also "in theory" travel at 90 degree angles to keep things simple (they can turn at different angles, but straight lines will only be at horizontal or vertical). I will have to finish this up next week as the line generator took so much time, but it'll be smooth sailing from here. The only hard task left is finding how much of the trace line is traced by the player, which would require some collision detections for each index of the line.

I will also have to simplify the other levels later on to ensure that they can all be done at an appropriate level.

Get 2 Bits of Memory

Leave a comment

Log in with itch.io to leave a comment.