top of page

Team size: 2

Duration: 1 month

Roles: Technical director, Programmer

Engine: Unity

Languages: C#

This game was made as the final project for my university course, Game-Based Learning. It aims to teach beginners to programming about boolean algebra using a visual representation of logic gates. In this project, I was responsible for all the logic and programming. The game follows the Mechanics-Dynamics-Aesthetics (MDA) framework with an emphasis on mechanics and dynamics. 

Play here!

Go to repo

void FixedUpdate()

{

    SetInputs();

    switch (dropdown.value)

    {

        case 0:

            output = false; // if default value, should not output true

            break;

        case 1:

            output = input1; // if wire, should output singular input

            break;

        case 2:

            output = input1 && input2; // if AND, output AND of inputs

            break;

        case 3:

            output = !input1; // if NOT, output Negation of singular input

            break;

        case 4:

            output = input1 ^ input2; // if XOR, output XOR of inputs

            break;

    }

    SetOutputLine(output);

}

In this code block, we can see how the boolean algebra works behind the scenes. As can be seen in the video above, the gates are represented by dropdown menus with the choices being the gates. The picture depicts the code behind the multi gates seen towards the end of the video. 

The call to SetInputs updates the hidden boolean values according to what is outputted by the preceding gates.

The call to SetOutputLine(bool) colours the visual indicator of the output of that gate according to the color scheme depicted throughout the game.

bottom of page