Skip to content

StarCall

Dave Luk edited this page May 10, 2016 · 17 revisions

Overview

In this lesson we will use the canvas to handle user touch events. We will also use procedures for repeated and random behavior.

New Concepts

Canvas:

A surface where you can put objects on a given location.

Image Sprite

An interactive image that can be put on a canvas. It reacts to collisions and touches.

Canvas

Random

Selecting a random location out of the possible locations.

Let's Get Started

Designer

We will need:

  • Canvas
  • Image sprite

For the score counter:

  • Vertical and horizontal layouts
  • Labels
  • Button

Designer

Blocks

  1. Generate star at random location
  2. Handle touch event for the star
  3. Increment score and keep track of time
  4. Handle Edge collision
  5. Reset button

Media & Assets

  1. Starsinthesky.jpg
  2. star.png
  3. game-over.png
  4. Magellanic Clouds.mp3

External References

Clone this wiki locally