Introduction
As part of my school project, Freelancing, I took on the development of an exciting 2D earthbending-like fighting game. This project allowed me to tackle various challenges and gain new skills.
One of the key aspects was creating a technical design for the game. I carefully planned and documented the mechanics, interactions, and overall structure to guide the development process.
During the assignment, I had the opportunity to learn and implement two new things:
- I used the new Unity input system to enable local multiplayer functionality. This feature allowed players to enjoy the game together on the same screen, enhancing the overall experience.
- I made a SOLID mechanism for casting earthboulders. I aimed to strike the right balance between engaging gameplay and visually appealing effects.
Moreover, I dived into 3D modeling, crafting low-poly rock models used within the game. This added an extra dimension to the gameplay and enhanced the overall aesthetics.
Additionally, I took on the task of creating all character pixel art and animations from scratch, giving the game a personalized touch.
You can check out the video below to see the final product of my efforts:
The Making of Boulder Brawl
Technical Design
For this project, I needed to create a technical design before I could actually start working on it. We already had a format from school, so it was just a matter of filling that out. You can see the results below: (Note that it is in dutch)
Casting Boulders
As you can see in the technical design, I challenged myself to create a solid script that could handle all the boulders I wanted to cast. To achieve this, I created a function that, when called, goes through all the necessary steps to spawn a boulder. First, it spawns the actual boulder, then it adds it to a list in the GameManager, which is used for cleanup if the game were to end. After that, it applies the necessary forces, and finally, it returns the boulder, completing the casting process.
/// <summary>
/// Spawns a stone and adds an upwards force but also has a different casting position. Returns the stone that it spawned so that it can be used in other code.
/// </summary>
/// <param name="stoneToCast">The stone object that needs to be casted.</param>
/// <param name="castingForce">The force that the stone needs to be lifted upwards.</param>
/// <param name="castingPos">The position the stone needs to be casted at</param>
/// <returns></returns>
public GameObject CastStones(GameObject stoneToCast, float castingForce, Transform castingPos)
{
//Spawns stone and adds it to the list of stones.
GameObject stone = Instantiate(stoneToCast, castingPos.position, castingPos.rotation);
GameManager.Instance.Stones.Add(stone);
Rigidbody2D rb = stone.GetComponent<Rigidbody2D>();
//Add an upwards velocity.
rb.velocity = new Vector2(rb.velocity.x, castingForce);
//Returns the stone object.
return stone;
}