Journal Entry 3


Date: 9.-10.5.2024

Activity: 

- Implemented main color changing mechanic of the game

- Created and add UI elements

- Added better movement

- Created game logo

- Created main menu and level select

- Built the first level

Notes:

This time I pulled kind of my own GameJam to focus on implementing the most critical things to get the game into somewhat of a playable state. First area is then definitely the color changing mechanic. For this I needed to change the color of the background so other elements with the same color disappear. I achieved this using a tilemap. I spent a bit of time here trying to change the color of all tiles before realizing it was as simple as setting the color of the whole tilemap.

It also took me quite a while to figure out how to deal with the objects that are the same color. This means they should not be interactable. I considered disabling them, but in the end I just turn off their collider. To be able to detect which colliders to disable, I created layers for each color to easily tell them apart. Because of this I needed to separate the tilemaps as well:


Also because of that I limited my color palette to 5 colors - the game controls better like this anyway (as opposed to changing it gradually).

I also added some linear interpolation for a nicer transition. This however introduced some bugs that I fixed later which involved changing colors very quickly and not disabling / enabling colliders. For changing the colors, I used the arrows but it was my first time working with the Input API so I was at first getting wrong Vectors and also getting the values multiple times.

Then I moved onto creating the UI elements to display how to change color and which one is active now. Work here was spent mostly in Photoshop, trying to create nice semicircles to represent the color palette:


I also then added an arrow and implemented its rotation so that it would always point to the active color:

Implementing this was fairly straightforward, the only thing was to change the pivot.

Next, I moved to implementing movement and jumps. I spent a lot more time here then I would have liked, and it still is very much not perfect. I started with adding vectors to position but this proved to be very bad as it clipped into other objects with collider. I then switched to doing it with Rigidbody2D which fixed horizontal movement. Jumping was (and still kind of is) a mystery to me how to implement well. I tried detecting the floor using different methods but settled on raycasting which worked the best so far. Double jumping quickly is sometimes still possible but most of the time it works as expected and jumping in the air is not possible.

After this I moved onto something simpler such as creating the game logo. I settled on this:

To add it into the game I then set on creating a main menu and a basic level selector. I made some errors with size of the whole canvas and anchors so I had to do this multiple times but other than that it worked fine just fine. I also learned how fonts are added to TextMesh Pro.

Last two things I worked on simultaneously: building the first level and fixing bugs along the way. The first level consists only from objects I mostly had implemented already so it went well. I just had to add a final flagpole that would end the level. I would like to add a timer and track best times here but that will be done at another time.


Invested hours: 

Implementing color changing mechanic: 4.5 hours

Creating and implementing UI elements: 2 hours

Implementing movement: 4 hours

Creating game logo: 30 minutes

Adding menus: 2 hours

Building first level: 2 hours

Fixing bugs: 1.5 hours

Writing this blogpost: 1.5 hours

Outcome:

Updated the Gitlab page for the game with my current progress.

Get Project C

Leave a comment

Log in with itch.io to leave a comment.