Unlock || A Mobile Friendly Platformer #Games
@Stage\n\nwhen flag clicked\nbroadcast (Restart v)\n\nwhen flag clicked\nbroadcast (Start v)\n\n@Blank\n\n@player\n\ndefine Player Script\ngo to x: (-206) y: (-95)\nshow\ngo [forward v] (1) layers\nset [level v] to [1]\nset [dead v] to [0]\nset size to (16) %\nforever\n    go to [front v] layer\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        switch costume to (3 v)\n        change [xv v] by (.8)\n    end\n    if <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> and <(dead) = [0]>> then\n        switch costume to (4 v)\n        change [xv v] by (-0.8)\n    end\n    set [xv v] to ((Xv) * (.9))\n    if <<key (up arrow v) pressed?> and <key (right arrow v) pressed?>> then\n        switch costume to (1 v)\n    end\n    if <<key (up arrow v) pressed?> and <key (left arrow v) pressed?>> then\n        switch costume to (2 v)\n    end\n    if <not <key (any v) pressed?>> then\n        switch costume to (5 v)\n    end\n    change x by (Xv)\n    if <<touching (platform v)?> or <touching (locked v)?>> then\n        change y by (2)\n        if <<touching (platform v)?> or <touching (locked v)?>> then\n            change y by (2)\n            if <<touching (platform v)?> or <touching (locked v)?>> then\n                change y by (2)\n                if <<touching (platform v)?> or <touching (locked v)?>> then\n                    change y by (2)\n                    if <<touching (platform v)?> or <touching (locked v)?>> then\n                        change y by (2)\n                        if <<touching (platform v)?> or <touching (locked v)?>> then\n                            change x by ((Xv) * (-2))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (10))>>>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [13]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-0.8)\n    change y by (Yv)\n    if <<touching (platform v)?> or <touching (locked v)?>> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching (platform v)?> or <touching (locked v)?>> then\n        if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>> then\n            set [yv v] to [11]\n        end\n    end\n    change y by (1)\n    if <<touching (spike v)?> or <<touching (saws v)?> or <<touching (lava v)?> or <touching (enemies v)?>>>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        wait (.1) seconds\n        broadcast (Restart v)\n    end\n    if <(y position) < [-180]> then\n        broadcast (Restart v)\n    end\n    if <<touching (tramps v)?> or <touching (tramps2 v)?>> then\n        set [yv v] to [15]\n    end\n    if <touching (water v)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [yv v] to [5]\n        end\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            set [yv v] to [-5]\n        end\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <[230] < (x position)> then\n        broadcast (Restart v)\n        change [level v] by (1)\n        Setup\n    end\nend\n\ndefine Setup\nclear graphic effects\npoint in direction (90)\ngo to x: (-220) y: (-16)\nswitch costume to (1 v)\nset [dead v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\nset size to (16) %\nshow\n\nwhen I receive [end v]\nforever\n    hide\nend\n\nwhen I receive [restart v]\ngo to x: (-212) y: (-81)\nset [ghost v] effect to (0)\n\nwhen I receive [1 v]\nhide\nwait (1.2) seconds\nshow\ngo to x: (-206) y: (-95)\n\nwhen I receive [start v]\nPlayer Script\n\nwhen flag clicked\nhide\n\n@Enemies\n\nwhen I receive [restart v]\ndelete this clone\n\ndefine Clone (x) (y)\ngo to x: (x) y: (y)\nset rotation style [all around v]\nswitch costume to (costume1 v)\nset [ghost v] effect to (100)\nshow\npoint in direction (90)\nrepeat (10)\n    change [ghost v] effect by (-10)\n    turn right (5) degrees\nend\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume1 v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    turn right (5) degrees\nend\nhide\n\nwhen I receive [create clone v]\nhide\nClone Create\n\nwhen I start as a clone\nshow\nif <(costume [number v]) = [2]> then\n    set rotation style [left-right v]\n    clear graphic effects\n    set size to (16) %\n    show\n    go [forward v] (11) layers\n    set [enemyx v] to [0]\n    set [enemyy v] to [0]\n    forever\n        change [enemyy v] by (-1)\n        if <([x position v] of [player v]) < ((x position) - (10))> then\n            change [enemyx v] by (-0.4)\n            point in direction (-90)\n        end\n        if <((x position) - (-10)) < ([x position v] of [player v])> then\n            change [enemyx v] by (0.4)\n            point in direction (90)\n        end\n        set [enemyx v] to ((Enemyx) * (0.9))\n        change x by (Enemyx)\n        if <<touching (platform v)?> or <touching (locked v)?>> then\n            change y by (1)\n        end\n        if <<touching (platform v)?> or <touching (locked v)?>> then\n            change y by (1)\n        end\n        if <<touching (platform v)?> or <touching (locked v)?>> then\n            change y by (1)\n        end\n        if <<touching (platform v)?> or <touching (locked v)?>> then\n            change y by (1)\n        end\n        if <<touching (platform v)?> or <touching (locked v)?>> then\n            change y by (-4)\n            change x by ((Enemyx) * (-1))\n        end\n        change y by (Enemyy)\n        if <<touching (platform v)?> or <touching (locked v)?>> then\n            change y by ((Enemyy) - ((Enemyy) * (2)))\n            set [enemyy v] to [0]\n        end\n        change y by (-1)\n        if <<<((y position) - (-120)) < ([x position v] of [player v])> and <touching (platform v)?>> or <<((y position) - (-120)) < ([x position v] of [player v])> and <touching (locked v)?>>> then\n            set [enemyy v] to [14]\n        end\n        change y by (1)\n        switch costume to (costume3 v)\n        create clone of (_myself_ v)\n        switch costume to (costume2 v)\n        if <touching (player v)?> then\n            broadcast (Restart v)\n            broadcast (Create Clone v)\n        end\n        if <touching (lava v)?> then\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            hide\n        end\n        if <touching (water v)?> then\n            repeat (20)\n                change [ghost v] effect by (5)\n            end\n            hide\n        end\n    end\nelse\n    show\n    clear graphic effects\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nset [amount v] to [1]\nset [speed v] to [2]\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    if <touching (tramps v)?> then\n        set [enemyy v] to [16]\n    end\nend\n\ndefine Clone Create\nif  then\n    delete this clone\nend\nif <(Level) = [4]> then\n    Clone [-200] [241]\nend\nif <(Level) = [6]> then\n    Clone [-120] [70]\nend\nif <(Level) = [10]> then\n    Clone [-160] [200]\n    Clone [-200] [200]\n    Clone [-180] [200]\n    Clone [-160] [200]\n    Clone [0] [50]\n    Clone [20] [200]\n    Clone [80] [80]\n    Clone [140] [180]\nend\n\nwhen flag clicked\nforever\n    if  then\n        delete this clone\n    end\n    if <(Level) = [4]> then\n        broadcast (Create Clone v)\n        \n    end\nend\n\nwhen I receive [restart v]\nbroadcast (Create Clone v)\n\n@Tramps\n\nwhen I receive [start v]\nhide\ngo to [front v] layer\nswitch costume to (costume1 v)\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [end v]\nhide\n\nwhen I receive [start v]\nforever\n    if <touching (player v)?> then\n        switch costume to (costume1 v)\n        repeat (6)\n            wait (.05) seconds\n            next costume\n        end\n    end\n    if <(Level) = [1]> then\n        hide\n    end\n    if <(Level) = [2]> then\n        show\n        go to x: (187) y: (-20)\n    end\n    if <(Level) = [3]> then\n        hide\n    end\n    if <(Level) = [4]> then\n        hide\n    end\n    if <(Level) = [5]> then\n        show\n        go to x: (-110) y: (-22)\n    end\n    if <(Level) = [6]> then\n        show\n        go to x: (140) y: (-22)\n    end\n    if <(Level) = [7]> then\n        show\n        go to x: (-70) y: (-22)\n    end\n    if <(Level) = [8]> then\n        hide\n    end\n    if <(Level) = [9]> then\n        hide\n    end\n    if <(Level) = [10]> then\n        hide\n    end\n    if <(Level) = [11]> then\n        hide\n    end\n    if <(Level) = [12]> then\n        hide\n    end\n    if <(Level) = [13]> then\n        hide\n    end\n    if <(Level) = [14]> then\n        hide\n    end\nend\n\n@Saws\n\nwhen I receive [start v]\ngo to [back v] layer\nhide\nswitch costume to (1 v)\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [1]> then\n        hide\n    end\n    if <(Level) = [2]> then\n        hide\n    end\n    if <(Level) = [3]> then\n        show\n        go to x: (160) y: (-125)\n    end\n    if <(Level) = [4]> then\n        hide\n    end\n    if <(Level) = [5]> then\n        hide\n    end\n    if <(Level) = [6]> then\n        show\n        go to x: (-150) y: (40)\n    end\n    if <(Level) = [7]> then\n        hide\n    end\n    if <(Level) = [8]> then\n        show\n        go to x: (20) y: (-110)\n    end\n    if <(Level) = [9]> then\n        show\n        go to x: (-50) y: (0)\n        glide (1.5) secs to x: (200) y: (0)\n        glide (1.5) secs to x: (-50) y: (0)\n    end\n    if <(Level) = [10]> then\n        hide\n    end\n    if <(Level) = [11]> then\n        hide\n    end\n    if <(Level) = [12]> then\n        hide\n    end\nend\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\nforever\n    turn right (10) degrees\nend\n\nwhen flag clicked\nforever\n    if <not <<(Level) = [3]> or <<(Level) = [6]> or <<(Level) = [8]> or <(Level) = [9]>>>>> then\n        hide\n    end\nend\n\n@platform\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nshow\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\nhide\n\n@spike\n\nwhen I receive [start v]\ngo to [back v] layer\nshow\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Water\n\nwhen flag clicked\nforever\n    go [backward v] (3) layers\nend\n\nwhen flag clicked\nshow\nforever\n    switch costume to (Level)\nend\n\n@scenery\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to [back v] layer\nshow\nforever\n    switch costume to (Level)\n    go [backward v] (4) layers\nend\n\n@Key\n\nwhen flag clicked\nhide\nset [ghost v] effect to (0)\n\nwhen flag clicked\nset [m v] to [0]\nwait (8) seconds\nbroadcast (Restart v)\n\nwhen I receive [restart v]\nset [ghost v] effect to (0)\nif <(Level) = [1]> then\n    show\n    go to x: (0) y: (20)\n    point in direction (90)\nend\nif <(Level) = [2]> then\n    show\n    go to x: (-170) y: (150)\n    point in direction (90)\nend\nif <(Level) = [3]> then\n    show\n    go to x: (-100) y: (20)\n    point in direction (90)\nend\nif <(Level) = [4]> then\n    show\n    go to x: (-100) y: (-40)\n    point in direction (90)\nend\nif <(Level) = [5]> then\n    show\n    go to x: (145) y: (-25)\n    point in direction (0)\nend\nif <(Level) = [6]> then\n    show\n    point in direction (90)\n    go to x: (-200) y: (160)\nend\nif <(Level) = [7]> then\n    show\n    point in direction (90)\n    go to x: (160) y: (-40)\nend\nif <(Level) = [8]> then\n    show\n    point in direction (90)\n    go to x: (0) y: (70)\nend\nif <(Level) = [9]> then\n    show\n    point in direction (90)\n    go to x: (-20) y: (-130)\nend\nif <(Level) = [10]> then\n    show\n    point in direction (90)\n    go to x: (5-) y: (-30)\nend\nif <(Level) = [11]> then\n    hide\nend\n\nwhen I receive [start v]\nset [m v] to [1]\nforever\n    if <touching (player v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        broadcast (Moving Platformer v)\n        wait (1) seconds\n        hide\n    end\nend\n\n@Lava\n\nwhen flag clicked\ngo [backward v] (3) layers\ngo to x: (0) y: (0)\nshow\nforever\n    switch costume to (Level)\n    set y to (([sin v] of ((timer) * (100)) ) * (5))\nend\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Locked\n\nwhen I receive [moving platformer v]\nbroadcast (Moving platform. v)\n\nwhen I receive [restart v]\ngo to [back v] layer\nif <(Level) = [1]> then\n    switch costume to (costume1 v)\n    go to x: (0) y: (-200)\n    show\nend\nif <(Level) = [2]> then\n    switch costume to (costume1 v)\n    go to x: (0) y: (-200)\nend\nif <(Level) = [3]> then\n    switch costume to (costume3 v)\n    go to x: (0) y: (-200)\nend\nif <(Level) = [4]> then\n    go to x: (0) y: (100)\n    switch costume to (costume2 v)\nend\nif <(Level) = [5]> then\n    switch costume to (costume4 v)\n    show\n    go to x: (200) y: (100)\nend\nif <(Level) = [6]> then\n    switch costume to (costume4 v)\n    show\n    go to x: (200) y: (100)\nend\nif <(Level) = [7]> then\n    switch costume to (costume4 v)\n    show\n    go to x: (200) y: (100)\nend\nif <(Level) = [8]> then\n    show\n    go to x: (200) y: (100)\n    switch costume to (costume4 v)\nend\nif <(Level) = [9]> then\n    show\n    go to x: (200) y: (100)\n    switch costume to (costume5 v)\nend\nif <(Level) = [10]> then\n    show\n    go to x: (-180) y: (300)\n    switch costume to (costume2 v)\nend\nif <(Level) = [11]> then\n    hide\nend\n\nwhen I receive [moving platform. v]\nif <(Level) = [1]> then\n    glide (1) secs to x: (0) y: (100)\nend\nif <(Level) = [2]> then\n    switch costume to (costume1 v)\n    glide (.8) secs to x: (0) y: (80)\nend\nif <(Level) = [3]> then\n    switch costume to (costume3 v)\n    glide (.8) secs to x: (0) y: (80)\nend\nif <(Level) = [4]> then\n    switch costume to (costume2 v)\n    glide (.8) secs to x: (-200) y: (100)\nend\nif <(Level) = [5]> then\n    switch costume to (costume4 v)\n    glide (.8) secs to x: (200) y: (240)\nend\nif <(Level) = [6]> then\n    switch costume to (costume4 v)\n    glide (1.5) secs to x: (200) y: (400)\nend\nif <(Level) = [7]> then\n    switch costume to (costume4 v)\n    glide (1.5) secs to x: (200) y: (400)\nend\nif <(Level) = [8]> then\n    switch costume to (costume4 v)\n    glide (1.5) secs to x: (200) y: (400)\nend\nif <(Level) = [9]> then\n    switch costume to (costume5 v)\n    glide (1.5) secs to x: (200) y: (400)\nend\nif <(Level) = [10]> then\n    switch costume to (costume2 v)\n    glide (1.5) secs to x: (-250) y: (300)\nend\n\nwhen flag clicked\nbroadcast (Restart v)\nforever\n    if <(Level) = [10]> then\n        repeat (2)\n            broadcast (Restart v)\n        end\n        wait until <(Level) = [100]>\n    end\nend\n\n@...\n\nwhen flag clicked\nhide\nwait (.01) seconds\ngo to x: (0) y: (0)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [11]> then\n        hide\n    end\nend\n\nwhen this sprite clicked\nbroadcast (1 v)\nwait (.1) seconds\nchange [level v] by (1)\nwait (.1) seconds\nbroadcast (Restart v)\n\nwhen I receive [end v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nshow\n\nwhen flag clicked\nswitch costume to (costume2 v)\n\n@1\n\nwhen flag clicked\nset size to (0) %\nhide\n\nwhen I receive [1 v]\nshow\ngo [forward v] (2) layers\nwait (.2) seconds\nrepeat (10)\n    change size by (10)\nend\nrepeat (10)\n    change size by (-10)\nend\nhide\n\n@Tramps2\n\nwhen I receive [start v]\nhide\ngo to [front v] layer\nswitch costume to (costume1 v)\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [end v]\nhide\n\nwhen I receive [start v]\nforever\n    if <touching (player v)?> then\n        switch costume to (costume1 v)\n        repeat (6)\n            wait (.05) seconds\n            next costume\n        end\n    end\n    if <(Level) = [1]> then\n        hide\n    end\n    if <(Level) = [2]> then\n        hide\n    end\n    if <(Level) = [3]> then\n        hide\n    end\n    if <(Level) = [4]> then\n        hide\n    end\n    if <(Level) = [5]> then\n        hide\n    end\n    if <(Level) = [6]> then\n        hide\n    end\n    if <(Level) = [7]> then\n        show\n        go to x: (-186) y: (117)\n    end\n    if <(Level) = [8]> then\n        hide\n    end\n    if <(Level) = [9]> then\n        show\n        go to x: (-100) y: (29)\n    end\n    if <(Level) = [10]> then\n        hide\n    end\n    if <(Level) = [11]> then\n        hide\n    end\n    if <(Level) = [12]> then\n        hide\n    end\n    if <(Level) = [13]> then\n        hide\n    end\n    if <(Level) = [14]> then\n        hide\n    end\nend\n\n@Words\n\nwhen I receive [start v]\ngo [forward v] (5) layers\nshow\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nforever\n    if <<touching (player v)?> and <not <(Level) = [11]>>> then\n        set [brightness v] effect to (90)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\n@TB\n\nwhen flag clicked\nhide\n\n@Audio\n\nwhen this sprite clicked\nif <(volume) = [50]> then\n    switch costume to ((costume [number v]) + (1))\n    set volume to (0) %\nelse\n    switch costume to ((costume [number v]) - (1))\n    set volume to (50) %\nend\n\nwhen flag clicked\nswitch costume to (play v)\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (20)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nset volume to (50) %\nforever\n    play sound [TheFatRat - Prelude \(Jackpot EP Track 3\) v] until done\nend\n\nwhen I receive [end v]\nhide\n\nwhen I receive [start v]\nshow\n\nwhen flag clicked\nforever\n    if <(Level) = [15]> then\n        hide\n    end\nend\n\nset [color v] effect to (0)\n\n
Use the Arrow key WASD or mobile controls.\n\nGo to the key and unlock the door. Dont fall into lava. Avoid spikes and saws and other dangers like enimies!\n\nLevels are hard comment if you did not skip 