← Wszystkie przykłady

Zaznacz owoce

Na łące są owoce i zabawki. Zadanie: kliknąć wszystkie owoce, pomijając zabawki. Po rozwiązaniu napis polecenia zmienia się na pochwałę (set-state).

Schemat
v2.0
Wymagane funkcje
element.imageelement.textelement.componentvisual.textvisual.animationvisual.statescomponent.clickablerule.selectaction.play-soundaction.hideaction.set-stateaction.emit-particles
Componenty
imagetextcomponent
Elementy do kliknięcia
6 (poprawne: 3)

Jak otworzyć w edytorze

  1. Kliknij Otwórz w edytorze — GS Editor otworzy się z wczytanym ćwiczeniem (scena i zasoby).
  2. Albo kliknij Pobierz ćwiczenie (ZIP z projekt.json, images/ i sounds/) i w oknie startowym edytora wybierz Otwórz ZIP.

Plik ćwiczenia

Pokaż JSON (8377 znaków)
{
  "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"
      }
    ]
  }
}