Bloop Boop critical reflection

 

Over the past 11 weeks, I have been working on Bloop Boop, and over that time, I have realised a few things about myself as a team member and as a programmer. Over the weeks I have definitely improved as a programmer and team member; I’m able to use more complicated aspects of C#(the coding language used in Bloop Boop), and be more better at identifying weak aspects of a project to help improve it. I do however understand that I can bring this further later on to become a better games developer and team member.

As a programmer, I would say I did fairly well over the project’s development, but could have done better. There were aspects of the code that I made which looking back on, I could have done better the first time. As time went on for Bloop Boop’s development, I became more slack with how neat my code was, sometimes I would write efficient code and try to make it as best as possible the first time around, but sometimes other code I had to rush but never went back to fix. This I believe I can fix on future projects by hacking code in for it to work, then go back to it when it works without any bugs I could notice, doing this I can actually develop games that have a quicker development time for alpha, but applying the same methodology to all code written will make me going back to fix up code more frequent.

Speaking of coding, my commenting game this trimester was appalling, mostly because Luke (the other programmer on the team) wouldn’t ever look at it since we were writing code that did not have any dependence on the other’s code. This was terrible as when it came to tasks becoming more spread-out, the designer needed to go in and add in features that I couldn’t work on since I was doing other tasks. Whenever he needed to add in some code, it was mostly him asking what stuff does, which shouldn’t be what code is, I should have commented everything so he knew what did what.

When the game had everything implemented and had a first draft of what the visual style was, I spoke heavily on what we could do to improve certain aspects. An initial one was the way the game was first presented to the player. The idea at the time was to have a vertical slider in the middle of the screen on the “main menu” screen that will take them to the game, which they would need to then swipe to make the falling Bloop bounce upwards. My comment that the main menu being the place you swipe and the Bloop bouncing on a platform made the game more intuitive, giving the player the immediate knowledge of how to play. Another aspect was the menu design, it had a menu for every state, even for stuff we could integrate into other aspects, a big one being the “main menu” going into a “levels” scene which went into “infinite mode” (this existed at one point) or “level select” which made navigating through the menu system feel like a maze.

I worked on the menu system which was made to have the set up of the menus done quickly, using lambda functions since the Buttons in unity require them to run code when they are clicked. I had previous experience with lambda functions in C++ but didn’t know C# had them as well. They caused great pain as the code run by the Buttons after setting them up through code wasn’t being run correctly, this was because they break what C# does with method calls and act a similar way that C++ does. In C#, a lambda function looks like this (in a button) :

void DoThing(int val){}

int a = 3;
Button b;
b.onClick.addListener(() => doThing(a));

Which looks good, but what it does with the parameter you supply in the lambda function is keep a reference to it no matter what it is. In C#, if the supplied parameter to an ordinary method call is a value type or a struct, it will make a copy and use that in the method execution, which means if you change the parameter you give it before the button call that runs the lambda function is pressed, then the value it uses has the new value. Because I had a for-loop running to create new listeners on the button and I was supplying the incremented value to the lambda function, I needed overcome this, and to do so I decided to do something like this:

void DoThing(int val){}

int a = 3;
Button b;
int a2 = a;
b.onClick.addListener(() => doThing(a2));

which in the for-loop looked like this:

void DoThing(int val){}

Button b;
for(int a = 0; a < 10; ++a)
{
    int a2 = a;
    b.onClick.addListener(() => doThing(a2));
}

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s