Intergenerational

This project was made in 2019 ~ 2020. It’s made in C# and uses the Unity engine. This was a group assignment with a group consisting of 5 people. This assignment came from an external client.

Source Control

We used GitHub for our source control solution. We tried to use git to the best we could for this project. This meant that we should use Pull Requests instead of merging our branching into master or dev. This resulted in a lot less merge conflicts.

When a new Pull Request was made, other members would review the code for quality, comments and the code style. If the reviewer has nothing to note the pull request is approved and the Pull Request can be merged.

Pull Request

I got better at reviewing code over the course of this project, thanks to all the reviewing I had to do when a new Pull Request came through. The code quality of entire project team also quickly improved because the we used these code reviews. Thanks to the reviews, we could all chip in and say how we would tackle an issue in a different approach, which might be better.

We also made sure to add comments whenever we felt something wasn’t clear when you read the code itself. Which made me appreciate comments a lot more. Before this project I wasn’t aware of all the special stuff you could do with comments, such as reference parameters, methods and other stuff.

Drawing

The thing I’m most proud of during this project was the drawing system.

Drawing

I was in charge on the drawing, and received little help with it. When I first started, I thought this would take a few weeks at least, since we’d have to find out how to write to textures in run-time. Thankfully I found a asset we could use in our project, called Free Draw.

I took a look in the code to see how it worked and if it could be optimized, and found out that the brushes were methods assigned to a delegate;

Method to draw on Texture

I didn’t like the way this was done, because it would bloat the Drawable script if you wanted a lot of different pens shapes, different colours, and other stuff. Which was something I wanted.

I rewrote the code and turned the brushes from delegates into ScriptableObjects.

Rewritten brushes

I chose to make this an abstract so new brushes could easily overwrite specific methods and properties without having to write a lot of duplicate code.

For instance, if I wanted to create a brush that draws a rainbow, all I would have to do is write a few lines of code for it to work.

Rainbow brush

This change made the rest of the Drawable class a shorter and, in my opinion, easier to understand.

Over time, we had to add more stuff to Drawable such as outlines, merging two textures together and brush size multipliers.

Rewritten Drawable class