Take a risk / A platformer (Mobile friendly)
@Stage\n\nwhen I receive [start v]\nforever\n    start sound [Take a risk / A platformer \(Music\) v]\n    wait (14.34) seconds\nend\n\nwhen I receive [fin v]\nstop [other scripts in sprite v]\nstop all sounds\n\n@Historia\n\nwhen flag clicked\nshow variable [subtítulos v]\nset [subtítulos v] to []\ngo to x: (0) y: (0)\nshow\nswitch costume to (disfraz1 v)\nclear graphic effects\nset [brightness v] effect to (-100)\nrepeat (50)\n    change [brightness v] effect by (2)\nend\nrepeat (2)\n    wait (0.2) seconds\n    next costume\n    wait (0.2) seconds\n    start sound [Paso v]\n    next costume\nend\nwait (0.4) seconds\nset [subtítulos v] to (translate [¡Ho! hay una casa, voy a entrar] to ((language::translate) v)::translate)\nstart sound [¡Ho! hay una casa, voy a entrar v]\nswitch costume to (disfraz8 v)\nwait (0.1) seconds\nswitch costume to (disfraz5 v)\nwait (0.5) seconds\nrepeat (4)\n    switch costume to (disfraz8 v)\n    wait (0.1) seconds\n    switch costume to (disfraz5 v)\n    wait (0.1) seconds\nend\nwait (0.1) seconds\nrepeat (3)\n    switch costume to (disfraz8 v)\n    wait (0.1) seconds\n    switch costume to (disfraz5 v)\n    wait (0.1) seconds\nend\nwait (0.4) seconds\nswitch costume to (disfraz9 v)\nwait (0.4) seconds\nstart sound [Abriendo una puerta v]\nrepeat (9)\n    next costume\nend\nwait (0.7) seconds\nset [subtítulos v] to (translate [Voy a pasar] to ((language::translate) v)::translate)\nplay sound [Voy a pasar v] until done\nrepeat (3)\n    wait (0.1) seconds\n    next costume\nend\nwait (0.1) seconds\nset [subtítulos v] to (translate [¡Aaaaah!] to ((language::translate) v)::translate)\nstart sound [¡Aaaah! v]\nswitch costume to (disfraz23 v)\nrepeat (7)\n    wait (0.2.0) seconds\n    next costume\nend\nwait (0.4) seconds\nset [subtítulos v] to (translate [Parece que había un agujero...] to ((language::translate) v)::translate)\nstart sound [Parece que había un agujero... v]\nrepeat (7)\n    switch costume to (disfraz32 v)\n    wait (0.1) seconds\n    switch costume to (disfraz31 v)\n    wait (0.1) seconds\nend\nwait (0.5) seconds\nset [subtítulos v] to (translate [Aquí hay un botón] to ((language::translate) v)::translate)\nstart sound [Aquí hay un botón v]\nrepeat (2)\n    switch costume to (disfraz32 v)\n    wait (0.1) seconds\n    switch costume to (disfraz31 v)\n    wait (0.1) seconds\nend\nwait (0.1) seconds\nrepeat (4)\n    switch costume to (disfraz32 v)\n    wait (0.1) seconds\n    switch costume to (disfraz31 v)\n    wait (0.1) seconds\nend\nwait (0.3) seconds\nstart sound [Paso v]\nswitch costume to (disfraz33 v)\nwait (0.3) seconds\nnext costume\nwait (0.1) seconds\nstart sound [Pop v]\nwait (0.3) seconds\nnext costume\nplay sound [Zoop v] until done\nwait (0.2) seconds\nnext costume\nwait (0.4) seconds\nset [subtítulos v] to (translate [Ya que hay luz voy a tratar de escapar] to ((language::translate) v)::translate)\nstart sound [Ya que hay luz voy a tratar de escapar v]\nrepeat (10)\n    switch costume to (disfraz37 v)\n    wait (0.1) seconds\n    switch costume to (disfraz36 v)\n    wait (0.1) seconds\nend\nwait (0.5) seconds\nstop [other scripts in sprite v]\nbroadcast (Start v)\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\nwhen flag clicked\nwait (0.1) seconds\nwait until <<mouse down?> or <key (q v) pressed?>>\nstop [other scripts in sprite v]\nbroadcast (Start v)\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\nwhen I receive [start v]\nstop all sounds\n\n@Player\n\nwhen flag clicked\nforever\n    if <<<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> and <<touching (player v)?> or <touching (piso v)?>>> then\n        repeat (10)\n            change y by (8)\n            if <<touching (player v)?> or <touching (piso v)?>> then\n                change y by (-8)\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\nshow\nwait (0.3) seconds\nforever\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > [30]>>> then\n        point in direction (90)\n        change x by (5)\n    end\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < [-10]>>> then\n        point in direction (-90)\n        change x by (-5)\n    end\n    if <<touching (piso v)?> or <touching (player v)?>> then\n        change y by (1)\n        if <<touching (piso v)?> or <touching (player v)?>> then\n            change y by (1)\n            if <<touching (piso v)?> or <touching (player v)?>> then\n                change y by (1)\n                if <<touching (piso v)?> or <touching (player v)?>> then\n                    change y by (1)\n                    if <<touching (piso v)?> or <touching (player v)?>> then\n                        change y by (1)\n                        if <<touching (piso v)?> or <touching (player v)?>> then\n                            change y by (1)\n                            if <<touching (piso v)?> or <touching (player v)?>> then\n                                change y by (1)\n                                if <<touching (piso v)?> or <touching (player v)?>> then\n                                    change y by (1)\n                                    if <<touching (piso v)?> or <touching (player v)?>> then\n                                        change y by (1)\n                                        if <(letter (1) of (direction)) = [-]> then\n                                            change x by (5.1)\n                                        else\n                                            change x by (-5.1)\n                                        end\n                                        if <<touching (piso v)?> or <touching (player v)?>> then\n                                            change y by (1)\n                                            if <(letter (1) of (direction)) = [-]> then\n                                                change x by (5.1)\n                                            else\n                                                change x by (-5.1)\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    else\n        cae\n        if <not <<touching (piso v)?> or <touching (player v)?>>> then\n            set [gravedad v] to [-3]\n            repeat until <<touching (piso v)?> or <touching (player v)?>>\n                cae2\n                change [gravedad v] by (-0.1)\n                if <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > [10]>>> then\n                    point in direction (90)\n                    change x by (5)\n                end\n                if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < [-10]>>> then\n                    point in direction (-90)\n                    change x by (-5)\n                end\n            end\n            set [gravedad v] to [0]\n        end\n    end\nend\n\nwhen flag clicked\nset rotation style [left-right v]\npoint in direction (90)\ngo to x: (-185) y: (-90)\nhide\n\ndefine cae\nchange y by (-1)\n\ndefine cae2\nchange y by (gravedad)\n\nwhen flag clicked\nforever\n    if <<key (right arrow v) pressed?> or <<<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) > [0]>>> or <<mouse down?> and <(mouse x) < [0]>>>> then\n        switch costume to (disfraz4 v)\n        wait (0.1) seconds\n        switch costume to (disfraz2 v)\n        wait (0.1) seconds\n        switch costume to (disfraz1 v)\n        wait (0.1) seconds\n        switch costume to (disfraz2 v)\n        wait (0.1) seconds\n    end\n    if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n        switch costume to (disfraz4 v)\n        wait (0.1) seconds\n        switch costume to (disfraz3 v)\n        wait (0.1) seconds\n        switch costume to (disfraz5 v)\n        wait (0.1) seconds\n        switch costume to (disfraz3 v)\n        wait (0.1) seconds\n        switch costume to (disfraz4 v)\n        wait (0.1) seconds\n    end\n    if <not <<key (down arrow v) pressed?> or <<key (up arrow v) pressed?> or <<key (right arrow v) pressed?> or <<key (left arrow v) pressed?> or <<<(mouse y) > (y position)> and <mouse down?>> or <<<mouse down?> and <(mouse x) > [0]>> or <<mouse down?> and <(mouse x) < [0]>>>>>>>>> then\n        switch costume to (disfraz4 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (pinches v)?> or <<touching (lava v)?> or <touching (bola con pinches v)?>>> then\n        create clone of (_myself_ v)\n        wait (0.1) seconds\n        point in direction (90)\n        go to x: (-185) y: (-90)\n    end\nend\n\nwhen I start as a clone\nif <<(Nivel) = [4]> or <<(Nivel) = [5]> and <<(distance to [lava v]) < [110]> and <not <<touching color (#ffffff)?> and <touching (bola con pinches v)?>>>>>> then\n    if <(Nivel) = [4]> then\n        switch costume to (disfraz7 v)\n        set rotation style [all around v]\n        point in direction (90)\n        set [ghost v] effect to (20)\n        start sound [muerte v]\n        repeat until <(direction) > [160]>\n            turn right (9) degrees\n        end\n        repeat until <touching (_edge_ v)?>\n            change [ghost v] effect by (-0.4)\n            change y by (-0.4)\n        end\n        delete this clone\n    end\n    if <<(Nivel) = [5]> and <(distance to [lava v]) < [200]>> then\n        start sound [muerte v]\n        set rotation style [all around v]\n        switch costume to (disfraz7 v)\n        repeat (10)\n            turn right (9) degrees\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    end\nelse\n    switch costume to (disfraz7 v)\n    set rotation style [all around v]\n    point in direction (90)\n    set [ghost v] effect to (20)\n    start sound [muerte v]\n    repeat until <(direction) > [160]>\n        turn right (9) degrees\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (sensor de siguiente nivel v)?> then\n        change [nivel v] by (1)\n        broadcast (Siguiente nivel v)\n        point in direction (90)\n        go to x: (-185) y: (-90)\n    end\nend\n\nwhen I receive [siguiente nivel v]\ndelete this clone\n\nwhen flag clicked\nforever\n    if <touching (gotitas de lava v)?> then\n        create clone of (_myself_ v)\n        wait (0.1) seconds\n        point in direction (90)\n        go to x: (-185) y: (-90)\n    end\nend\n\nwhen flag clicked\nwait (0.1) seconds\nwait until <(Nivel) = [7]>\nstop [other scripts in sprite v]\nstop [this script v]\n\n@Piso\n\nwhen I receive [start v]\nshow\n\nwhen flag clicked\nset [nivel v] to [1]\nhide\nforever\n    switch costume to (Nivel)\nend\n\n@Omitir\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nclear graphic effects\nwait (2) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\n\nwhen I receive [start v]\nhide variable [subtítulos v]\nhide\n\nwhen flag clicked\nforever\n    if <(language::translate) = [español]> then\n        switch costume to (disfraz1 v)\n    else\n        switch costume to (disfraz2 v)\n    end\nend\n\n@Nivel\n\nwhen flag clicked\nhide\nforever\n    switch costume to (Nivel)\nend\n\nwhen I receive [start v]\nshow\n\n@Pinches\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\nshow\nforever\n    switch costume to (Nivel)\nend\n\n@Sensor de siguiente nivel\n\nwhen flag clicked\nshow\nset [ghost v] effect to (5464565654646456754e654654645645645654)\n\nwhen flag clicked\nwait (0.1) seconds\nwait until <(Nivel) = [7]>\nhide\n\n@Explicación\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [start v]\nshow\nforever\n    if <(language::translate) = [español]> then\n        switch costume to (disfraz1 v)\n    else\n        switch costume to (disfraz2 v)\n    end\nend\n\nwhen I receive [start v]\nshow\nforever\n    if <(Nivel) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\n@Volcán\n\nwhen I receive [start v]\nshow\nforever\n    switch costume to (Nivel)\nend\n\nwhen flag clicked\ngo to x: (117) y: (-114)\nhide\n\n@Gotitas de lava\n\nwhen flag clicked\nhide\nwait (0.1) seconds\nforever\n    if <(Nivel) = [3]> then\n        create clone of (_myself_ v)\n        wait (0.1) seconds\n    end\nend\n\nwhen I start as a clone\ngo to x: ([x position v] of [volcán v]) y: (([y position v] of [volcán v]) + (40))\nshow\npoint in direction (pick random (-45) to (45))\nrepeat until <<not <(Nivel) = [3]>> or <<touching (piso v)?> or <<touching (_edge_ v)?> or <touching (player v)?>>>>\n    move (10) steps\n    if <(letter (1) of (direction)) = [-]> then\n        turn left (7) degrees\n    else\n        turn right (7) degrees\n    end\nend\nwait (0.2) seconds\ndelete this clone\n\n@Lava\n\nwhen flag clicked\nswitch costume to (disfraz1 v)\nforever\n    if <(Nivel) = [6]> then\n        switch costume to (disfraz1 v)\n        wait (1) seconds\n        switch costume to (disfraz2 v)\n        wait (1) seconds\n    else\n        switch costume to (disfraz3 v)\n        wait (1) seconds\n        switch costume to (disfraz4 v)\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    clear graphic effects\n    wait (1) seconds\n    repeat (20)\n        change [brightness v] effect by (2)\n    end\n    repeat (20)\n        change [brightness v] effect by (-2)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(Nivel) = [4]> or <<(Nivel) = [5]> or <(Nivel) = [6]>>> then\n        show\n    else\n        hide\n    end\nend\n\n@Bola con pinches\n\nwhen flag clicked\nforever\n    if <(Nivel) = [5]> then\n        glide (1) secs to x: (-98) y: (18)\n        point in direction (135)\n        glide (1) secs to x: (98) y: (18)\n        point in direction (60)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Nivel) = [5]> then\n        show\n    else\n        go to x: (0) y: (20)\n        point in direction (90)\n        hide\n    end\nend\n\n@Cadena\n\nwhen flag clicked\nset pen color to (#8c8c8c)\nset pen size to (10)\ngo to x: (0) y: (169)\nset [ghost v] effect to (534532453443534543534534)\nforever\n    if <(Nivel) = [5]> then\n        show\n        erase all\n        pen down\n        go to (bola con pinches v)\n        pen down\n        go to x: (0) y: (169)\n    else\n        hide\n        erase all\n    end\nend\n\n@Objeto1\n\nwhen flag clicked\nswitch costume to (disfraz1 v)\nhide\nwait (0.1) seconds\nwait until <(Nivel) = [7]>\nbroadcast (fin v)\nset [subtítulos v] to []\nshow variable [subtítulos v]\nshow\nswitch costume to (disfraz1 v)\nrepeat (4)\n    wait (0.4) seconds\n    start sound [Paso v]\n    next costume\nend\nwait (0.4) seconds\nswitch costume to (disfraz6 v)\nwait (0.3) seconds\nset [subtítulos v] to (translate [Gracias por ayudarme a escapar] to ((language::translate) v)::translate)\nstart sound [Gracias por ayudarme a escapar v]\nrepeat (2)\n    switch costume to (disfraz7 v)\n    wait (0.1) seconds\n    switch costume to (disfraz6 v)\n    wait (0.1) seconds\nend\nwait (0.1) seconds\nrepeat (7)\n    switch costume to (disfraz7 v)\n    wait (0.1) seconds\n    switch costume to (disfraz6 v)\n    wait (0.1) seconds\nend\nwait (2) seconds\nstop [all v]\n\n@Objeto2\n\nwhen flag clicked\nset [ghost v] effect to (99999999)\n\n