ET-FM

Game made for the Global Game Jam 2018, the theme being transmission, we made a game where you had to tune in to the various radio stations and shut down the ones which were ‘off’ in some way.

Click here to play!


Featured in the round up for the global game jam

I was responsible for:

  • The main menu (everything but the art)
  • The settings toggle in the game (everything but the art)
  • The help/tutorial menu (everything but the art)
  • The code for the lid of the red button

As the button was one of the main interactables in the game it was important to get the feel of it right and a lot of time was spent tinkering with getting the feeling of flipping the lid open how we wanted it.

        // If the mouse button is pressed and they have began dragging the mouse
        if (Input.GetMouseButton(0) && dragging && !button.GetBool("isPressed"))
        {
            // Create a vector from the start of the click to the current point
            Vector2 dragLine = Camera.main.ScreenToWorldPoint(Input.mousePosition);
            dragLine -= dragStart;

            // Get the drags magnitude
            float dragD = dragLine.magnitude;

            // If the mouse drags magnitude is above 1
            if (dragD > 1.0f)
            {
                // If the mouse is being dragged upwards open the lid
                if (dragStart.y < Camera.main.ScreenToWorldPoint(Input.mousePosition).y)
                {
                    // If the lid animation isnt finished move to the next frame
                    if (animFrame < 0.8f)
                    {
                        animFrame += animChange;
                        GetComponent<Animator>().Play("lidOpen", -1, animFrame);
                        flip.Play();
                    }
                    else if (animFrame == 0.8f)
                    {
                        animFrame += animChange;
                        GetComponent<Animator>().Play("lidOpen", -1, animFrame);
                        flip.Play();
                    }
                    // If the last frame then the lid is open
                    else
                    {
                        button.SetBool("isOpen", true);
                        button.SetBool("isPressed", false);
                    }
                }   
                // If the mouse is being dragged downwards close the lid
                else if (dragStart.y > Camera.main.ScreenToWorldPoint(Input.mousePosition).y)
                {
                    // If the lid animation isnt finished move to the next frame
                    if (animFrame == 0.99f)
                    {
                        animFrame -= animChange;
                        GetComponent<Animator>().Play("lidOpen", -1, animFrame);
                        flip.Play();
                        button.SetBool("isOpen", false);
                    }
                    else if (animFrame > 0)
                    {
                        animFrame -= animChange;
                        GetComponent<Animator>().Play("lidOpen", -1, animFrame);
                        flip.Play();
                        button.SetBool("isOpen", false);
                    }
                }

                // Update the start of the drag to current mouse position
                dragStart = Camera.main.ScreenToWorldPoint(Input.mousePosition);
            }
        }