WE MOTH (SNAP)

To learn more about my team's WE project, click here:

Below is my team's WE game, made entirely with SNAP.

Try it yourself! Play below or click here.

Instructions: Hover over light switch to flip off.

Explanation of code:

MOTH CODE

Purpose: Touch light switches that are off to turn them on.

Explanation: The main algorithm here simply checks if any lights are off with a simple if-then block. If the light switch value is 0 (off), the moth will touch it to set the value to 1 (on).

LIGHT CODE

Purpose: Display different brightness levels depending on the number of light switches on.

Explanation: The "Light" ghost effect increases as more "Light Switch" turn off, giving the illusion that "Light" is getting dimmer. The effect is achieved using an IF-THEN block. The number of "Light Switch" on is read by the "Brightness" variable, manipulated by the many "Light Switch."

SLEEPING GIRL CODE

Purpose: The girl must think different phrases to express how her sleep is going.

Explanation: This is achieved using a series of if-then blocks. IF "Brightness" is a specific value, THEN "Sleeping Girl" will have different thoughts to show the user.

LIGHT SWITCH CODE

Purpose: Change colors to show the user which "Light Switch" is on and off, and change the brightness of the light.

Explanation: Using an if-then block, the code determines that IF the moth touches it, "Light Switch" will turn on (costume change) and change the "Brightness" value, manipulating the user's perceived brightness of the light.

BACKGROUND CODE

Purpose: Cover the light switches and light for the game over screen.

Explanation: While it is initally hidden when the green flag is chicked, the all-black sprite covers all the other sprites except for "Sleeping Girl" when the game ends by waiting to the broadcast, "Win" or "Lose."

To learn more about my team's WE project, click here:

Let's go back to see the rest of my projects!