← All examples

Select the fruit

There are fruit and toys on the meadow. The task: click all the fruit and skip the toys. Once the exercise is solved, the instruction text changes to praise (set-state).

Schema
v2.0
Required features
element.imageelement.textelement.componentvisual.textvisual.animationvisual.statescomponent.clickablerule.selectaction.play-soundaction.hideaction.set-stateaction.emit-particles
Components
imagetextcomponent
Clickable elements
6 (correct: 3)

How to open it in the editor

  1. Click Open in the editor — GS Editor opens with the exercise loaded (scene and assets).
  2. Or click Download the exercise (a ZIP with projekt.json, images/ and sounds/) and choose Open ZIP in the start window of the editor.

Exercise file

Show the JSON (8,377 characters)
{
  "schema": "2.0",
  "requires": [
    "element.image",
    "element.text",
    "element.component",
    "visual.text",
    "visual.animation",
    "visual.states",
    "component.clickable",
    "rule.select",
    "action.play-sound",
    "action.hide",
    "action.set-state",
    "action.emit-particles"
  ],
  "id": "select-fruits",
  "size": {
    "width": 1200,
    "height": 675
  },
  "languages": [
    "pl",
    "en"
  ],
  "defaultLanguage": "pl",
  "assets": [
    {
      "id": "meadow",
      "kind": "image",
      "src": {
        "default": "images/meadow.png"
      }
    },
    {
      "id": "apple",
      "kind": "image",
      "src": {
        "default": "images/apple.png"
      }
    },
    {
      "id": "pear",
      "kind": "image",
      "src": {
        "default": "images/pear.png"
      }
    },
    {
      "id": "strawberry",
      "kind": "image",
      "src": {
        "default": "images/strawberry.png"
      }
    },
    {
      "id": "car",
      "kind": "image",
      "src": {
        "default": "images/car.png"
      }
    },
    {
      "id": "ball",
      "kind": "image",
      "src": {
        "default": "images/ball.png"
      }
    },
    {
      "id": "duck",
      "kind": "image",
      "src": {
        "default": "images/duck.png"
      }
    },
    {
      "id": "owl-blink",
      "kind": "animation",
      "src": {
        "default": "images/owl-blink.png"
      }
    },
    {
      "id": "correct",
      "kind": "audio",
      "src": {
        "default": "sounds/correct.wav"
      }
    },
    {
      "id": "wrong",
      "kind": "audio",
      "src": {
        "default": "sounds/wrong.wav"
      }
    },
    {
      "id": "win",
      "kind": "audio",
      "src": {
        "default": "sounds/win.wav"
      }
    }
  ],
  "elements": [
    {
      "id": "background",
      "type": "image",
      "rect": [
        0,
        0,
        1200,
        675
      ],
      "layer": 0,
      "visual": {
        "type": "image",
        "asset": "meadow"
      }
    },
    {
      "id": "instruction",
      "type": "text",
      "rect": [
        72,
        30,
        1056,
        70
      ],
      "layer": 5,
      "visual": {
        "type": "text",
        "text": {
          "pl": "Zaznacz wszystkie <b>owoce</b>.",
          "en": "Select all the <b>fruit</b>."
        },
        "size": 40,
        "color": "#5a3a22",
        "align": "center",
        "states": {
          "win": {
            "text": {
              "pl": "Brawo! Wszystkie owoce znalezione.",
              "en": "Well done! You found all the fruit."
            },
            "color": "#2e8b3a"
          }
        }
      }
    },
    {
      "id": "owl",
      "type": "image",
      "rect": [
        870,
        300,
        260,
        260
      ],
      "layer": 1,
      "visual": {
        "type": "animation",
        "asset": "owl-blink",
        "frames": 4,
        "fps": 3,
        "loop": true,
        "autoplay": true
      }
    },
    {
      "id": "apple",
      "type": "component",
      "rect": [
        90,
        150,
        160,
        160
      ],
      "layer": 2,
      "clickable": true,
      "visual": {
        "type": "image",
        "asset": "apple",
        "states": {
          "bad": {
            "tint": "#ff8c8c",
            "scale": 0.9
          }
        }
      },
      "on": {
        "correct": [
          {
            "do": "play-sound",
            "asset": "correct"
          },
          {
            "do": "emit-particles",
            "target": "self"
          },
          {
            "do": "hide",
            "target": "self"
          }
        ],
        "wrong": [
          {
            "do": "play-sound",
            "asset": "wrong"
          }
        ]
      }
    },
    {
      "id": "car",
      "type": "component",
      "rect": [
        330,
        164,
        160,
        136
      ],
      "layer": 2,
      "clickable": true,
      "visual": {
        "type": "image",
        "asset": "car",
        "states": {
          "bad": {
            "tint": "#ff8c8c",
            "scale": 0.9
          }
        }
      },
      "on": {
        "correct": [
          {
            "do": "play-sound",
            "asset": "correct"
          },
          {
            "do": "set-state",
            "target": "self",
            "state": "normal"
          }
        ],
        "wrong": [
          {
            "do": "play-sound",
            "asset": "wrong"
          },
          {
            "do": "set-state",
            "target": "self",
            "state": "bad"
          }
        ]
      }
    },
    {
      "id": "strawberry",
      "type": "component",
      "rect": [
        570,
        150,
        160,
        160
      ],
      "layer": 2,
      "clickable": true,
      "visual": {
        "type": "image",
        "asset": "strawberry",
        "states": {
          "bad": {
            "tint": "#ff8c8c",
            "scale": 0.9
          }
        }
      },
      "on": {
        "correct": [
          {
            "do": "play-sound",
            "asset": "correct"
          },
          {
            "do": "emit-particles",
            "target": "self"
          },
          {
            "do": "hide",
            "target": "self"
          }
        ],
        "wrong": [
          {
            "do": "play-sound",
            "asset": "wrong"
          }
        ]
      }
    },
    {
      "id": "ball",
      "type": "component",
      "rect": [
        90,
        380,
        160,
        160
      ],
      "layer": 2,
      "clickable": true,
      "visual": {
        "type": "image",
        "asset": "ball",
        "states": {
          "bad": {
            "tint": "#ff8c8c",
            "scale": 0.9
          }
        }
      },
      "on": {
        "correct": [
          {
            "do": "play-sound",
            "asset": "correct"
          },
          {
            "do": "set-state",
            "target": "self",
            "state": "normal"
          }
        ],
        "wrong": [
          {
            "do": "play-sound",
            "asset": "wrong"
          },
          {
            "do": "set-state",
            "target": "self",
            "state": "bad"
          }
        ]
      }
    },
    {
      "id": "pear",
      "type": "component",
      "rect": [
        330,
        380,
        160,
        160
      ],
      "layer": 2,
      "clickable": true,
      "visual": {
        "type": "image",
        "asset": "pear",
        "states": {
          "bad": {
            "tint": "#ff8c8c",
            "scale": 0.9
          }
        }
      },
      "on": {
        "correct": [
          {
            "do": "play-sound",
            "asset": "correct"
          },
          {
            "do": "emit-particles",
            "target": "self"
          },
          {
            "do": "hide",
            "target": "self"
          }
        ],
        "wrong": [
          {
            "do": "play-sound",
            "asset": "wrong"
          }
        ]
      }
    },
    {
      "id": "duck",
      "type": "component",
      "rect": [
        570,
        380,
        160,
        160
      ],
      "layer": 2,
      "clickable": true,
      "visual": {
        "type": "image",
        "asset": "duck",
        "states": {
          "bad": {
            "tint": "#ff8c8c",
            "scale": 0.9
          }
        }
      },
      "on": {
        "correct": [
          {
            "do": "play-sound",
            "asset": "correct"
          },
          {
            "do": "set-state",
            "target": "self",
            "state": "normal"
          }
        ],
        "wrong": [
          {
            "do": "play-sound",
            "asset": "wrong"
          },
          {
            "do": "set-state",
            "target": "self",
            "state": "bad"
          }
        ]
      }
    }
  ],
  "rule": {
    "kind": "select",
    "correct": [
      "apple",
      "strawberry",
      "pear"
    ]
  },
  "on": {
    "completed": [
      {
        "do": "set-state",
        "target": "instruction",
        "state": "win"
      },
      {
        "do": "emit-particles",
        "target": "owl"
      },
      {
        "do": "play-sound",
        "asset": "win"
      }
    ]
  }
}