From 5ce52c3ae9967a5328a9eb4553fbaf33531b8eca Mon Sep 17 00:00:00 2001 From: tjvr Date: Sun, 20 Aug 2017 19:10:00 +0100 Subject: [PATCH] Events: on('foo') -> onFoo() --- docs/2-animation.html | 14 +++++++------- docs/pdfs/1-numbers.pdf | Bin 190035 -> 186089 bytes docs/pdfs/2-animation.pdf | Bin 232328 -> 227849 bytes docs/pdfs/3-arrays.pdf | Bin 77960 -> 69985 bytes docs/pdfs/4-functions.pdf | Bin 57545 -> 57618 bytes docs/pdfs/install.pdf | Bin 178880 -> 178953 bytes docs/pdfs/jump.pdf | Bin 214066 -> 214166 bytes docs/pdfs/reference.pdf | Bin 227548 -> 220708 bytes docs/reference.html | 15 ++++++++------- docs/sheets/2-animation.md | 14 +++++++------- docs/sheets/reference.md | 13 ++++++------- uw/assets.js | 28 ++++++++++++++-------------- uw/emitter.js | 22 +++++++++++++++------- uw/index.js | 22 +++++++++++----------- 14 files changed, 68 insertions(+), 60 deletions(-) diff --git a/docs/2-animation.html b/docs/2-animation.html index 7a57fef..3483285 100644 --- a/docs/2-animation.html +++ b/docs/2-animation.html @@ -133,7 +133,7 @@

Events

  • Use on('tap') to detect when the screen is tapped.

    -
    world.on('tap', e => {
    +
    world.onTap(e => {
         alert("dont touch this")
     })
     
    @@ -147,7 +147,7 @@

    Events

        alert("dont touch this")
     

    -
    world.on('tap', e => {
    +
    world.onTap(e => {
         var bullet = new Sprite
         bullet.costume = 'đź‘ľ'
         bullet.x = e.fingerX
    @@ -156,14 +156,14 @@ 

    Events

    // TODO: move the bullet ... })
    -

    Add this inside the world.on('tap'... block.

    +

    Add this inside the world.onTap block.

  • What’s going on here? e is an event object, telling us the details of the tap event. The e.fingerX and e.fingerY attributes tell us the coordinates of the tap.

    Now let’s try moving our projectile!