Collecting + Applying New Eye Glue

After inserting the new eyes the player will need to move back to the cabinet to collect the eye glue, and then, like before, once the object is in their inventory and they hover over the doll the icon for the object will appear.

Applying the eye glue, to keep things simple, will involve having to click 3 separate spots on the inside of the doll’s head/back of the new eyes. Each spot clicked will apply a 1/3 of the eye glue.

Sam has created 3 sprites that are designed to layer in such a way that they will connect and eventually look like one.

Before the player can click each spot, they will have a “glue scoop” cursor that is empty, and will need to click the glue jar on the bench in front of them to get glue on the scoop so that it can be applied to the doll. The cursor will change to reflect if it has glue on it or not, and we will make the jar highlighted on hover when the scoop is empty.

In order to achieve this, I am using a similar method that collecting the eyes uses, but I have created a new script called pickUpItem that I will use for collecting the eye glue jar. I have also created 2 separate scripts for applying the glue, one which is attached to each “glue spot” game object, and a central script on the jar itself that keeps track of how many spots have been clicked, as well as if there is glue on the scoop or not, whether the jar should be highlightable, etc.

In GlueSpot script:

private void OnMouseDown()
    {
        if (!hasBeenClicked && glueJar.GetComponent<EyeGlue>().goopOnScoop)
        {
            hasBeenClicked = true;
   
            gameObject.GetComponentInChildren<SpriteRenderer>().sprite = goopSprite;
            glueJar.GetComponent<EyeGlue>().goopOnScoop = false;
            glueJar.GetComponent<EyeGlue>().spotsClicked++;
        }
    }

To make the glue appear, I swap the circle outline sprite with that of the game object’s assigned goopSprite. I also have a hasBeenClicked variable to make sure the same spot can’t be clicked more than once and ruin the sequence. This part also sets the scoop back to being empty and increments a counter on the main glue jar script that then determines when the task is complete.

Finishing:

  • Need to rotate click point and rotate sprite render to counteract
  • Need to change mouse cursor back to the pointer and change sprite render of jar to that with the scoop in it
  • Make front and back views match, at least visually
  • Need to change task list on tag slightly, can make the clean + paint doll face less explanatory
  • Need to add task to put the back of the head back on the doll

Demo vid:

Laura Alford

Leave a Comment

Your email address will not be published. Required fields are marked *