Beach Platformer
@Stage\n\n@escenario\n\nwhen I receive [actualizar posición v]\nset size to (400) %\nset x to ((posición x) - (posición global x))\nset size to (100) %\n\nwhen I start as a clone\ngo to [back v] layer\nshow\n\ndefine Crear escenarios\nset [contador v] to [0]\nrepeat (11)\n    change [contador v] by (1)\n    switch costume to (Contador)\n    set [posición x v] to (((Contador) - (1)) * (475))\n    create clone of (_myself_ v)\nend\n\nwhen I receive [reiniciar v]\n\nwhen I receive [reiniciar v]\n\ndelete this clone\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nswitch costume to (escenario 1-1 v)\nwait (0) seconds\nCrear escenarios\n\n@escenario mascara\n\nwhen I receive [actualizar posición v]\ngo to [front v] layer\nset x to ((posición x) - (posición global x))\n\ndefine Crear escenarios\nset [contador v] to [0]\nrepeat (11)\n    change [contador v] by (1)\n    switch costume to (Contador)\n    set [posición x v] to (((Contador) - (1)) * (475))\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\n\nwhen I start as a clone\nset size to (100) %\nset [ghost v] effect to (100)\n\nwhen I start as a clone\nforever\n    if <<((posición x) - (posición global x)) < [475]> and <((posición x) - (posición global x)) > [-475]>> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [reiniciar v]\n\nwhen I receive [reiniciar v]\n\ndelete this clone\n\nwait (0) seconds\nbroadcast (crear escenario v) and wait\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nswitch costume to (escenario 1-1 v)\nCrear escenarios\n\n@mario\n\nwhen I receive [reiniciar v]\nshow\nset [personaje fase v] to [peque]\n\nwhen I start as a clone\nrepeat (10)\n    change x by ((Vx) * (-1))\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [reiniciar v]\ngo to [front v] layer\nset rotation style [left-right v]\nforever\n    go to x: ([x position v] of [mario mascara v]) y: ([y position v] of [mario mascara v])\n    if <(posición global x) > [4800]> then\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [reiniciar v]\nif <(personaje) = [mario]> then\n    switch costume to (01 v)\n    set size to (100) %\n    forever\n        if <(posición global x) > [4800]> then\n            if <(personaje fase) = [peque]> then\n                set size to (100) %\n                switch costume to (07 v)\n            end\n            if <(personaje fase) = [grande]> then\n                set size to (70) %\n                switch costume to (mario cayendo v)\n            end\n        else\n            if <(personaje fase) = [peque]> then\n                if <([sobre la plataforma? v] of [mario mascara v]) = [no]> then\n                    switch costume to (05 v)\n                else\n                    if <([abs v] of (Vx) ) > [1]> then\n                        next costume\n                        if <(costume [number v]) > [3]> then\n                            switch costume to (02 v)\n                        end\n                        wait (0.05) seconds\n                    else\n                        switch costume to (01 v)\n                    end\n                end\n            end\n            if <(personaje fase) = [grande]> then\n                set size to (70) %\n                if <(costume [number v]) < [14]> then\n                    switch costume to (14 v)\n                end\n                if <([sobre la plataforma? v] of [mario mascara v]) = [no]> then\n                    switch costume to (19 v)\n                else\n                    if <([abs v] of (Vx) ) > [1]> then\n                        next costume\n                        if <(costume [number v]) > [17]> then\n                            switch costume to (180 v)\n                        end\n                        wait (0.05) seconds\n                    else\n                        switch costume to (14 v)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [reiniciar v]\nif <(personaje) = [scratch cat]> then\n    switch costume to (parado v)\n    forever\n        if <(posición global x) > [4800]> then\n            if <([abs v] of (Vy) ) < [2]> then\n                if <(personaje fase) = [peque]> then\n                    switch costume to (parado v)\n                end\n                if <(personaje fase) = [grande]> then\n                    switch costume to (parado v)\n                end\n            end\n        else\n            if <(personaje fase) = [peque]> then\n                set size to (20) %\n                if <([sobre la plataforma? v] of [mario mascara v]) = [no]> then\n                    switch costume to (saltando v)\n                else\n                    if <([abs v] of (Vx) ) > [1]> then\n                        next costume\n                        if <(costume [number v]) > [28]> then\n                            switch costume to (caminando 1 v)\n                        end\n                        if <[21] > (costume [number v])> then\n                            switch costume to (caminando 1 v)\n                        end\n                        wait (0) seconds\n                    else\n                        switch costume to (parado v)\n                    end\n                end\n            end\n            if <(personaje fase) = [grande]> then\n                set size to (21) %\n                if <([sobre la plataforma? v] of [mario mascara v]) = [no]> then\n                    switch costume to (saltando v)\n                else\n                    if <([abs v] of (Vx) ) > [1]> then\n                        next costume\n                        if <(costume [number v]) > [28]> then\n                            switch costume to (caminando 1 v)\n                        end\n                        if <[21] > (costume [number v])> then\n                            switch costume to (caminando 1 v)\n                        end\n                        wait (0) seconds\n                    else\n                        switch costume to (parado v)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [reiniciar v]\nforever\n    if <([abs v] of (Vx) ) > [7]> then\n        create clone of (_myself_ v)\n    end\nend\n\n@mario mascara\n\ndefine Movimiento vertical\nset [sobre la plataforma? v] to [no]\nchange y by (Vy)\nColisión vertical\nGravedad\n\ndefine Movimiento horizontal\nchange x by (round (Vx))\nColisión horizontal\nFricción\n\ndefine Gravedad\nchange [vy v] by (-1)\n\ndefine Colisión vertical\nif <<touching (escenario mascara v)?> or <touching (bloque i v)?>> then\n    if <[0] > (Vy)> then\n        repeat until <not <<touching (escenario mascara v)?> or <touching (bloque i v)?>>>\n            change y by (1)\n            set [colisión vertical v] to [5]\n        end\n        set [sobre la plataforma? v] to [si]\n        set [vy v] to [0]\n    end\n    if <(Vy) > [0]> then\n        repeat until <not <<touching (escenario mascara v)?> or <touching (bloque i v)?>>>\n            change y by (-1)\n            set [colisión vertical v] to [5]\n        end\n        set [vy v] to [0]\n    end\nend\n\ndefine Fricción\nset [vx v] to ((Vx) * (0.9))\n\ndefine Colisión horizontal\nif <<touching (escenario mascara v)?> or <touching (bloque i v)?>> then\n    repeat (5)\n        change y by (1)\n        if <not <<touching (escenario mascara v)?> or <touching (bloque i v)?>>> then\n            stop [this script v]\n        end\n    end\n    change y by (-5)\n    if <[0] > (Vx)> then\n        repeat until <not <<touching (escenario mascara v)?> or <touching (bloque i v)?>>>\n            change x by (1)\n            set [colisión horizontal v] to [5]\n        end\n        set [vx v] to [0]\n    end\n    if <(Vx) > [0]> then\n        repeat until <not <<touching (escenario mascara v)?> or <touching (bloque i v)?>>>\n            change x by (-1)\n        end\n        set [vx v] to [0]\n        set [colisión horizontal v] to [5]\n    end\nend\n\n\n\nwhen I receive [reiniciar v]\nset [colisión horizontal v] to [0]\nforever\n    repeat until <(colisión horizontal) < [1]>\n        change [colisión horizontal v] by (-1)\n    end\nend\n\nwhen I receive [reiniciar v]\nshow\nset x to (0)\nset y to (100)\nset [vx v] to [0]\nset [vy v] to [0]\nset [posición global x v] to [10]\nset [vidas mario v] to [1]\nset [colisión vertical v] to [0]\nforever\n    Movimiento vertical\n    Movimiento horizontal\n    change [posición global x v] by (x position)\n    set x to (0)\n    broadcast (Actualizar posición v)\n    if <(y position) < [-178]> then\n        wait (0.1) seconds\n        broadcast (reiniciar v)\n    end\nend\n\nwhen I receive [reiniciar v]\nset [ghost v] effect to (100)\nforever\n    if <(posición global x) > [4800]> then\n        set [posición global x v] to [4801]\n    else\n        if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <(STICK X) = [-1]>> then\n            change [vx v] by (-0.5)\n            if <(personaje fase) = [grande]> then\n                change [vx v] by (-0.1)\n            end\n        end\n        if <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <(STICK X) = [1]>>> then\n            change [vx v] by (0.5)\n            if <(personaje fase) = [grande]> then\n                change [vx v] by (0.1)\n            end\n        end\n        if <<<<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <key (space v) pressed?>> or <(STICK BUTTON) = [1]>> and <(Sobre la plataforma?) = [si]>> then\n            change [vy v] by (16)\n            if <(personaje fase) = [peque]> then\n                start sound [mario-bros-jump v]\n            else\n                start sound [Big Jump v]\n            end\n        end\n    end\nend\n\nwhen I receive [reiniciar v]\nset [colisión vertical v] to [0]\nforever\n    repeat until <(colisión vertical) < [1]>\n        change [colisión vertical v] by (-1)\n    end\nend\n\nwhen I receive [reiniciar v]\nforever\n    if <(personaje fase) = [peque]> then\n        switch costume to (01 v)\n    else\n        switch costume to (02 v)\n    end\nend\n\nwhen I receive [reiniciar v]\nforever\n    if <(posición global x) > [4800]> then\n        set [posición global x v] to [4801]\n    else\n        if <key (c v) pressed?> then\n            if <([direction v] of [mario v]) = [90]> then\n                change [vx v] by (2)\n            else\n                change [vx v] by (-2)\n            end\n            wait until <not <key (c v) pressed?>>\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [reiniciar v]\nwait until <(posición global x) > [4800]>\nchange [puntaje v] by (round (((y position) + (200)) / (40)))\nstart sound [smb_stage_clear v]\n\n@Goomba\n\ndefine Movimiento vertical\nchange y by (vy goomba)\nColisión vertical\nGravedad\n\ndefine Gravedad\nchange [vy goomba v] by (-1)\n\ndefine Colisión vertical\nif <touching (escenario mascara v)?> then\n    if <[0] > (vy goomba)> then\n        repeat until <not <touching (escenario mascara v)?>>\n            change y by (1)\n        end\n        set [sobre la plataforma? v] to [si]\n        set [vy goomba v] to [0]\n    end\n    if <(vy goomba) > [0]> then\n        repeat until <not <touching (escenario mascara v)?>>\n            change y by (-1)\n        end\n        set [vy goomba v] to [0]\n    end\nend\n\ndefine Movimiento horizontal\nchange [posición x goomba v] by (vx goomba)\nset x to ((posición x goomba) - (posición global x))\nColisión horizontal\n\ndefine Fricción\nset [vx goomba v] to ((vx goomba) * (0.8))\n\ndefine Colisión horizontal\nif <<touching (escenario mascara v)?> or <touching color (#9966ff)?>> then\n    if <[0] > (vx goomba)> then\n        repeat until <not <touching (escenario mascara v)?>>\n            change [posición x goomba v] by (1)\n            set x to ((posición x goomba) - (posición global x))\n        end\n        point in direction (90)\n    end\n    if <(vx goomba) > [0]> then\n        repeat until <not <touching (escenario mascara v)?>>\n            change [posición x goomba v] by (-1)\n            set x to ((posición x goomba) - (posición global x))\n        end\n        point in direction (-90)\n    end\nend\n\nwhen flag clicked\n\nbroadcast (reiniciar v)\n\nwhen I receive [actualizar posición v]\nif <(dentro de la pantalla?) = [si]> then\n    if <(goomba vivo?) = [si]> then\n        if <(direction) = [90]> then\n            set [vx goomba v] to [2]\n        else\n            set [vx goomba v] to [-2]\n        end\n    else\n        set [vx goomba v] to [0]\n    end\n    Movimiento horizontal\n    Movimiento vertical\n    Colisión horizontal consigo mismo\nend\n\nwhen I start as a clone\npoint in direction (-90)\nset rotation style [left-right v]\nset [vx goomba v] to [0]\nset [vy goomba v] to [0]\nset [goomba vivo? v] to [si]\nforever\n    if <(y position) < [-175]> then\n        set [goomba vivo? v] to [no]\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        delete this clone\n    end\n    if <<(Vy) < [-1]> and <touching (mario mascara v)?>> then\n        set [goomba vivo? v] to [no]\n        set [vy v] to [10]\n        start sound [Goomba Stomp Sound  v]\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        change [puntaje v] by (1)\n        delete this clone\n    end\n    if <<<[-2] < (Vy)> and <[9] > (Vy)>> and <touching (mario mascara v)?>> then\n        if <(vidas mario) < [2]> then\n            broadcast (reiniciar v)\n        else\n            change [vidas mario v] by (-1)\n            set [personaje fase v] to [peque]\n        end\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(goomba vivo?) = [si]> then\n        next costume\n        if <(costume [number v]) = [3]> then\n            switch costume to (goomba v)\n        end\n        wait (0.1) seconds\n    else\n        switch costume to (goomba aplastado v)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<((posición x goomba) - (posición global x)) < [235]> and <((posición x goomba) - (posición global x)) > [-235]>> then\n        show\n        set [dentro de la pantalla? v] to [si]\n    else\n        hide\n        set [dentro de la pantalla? v] to [no]\n    end\nend\n\ndefine crear goomba en x: (x) y: (y)\nshow\nset y to (y)\nset [posición x goomba v] to (x)\ncreate clone of (_myself_ v)\nhide\n\ndefine crear goombas\ncrear goomba en x: [300] y: [-115]\ncrear goomba en x: [600] y: [-115]\ncrear goomba en x: [900] y: [-115]\ncrear goomba en x: [1000] y: [-115]\ncrear goomba en x: [1300] y: [-115]\ncrear goomba en x: [1800] y: [-115]\ncrear goomba en x: [2300] y: [-115]\ncrear goomba en x: [2800] y: [-115]\ncrear goomba en x: [3500] y: [-115]\ncrear goomba en x: [4000] y: [-115]\n\nwhen I receive [reiniciar v]\nwait (0) seconds\nhide\nset size to (50) %\ncrear goombas\n\nwhen I receive [reiniciar v]\ndelete this clone\n\ndefine Colisión horizontal consigo mismo\nif <touching color (#9966ff)?> then\n    repeat until <not <touching color (#9966ff)?>>\n        if <(direction) = [90]> then\n            change [posición x goomba v] by (1)\n        else\n            change [posición x goomba v] by (-1)\n        end\n        if <touching color (#874100)?> then\n            if <(direction) = [90]> then\n                change [posición x goomba v] by (5)\n            else\n                change [posición x goomba v] by (-5)\n            end\n        end\n    end\n    set x to ((posición x goomba) - (posición global x))\n    point in direction ((direction) * (-1))\nend\n\n\n\n@particulas\n\nwhen I receive [crear particulas v]\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to x: ((particulas x) + (pick random (-5) to (5))) y: ((particulas y) + (pick random (-5) to (5)))\nset [vx v] to (pick random (-3) to (3))\nset [vy v] to (pick random (10) to (4))\nshow\nrepeat (20)\n    change [vy v] by (-1)\n    change x by (vx)\n    change y by (vy)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen I receive [reiniciar v]\nhide\n\n@bloque i\n\nwhen flag clicked\n\nbroadcast (reiniciar v)\n\nwhen I start as a clone\nset [clon? v] to [si]\nshow\nset size to (201) %\nset [ghost v] effect to (0)\n\ndefine bloque i - Fn(Crear bloque) disfraz: (disfraz) x: (x) y: (y)\nswitch costume to (disfraz)\nset [posición x v] to (((1) * (x)) + (posición global x))\nset y to ((1) * (y))\nchange [index v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(costume [name v]) = [ladrillo]> then\n    forever\n        if <<touching (mario v)?> and <(colisión vertical) > [0]>> then\n            if <(colisión horizontal) = [0]> then\n                if <([sobre la plataforma? v] of [mario mascara v]) = [no]> then\n                    if <[10] > (Vy)> then\n                        if <(personaje fase) = [grande]> then\n                            set [particulas x v] to (x position)\n                            set [particulas y v] to (y position)\n                            start sound [Break v]\n                            broadcast (crear particulas v)\n                            delete this clone\n                        else\n                            repeat (5)\n                                change y by (5)\n                            end\n                            repeat (5)\n                                change y by (-5)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    set x to ((posición x) - (posición global x))\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [interrogación]> then\n    forever\n        if <(costume [name v]) = [interrogación]> then\n            if <<touching (mario v)?> and <(colisión vertical) > [0]>> then\n                if <(colisión horizontal) = [0]> then\n                    if <([sobre la plataforma? v] of [mario mascara v]) = [no]> then\n                        if <[10] > (Vy)> then\n                            switch costume to (interrogación2 v)\n                            set [moneda x v] to (posición x)\n                            set [moneda y v] to (y position)\n                            create clone of (moneda v)\n                            repeat (5)\n                                change y by (5)\n                            end\n                            repeat (5)\n                                change y by (-5)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [reiniciar v]\nhide\nwait (0) seconds\nrecrear bloques interactivos\n\nwhen I receive [reiniciar v]\ndelete this clone\n\nset [ghost v] effect to (50)\nforever\n    show\n    set size to (201) %\n    go to x: ((round ((mouse x) / (33))) * (33)) y: ((round ((mouse y) / (33))) * (33))\n    if <key (c v) pressed?> then\n        switch costume to (eliminar v)\n        wait until <not <key (c v) pressed?>>\n    end\n    if <key (space v) pressed?> then\n        next costume\n        if <<(costume [number v]) = [4]> or <(costume [number v]) = [5]>> then\n            switch costume to (interrogación v)\n        end\n        wait until <not <key (space v) pressed?>>\n    end\n    if <mouse down?> then\n        if <not <(costume [number v]) > [3]>> then\n            add (((1) * (x position)) + (posición global x)) to [bloque i x v]\n            add ((1) * (y position)) to [bloque i y v]\n            add (costume [name v]) to [bloque i disfraz v]\n            bloque i - Fn(Crear bloque) disfraz: (costume [name v]) x: (x position) y: (y position)\n        end\n        wait until <not <mouse down?>>\n    end\n    set [bloque actual v] to (costume [name v])\nend\n\nwhen I start as a clone\nforever\n    if <(bloque actual) = [eliminar]> then\n        if <mouse down?> then\n            if <touching color (#3e3e80)?> then\n                delete (index) of [bloque i x v]\n                delete (index) of [bloque i y v]\n                delete (index) of [bloque i disfraz v]\n                set [bloque i n° de bloque borrado v] to (index)\n                broadcast (re ordenar lista v)\n                delete this clone\n            end\n        end\n    end\nend\n\nwhen I receive [re ordenar lista v]\nif <<(clon?) = [no]> or <(index) > (bloque i N° de bloque borrado)>> then\n    change [index v] by (-1)\nend\n\ndefine recrear bloques interactivos\nset [i v] to [0]\nrepeat (length of [bloque i disfraz v])\n    change [i v] by (1)\n    bloque i - Fn(Crear bloque) disfraz: (item (i) of [bloque i disfraz v]) x: (item (i) of [bloque i x v]) y: (item (i) of [bloque i y v])\nend\nswitch costume to (eliminar v)\n\nwhen I receive [reiniciar v]\nwait (0) seconds\n\nwhen I start as a clone\nif <(costume [name v]) = [interrogación B]> then\n    forever\n        if <(costume [name v]) = [interrogación B]> then\n            if <<touching (mario v)?> and <(colisión vertical) > [0]>> then\n                if <(colisión horizontal) = [0]> then\n                    if <([sobre la plataforma? v] of [mario mascara v]) = [no]> then\n                        if <[10] > (Vy)> then\n                            switch costume to (interrogación2 v)\n                            set [honguito y v] to (y position)\n                            set [honguito x v] to (posición x)\n                            create clone of (honguito v)\n                            repeat (5)\n                                change y by (5)\n                            end\n                            repeat (5)\n                                change y by (-5)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [reiniciar v]\nset [clon? v] to [no]\nset [index v] to [0]\n\n@honguito\n\nwhen I start as a clone\nset [vx honguito v] to [0.5]\nwait (0) seconds\nset size to (200) %\nset y to ((honguito y) + (45))\nset [honguito vivo? v] to [si]\nset [posición x honguito v] to (honguito x)\nset [vy v] to [7]\nforever\n    if <<((posición x honguito) - (posición global x)) < [235]> and <((posición x honguito) - (posición global x)) > [-235]>> then\n        show\n        set [dentro de la pantalla? v] to [si]\n    else\n        hide\n        set [dentro de la pantalla? v] to [no]\n    end\nend\n\ndefine Colisión vertical\nif <<touching (escenario mascara v)?> or <touching (bloque i v)?>> then\n    if <[0] > (vy)> then\n        repeat until <not <<touching (escenario mascara v)?> or <touching (bloque i v)?>>>\n            change y by (1)\n            set [colisión vertical v] to [5]\n        end\n        set [sobre la plataforma? v] to [si]\n        set [vy v] to [0]\n    end\n    if <(vy) > [0]> then\n        repeat until <not <<touching (escenario mascara v)?> or <touching (bloque i v)?>>>\n            change y by (-1)\n            set [colisión vertical v] to [5]\n        end\n        set [vy v] to [0]\n    end\nend\n\ndefine Gravedad\nchange [vy v] by (-1)\n\ndefine Movimiento vertical\nchange y by (vy)\nColisión vertical\nGravedad\n\ndefine Movimiento horizontal\nchange [posición x honguito v] by (vx)\nset x to ((posición x honguito) - (posición global x))\nColisión horizontal\nFricción\n\ndefine Fricción\nset [vx v] to ((vx) * (0.8))\n\ndefine Colisión horizontal\nif <touching (escenario mascara v)?> then\n    if <[0] > (vx)> then\n        repeat until <not <touching (escenario mascara v)?>>\n            change [posición x honguito v] by (1)\n            set x to ((posición x honguito) - (posición global x))\n        end\n        set [vx v] to [0]\n        set [vx honguito v] to [0.5]\n    end\n    if <(vx) > [0]> then\n        repeat until <not <touching (escenario mascara v)?>>\n            change [posición x honguito v] by (-1)\n            set x to ((posición x honguito) - (posición global x))\n        end\n        set [vx v] to [0]\n        set [vx honguito v] to [-0.5]\n    end\nend\n\nwhen I receive [actualizar posición v]\nif <(dentro de la pantalla?) = [si]> then\n    if <(honguito vivo?) = [si]> then\n        change [vx v] by (vx honguito)\n    end\n    Movimiento horizontal\n    Movimiento vertical\nend\n\nwhen I start as a clone\nstart sound [Vine v]\nforever\n    if <touching (mario mascara v)?> then\n        set [personaje fase v] to [grande]\n        set [vidas mario v] to [2]\n        start sound [Mario Bros Efecto de sonido PowerUp v]\n        delete this clone\n    end\nend\n\nwhen I receive [reiniciar v]\nset [personaje fase v] to [peque]\nhide\n\nwhen I receive [reiniciar v]\ndelete this clone\n\n@moneda\n\nwhen I start as a clone\nset size to (175) %\nshow\ngo to x: ((moneda x) - (posición global x)) y: ((moneda y) + (30))\nforever\n    set x to ((moneda x) - (posición global x))\nend\n\nwhen I start as a clone\nrepeat (8)\n    change y by (10)\nend\nrepeat (8)\n    change y by (-10)\nend\ndelete this clone\n\nwhen I start as a clone\nchange [puntaje v] by (1)\nstart sound [moneda v3 v]\nrepeat (16)\n    next costume\nend\n\nwhen I receive [reiniciar v]\nhide\n\n@Puntaje y cronometro\n\nwhen I receive [reiniciar v]\nset [puntaje v] to [0]\nreset timer\nrepeat until <(posición global x) > [4800]>\n    set [cronometro v] to (timer)\nend\n\n@Objeto1\n\nwhen flag clicked\nswitch backdrop to (fondo2 v)\nshow\nset [pixelate v] effect to (0)\nset [ghost v] effect to (0)\ngo to x: (-100) y: (0)\nswitch costume to (mario v)\nset size to (200) %\ncreate clone of (_myself_ v)\ngo to x: (100) y: (0)\nswitch costume to (scratch cat v)\ncreate clone of (_myself_ v)\ngo to [back v] layer\nswitch costume to (disfraz3 v)\nset [pixelate v] effect to (100)\nset [ghost v] effect to (10)\n\nwhen I start as a clone\nforever\n    if <mouse down?> then\n        if <touching (mouse-pointer v)?> then\n            wait until <not <mouse down?>>\n            if <touching (mouse-pointer v)?> then\n                start sound [pop v]\n                set [personaje v] to (costume [name v])\n                broadcast (reiniciar v)\n            end\n        end\n    end\nend\n\nwhen I receive [reiniciar v]\nswitch backdrop to (fondo1 v)\nhide\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (210) %\n        wait until <not <touching (mouse-pointer v)?>>\n        set size to (200) %\n    end\nend\n\n@music\n\nwhen I receive [reiniciar v]\nstart sound [Super Mario Bros - Theme Song v]\n\nwhen I receive [reiniciar v]\nforever\n    if <(posición global x) > [4800]> then\n        set volume to (0) %\n    else\n        set volume to (50) %\n    end\nend\n\nstop all sounds\n\n@Stick\n\nwhen flag clicked\ngo to [front v] layer\nset size to (80) %\nset [ghost v] effect to (80)\nset [range v] to ((size) / (2.5))\nforever\n    switch costume to (base v)\n    go to x: (-174) y: (-118)\n    repeat until <not <mouse down?>>\n        Keyboard Controls\n    end\n    repeat until <mouse down?>\n        Keyboard Controls\n    end\n    if <(distance to [mouse-pointer v]) < (size)> then\n        Stick Activated\n    end\nend\n\ndefine Keyboard Controls\nset [stick x v] to <<key (right arrow v) pressed?> or <key (d v) pressed?>>\nchange [stick x v] by ((0) - <<key (left arrow v) pressed?> or <key (a v) pressed?>>)\nset [stick y v] to <<key (up arrow v) pressed?> or <key (w v) pressed?>>\nchange [stick y v] by ((0) - <<key (down arrow v) pressed?> or <key (s v) pressed?>>)\nif <key (space v) pressed?> then\n    change [stick button v] by (1)\nelse\n    set [stick button v] to [0]\nend\n\ndefine Stick Activated\ngo to (mouse-pointer v)\nswitch costume to (ready v)\ncreate clone of (_myself_ v)\nswitch costume to (stick v)\ncreate clone of (_myself_ v)\nswitch costume to (base active v)\nset [stick button v] to []\nrepeat until <(distance to [mouse-pointer v]) > ((size) * (1.5))>\n    Detect Stick Movement\n    Detect Stick Button\nend\nbroadcast (Deactivate Stick v)\n\ndefine Detect Stick Movement\nset [stick x v] to (((mouse x) - (x position)) / (range))\nset [stick y v] to (((mouse y) - (y position)) / (range))\nif <([abs v] of (STICK X) ) > [1]> then\n    set [stick x v] to ((STICK X) / ([abs v] of (STICK X) ))\nend\nif <([abs v] of (STICK Y) ) > [1]> then\n    set [stick y v] to ((STICK Y) / ([abs v] of (STICK Y) ))\nend\n\ndefine Detect Stick Button\nif <mouse down?> then\n    if <(STICK BUTTON) > []> then\n        change [stick button v] by (1)\n    end\nelse\n    set [stick button v] to [0]\nend\n\nwhen I receive [deactivate stick v]\ndelete this clone\n\nwhen I start as a clone\nif <(costume [name v]) = [Stick]> then\n    go [forward v] (1) layers\n    set [ghost v] effect to (0)\n    forever\n        go to (stick v)\n        change x by ((STICK X) * (range))\n        change y by ((STICK Y) * (range))\n    end\nend\ngo to x: (174) y: (-118)\nwait until <not <mouse down?>>\nswitch costume to (base active v)\nforever\n    if <mouse down?> then\n        set [ghost v] effect to (25)\n    else\n        set [ghost v] effect to (75)\n    end\nend\n\n
teclas/keys:\na w d c "space/espacio" flechas/arrows