I thought it would be interesting to develop a game in around a week, so I spent a total of about eight days working on the project. The goal was to develop a small clone of Bubble Bobble by the end of the eighth day.

However, I encountered several problems that were completely new to me. I had to handle collisions between bubbles and other entities, for example. It was a simple problem to solve, but I had to spend some time considering solutions.

I wanted full control over player movement and bubble physics, so I ended up ignoring Unity's built-in physics system. Alternatively, I could have used a kinematic rigidbody, and controlled movement via a script. I did end up using kinematic rigidbodies, but only for the OnCollisionEnter2D method. Movement and collision handling took a little longer than I expected, but I learned more from doing so.

Most scripts I wrote myself, without doing prior research or design. The only sources used were Unity's documentation, and the first two videos in Sebatian Lague's platformer controller series on YouTube. After watching those two videos, I expanded on his concept and worked on the rest of the code on my own. Because of the small time-frame, I didn't put much thought into writing efficient, modular code.

There are several things I would have done differently, which I will be considering in future projects.

  •  I was setting the transform directly and using kinematic rigidbodies, which I will be avoiding in the future. The documentation suggests using Rigidbody2D.MovePosition for small movements, and directly modifying Rigidbody2D.position for larger movements.
  • For larger projects, I plan on spending more time on research and design. For both the game, and the code. Not planning out the architecture first made it more difficult to get things working, which would likely become a problem as the codebase grows. In my experience, spending more time designing the codebase also results in higher quality code.
  • I also plan on using the Physics or Physics2D classes more often for collision handling. Especially for more complex geometry. The Physics class offers the method ComputePenetration to determine the minimal translation required to seperate colliders, and both classes offer overlap methods. I was only using Physics2D for raycasts, but the other methods might be useful in the future.
StatusPrototype
PlatformsHTML5
Authoruseruserwr
Made withUnity