Grup Game

Grup – 2d Platformer

Grup

Jump to..


Overview


Grup looks out over their small world and, seeing it grey and lifeless, decides to set out and make a difference. On their mission to clean up the world, Grup will need help from you to navigate obstacles and clean pollutants from the air, water, and ground. Help guide Grup along their adventure to bring back color to their world. Grup knows that even the smallest change can make a difference…

Grup is the work of four talented individuals for their CSS 385 Game Design class at the University of Washington, Bothell. We started with a piece of art and an idea and ran with it. We knew that we wanted the game to be laid back, relaxed, and casual. We wanted a small challenge on the platforming levels and a nice visual reward when the player cleared the pollutants.


Trailer


Grup Trailer

Contribution


Vine Growth Effect


Vine trigger effect and player interaction

The script used to grow the vines is attached the base object. On activation, it will enable all of the child objects of the base from the hierarchy using the values below. The grow curve is multiplied with delta time and divided by the number of objects. This gives users creative control over how objects are enabled.

The creator can also attach a particle system that will spawn with each base object as it is enabled as seen in the above gif.

Growth script inspector window

Pollutant Effects


Feedback from testing was clear that it was not apparent that the player needed destroy the floating pollutants in the world. To make it more clear, I created a trigger effect that would play a particle system when the player was within the radius of a collider.

To get around garbage collecting the particles, the whole system is instantiated on the trigger enter and the game object is destroyed on exit.

private void OnTriggerEnter2D(Collider2D collision) {
    if (collision.tag == "Player") {
      PlayEffect();
    }
  }

private void OnTriggerExit2D(Collider2D collision) {
    if (collision.tag == "Player") {
      DestroyEffect();
    }
  }

void PlayEffect() {
    if (!ORisActive) {
      Vector3 pos = transform.position;
      pos.z -= 0.5f;
      Vector3 size = transform.localScale;
      EmitterClone = Instantiate(Emitter, pos, Quaternion.identity);
      EmitterClone.transform.SetParent(gameObject.transform);
      EmitterClone.transform.localScale = size;
      ORisActive = true;
    }
  }

void DestroyEffect() {
    Destroy(EmitterClone);
    ORisActive = false;
  }

World Color Change


This was my more critical contribution to the game and was a core game play mechanic. The object of the game is to get through the levels and destroy the pollutants in the world. Color is used to guide the player through the levels and act as a guide for where to go.

The technical aspect ending up being simple after a lot of iteration. Using Unity’s lightweight shader graph, the main texture passes through a saturation value. This value is effected by pollutants that are touching the collider of an object using this shader.

Unity Lightweight Shader Graph

At first I was having issues with a single pollutant effecting all object utilizing the shader. After researching the issue, the key for individual object to not effect the shader as a whole is to have it act as a material instance. Therefore each object creates an instance of the material at runtime.

void Start() {
    saturationLevel = 0f;
    //leaves
    materials[0] = Instantiate<Material>(materials[0]);
    //flowers
    materials[1] = Instantiate<Material>(materials[1]);
  }

Project Website:
https://teamgrup.github.io/Grup/index.html
You can access the repository of this project here:
https://github.com/TeamGrup/Grup