Brackeys Game Jam 2021.2 is starting today, and the theme is “Let there be chaos”. It’s my first game jam so I’m quite excited about it. My initial idea is a 2D game where the player plays as a cat, and the goal is to break as many stuffs as possible, generating chaos before getting caught.
Unfortunately I don’t have much experience with making 2D game, most of my knowledge are for 3D game. But hey this is what the game jams are for right? It let’s you know how much you can do in a short period of time, and that includes learning new stuffs!
After binge watching tons of 2D game tutorial in YouTube, I think I finally have the courage to start the project. So first thing I’ll have to do is player/cat movement. Using the CharacterController2D and tutorial by Brackeys (honestly at this point I think he’s the game dev jesus), I’ve successfully made a circle move.
Now I’ll need to make some stuffs that the cat/ball can interact and break. I want the props to interact with environment, but not with the cat. So the cat should be able to walkthrough the prop, but the prop will still collide with the ground and other props. This can be done by the layer-based collision. I’ve already created a layer called “Player” in the movement part, now I’ll need a new layer for the props. And then in Project Settings > Physics 2D, I’ll just need to uncheck the “Player” x “Prop” box.
I also want there to be a prompt showing on the prop when the player is nearby. I was thinking of using the OnTriggerEnter2D() and OnTriggerExit2D() to show and hide the prompt made by UI elements. However, the both functions are not being called, and it’s due the unchecked box in the collision matrix in project settings we did just now. I solved this by adding a child to the prop and added a trigger collision2D, and also making sure its layer is not “Prop”.
When the the player get into the collider of the prop, it will register the prop in a list, and only the last item in the list will be showing the prompt. When interacted by pressing F, the prop will be destroyed (for now, I’ll implement other type of interaction in later stage).