Block || A Mobile Platformer [Contest Entry]

Instructions: ✿ Hello Everyone! ✿ \nI present you my game 'Block || A Mobile Platformer' [so basically you are a block and you have to escape xD]\n\nIf this gets on trending and top loved than I'll make part 2! So stay tuned! :D\n\nControls and Features:\n1. Arrow keys to move\n2. Use the 3 dots according to your own convenience\n3. This is mobile compatible :D\n\nThanks for playing this game! :D

@Stage\n\ndefine Camera shake (amount) (falloff)\nset [sa v] to (amount)\nrepeat until <(round (sa)) < [1]>\n    set [sx v] to ((pick random (1) to (-1)) * (sa))\n    set [sy v] to ((pick random (1) to (-1)) * (sa))\n    set [sa v] to ((sa) * (falloff))\nend\nset [sa v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\n\nwhen I receive [death v]\nCamera shake [10] [.9]\n\nwhen flag clicked\nset [sx v] to [0]\nset [sy v] to [0]\nset [sa v] to [0]\n\nwhen flag clicked\nforever\n    wait (9) seconds\n    play sound [Unlimited - Xaf v] until done\nend\n\n@Blank\n\n@player\n\nwhen flag clicked\nset [level v] to [1]\nhide\n\ndefine Reset\ngo to x: (-183) y: (0)\nset [x vel v] to [0]\nset [y vel v] to [0]\nshow\n\nwhen I receive [redo v]\nReset\n\nwhen I receive [skip v]\nchange [level v] by (1)\nReset\n\nwhen I receive [start v]\nhide\nReset\nshow\n\ndefine platform physics (jump height) (gravity) (friction) (movement speed) (wall jump vm) (wall jump hm)\nchange y by (y vel)\nif <touching (ground v)?> then\n    repeat ([abs v] of (y vel) )\n        if <touching (ground v)?> then\n            change y by ((-1) * (([abs v] of (y vel) ) / (y vel)))\n        end\n    end\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> and <not <(y vel) > [0]>>> then\n        set [y vel v] to (jump height)\n    else\n        set [y vel v] to [0]\n    end\nelse\n    change [y vel v] by (gravity)\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    change [x vel v] by (movement speed)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [x vel v] by ((-1) * (movement speed))\nend\nchange x by (x vel)\nif <touching (ground v)?> then\n    set [old y v] to (y position)\n    repeat (([abs v] of (x vel) ) + (1))\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n    end\n    if <touching (ground v)?> then\n        set y to (old y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <touching (ground v)?> then\n                change x by ((-1) * (([abs v] of (x vel) ) / (x vel)))\n            end\n        end\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> then\n            if <(x vel) < [0]> then\n                set [x vel v] to [0]\n                if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n                    set [x vel v] to (wall jump hm)\n                    set [y vel v] to (wall jump vm)\n                end\n            else\n                set [x vel v] to [0]\n                if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> then\n                    set [x vel v] to ((-1) * (wall jump hm))\n                    set [y vel v] to (wall jump vm)\n                end\n            end\n        end\n    end\nend\nset [x vel v] to ((x vel) * (friction))\n\nwhen I receive [tick v]\ngo to x: ((x position) + (sx)) y: ((y position) + (sy))\n\nwhen I receive [start v]\nforever\n    broadcast (Tick v)\nend\n\nwhen I receive [tick v]\nplatform physics (12) (-1) (.8) (1) (10) (6)\n\nwhen I receive [tick v]\nset rotation style [left-right v]\nif <(x position) > [233]> then\n    change [level v] by (1)\n    Reset\nend\nif <<touching (danger v)?> or <(y position) < [-179]>> then\n    hide\n    Reset\n    broadcast (Death v) and wait\nend\nif <touching (bounce v)?> then\n    set y to (y position)\n    set [y vel v] to [25]\nend\nswitch costume to (hitbox v)\n\nwhen I receive [start outro v]\nstop [other scripts in sprite v]\nhide\n\n@ground\n\nwhen I receive [tick v]\nshow\nswitch costume to (LEVEL)\ngo to x: (0) y: (0)\ngo to [back v] layer\n\nwhen I receive [tick v]\ngo to x: (sx) y: (sy)\n\nwhen flag clicked\nhide\n\nwhen I receive [menu v]\nhide\n\nwhen I receive [start outro v]\nforever\n    hide\nend\n\n@Danger\n\nwhen I receive [tick v]\ngo to x: (sx) y: (sy)\nswitch costume to (LEVEL)\nshow\n\nwhen flag clicked\nhide\n\nwhen I receive [start outro v]\nhide\n\n@Menu\n\nwhen flag clicked\nhide\n\nwhen I receive [reset clones v]\ndelete this clone\n\nwhen I start as a clone\nif <(clone id) = [2]> then\n    go [backward v] (1) layers\n    switch costume to (costume3 v)\n    glide (.5) secs to x: (-156) y: (155)\nelse\n    switch costume to (costume2 v)\n    glide (.5) secs to x: (-188) y: (155)\nend\n\nwhen I receive [reset menu v]\nset [open v] to [0]\nif <[0] < (clone id)> then\n    glide (1) secs to x: (-218) y: (155)\nend\n\nwhen I start as a clone\nif <(clone id) = [1]> then\n    forever\n        if <touching (mouse-pointer v)?> then\n            set [brightness v] effect to (10)\n            if <mouse down?> then\n                wait until <not <mouse down?>>\n                broadcast (skip v) and wait\n            end\n        else\n            clear graphic effects\n        end\n    end\nelse\n    forever\n        if <touching (mouse-pointer v)?> then\n            set [brightness v] effect to (10)\n            if <mouse down?> then\n                wait until <not <mouse down?>>\n                broadcast (redo v) and wait\n            end\n        else\n            clear graphic effects\n        end\n    end\nend\n\nwhen I receive [start v]\nshow\nbroadcast (reset clones v)\ngo to x: (-218) y: (155)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n        if <mouse down?> then\n            wait until <not <mouse down?>>\n            if <(open) = [0]> then\n                broadcast (reset clones v)\n                set [clone id v] to [0]\n                set [open v] to [1]\n                repeat (2)\n                    change [clone id v] by (1)\n                    create clone of (_myself_ v)\n                end\n                set [clone id v] to [0]\n            else\n                broadcast (reset menu v) and wait\n            end\n        end\n    else\n        clear graphic effects\n    end\n    switch costume to (costume1 v)\nend\n\nwhen I receive [start outro v]\nhide\n\n@grunge_surface_dark_scratches_18460_3840x2400\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\n    set [ghost v] effect to (95)\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\nforever\n    set [i v] to ((timer) + (.1))\nend\n\nwhen [timer v] > (I)\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\n\n@Button\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nshow\nset [ghost v] effect to (80)\nrepeat (30)\n    change x by (((360) - (x position)) * (0.2))\n    change [ghost v] effect by (-10)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\nhide\n\nwhen I receive [start settings v]\nshow\nset [ghost v] effect to (80)\nrepeat (30)\n    change x by (((360) - (x position)) * (0.2))\n    change [ghost v] effect by (-10)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\nhide\n\nwhen I receive [menu v]\nshow\ngo to x: (-2400) y: (50)\ngo to [front v] layer\nset [ghost v] effect to (80)\nrepeat (25)\n    change x by (((0) - (x position)) * (0.2))\n    change [ghost v] effect by (-10)\nend\ngo to x: (0) y: (50)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (3))\n        set [ghost v] effect to (20)\n        point in direction (([sin v] of ((timer) * (1000)) ) + (90))\n        if <mouse down?> then\n            start sound [Connect v]\n        end\n    else\n        point in direction (90)\n        change size by (((100) - (size)) / (3))\n        change [ghost v] effect by (-10)\n    end\nend\n\n@Button2\n\nwhen I receive [menu v]\nshow\ngo to x: (-2400) y: (-27)\nset [ghost v] effect to (80)\nrepeat (25)\n    change x by (((0) - (x position)) * (0.2))\n    change [ghost v] effect by (-10)\nend\ngo to x: (0) y: (-27)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (3))\n        set [ghost v] effect to (20)\n        point in direction (([sin v] of ((timer) * (1000)) ) + (90))\n        if <mouse down?> then\n            start sound [Connect v]\n            broadcast (start v)\n        end\n    else\n        point in direction (90)\n        change size by (((100) - (size)) / (3))\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nshow\nset [ghost v] effect to (80)\nrepeat (30)\n    change x by (((360) - (x position)) * (0.2))\n    change [ghost v] effect by (-10)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\nhide\n\nwhen I receive [start settings v]\nshow\nset [ghost v] effect to (80)\nrepeat (30)\n    change x by (((360) - (x position)) * (0.2))\n    change [ghost v] effect by (-10)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\nhide\n\n@Button3\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nshow\nset [ghost v] effect to (80)\nrepeat (30)\n    change x by (((360) - (x position)) * (0.2))\n    change [ghost v] effect by (-10)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\nhide\n\nwhen I receive [start settings v]\nshow\nset [ghost v] effect to (80)\nrepeat (30)\n    change x by (((360) - (x position)) * (0.2))\n    change [ghost v] effect by (-10)\n    if <touching (_edge_ v)?> then\n        hide\n    end\nend\nhide\n\nwhen I receive [start outro v]\nhide\n\nwhen I receive [menu v]\ngo [forward v] (1) layers\nshow\ngo to x: (-2400) y: (0)\nset [ghost v] effect to (80)\nrepeat (25)\n    change x by (((0) - (x position)) * (0.2))\n    change [ghost v] effect by (-10)\nend\ngo to x: (0) y: (0)\n\n@effect\n\nwhen flag clicked\nhide\n\nwhen I receive [tick v]\ngo to [back v] layer\nshow\n\nwhen I receive [start outro v]\nforever\n    hide\nend\n\nwhen I receive [menu v]\nshow\ngo to [back v] layer\nswitch costume to (effect v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nset [x v] to [0]\nset [y v] to [0]\nforever\n    change [x v] by (-2.5)\n    change [y v] by (2)\n    set x to ((x) + (sx))\n    set y to ((y) + (sy))\n    if <(x) = [-40]> then\n        set [x v] to [0]\n        set [y v] to [0]\n    end\nend\n\n@WIN SCREEN\n\nwhen I receive [start outro v]\nforever\n    show\nend\n\nwhen flag clicked\nhide\nwait (.1) seconds\nwait until <(LEVEL) = [15]>\nbroadcast (Start Outro v)\n\n@Sprite6\n\nwhen flag clicked\nshow\ngo to [front v] layer\nstart sound [Intro Music v]\nswitch costume to (name v)\npoint in direction (90)\nset [ghost v] effect to (0)\nset size to (250) %\nrepeat (15)\n    change size by (((100) - (size)) / (5))\n    go to x: (pick random (-3) to (3)) y: (pick random (-3) to (3))\nend\ngo to x: (0) y: (0)\nwait (3) seconds\npoint in direction (-179)\nset size to (250) %\nrepeat (23)\n    change size by (((100) - (size)) / (5))\n    turn right (((90) - (direction)) / (5)) degrees\nend\nset size to (100) %\npoint in direction (90)\n\nwhen flag clicked\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait (0.01) seconds\nchange [clone id v] by (1)\ncreate clone of (_myself_ v)\nwait (0.01) seconds\nchange [clone id v] by (1)\ncreate clone of (_myself_ v)\nwait (0.01) seconds\nchange [clone id v] by (1)\ncreate clone of (_myself_ v)\nwait (0.01) seconds\nchange [clone id v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(Clone ID) = [1]> then\n    show\n    go [backward v] (1) layers\n    switch costume to (squares v)\n    set [ghost v] effect to (0)\n    repeat (110)\n        point in direction ((([sin v] of (Spin2) ) * (10)) + (90))\n        change x by (([cos v] of (Spin2) ) * (2))\n        change y by (([sin v] of (Spin2) ) * (2))\n        change [spin2 v] by (5)\n    end\n    point in direction (90)\n    go to x: (0) y: (0)\n    switch costume to (wheel v)\n    forever\n        turn right (1) degrees\n        go to [back v] layer\n    end\nend\n\nwhen flag clicked\nwait (1) seconds\nset size to (200) %\nrepeat (15)\n    change size by (((100) - (size)) / (4))\n    go to x: (pick random (-3) to (3)) y: (pick random (-3) to (3))\nend\ngo to x: (0) y: (0)\nwait (1) seconds\nset size to (200) %\nrepeat (15)\n    change size by (((100) - (size)) / (4))\n    go to x: (pick random (-3) to (3)) y: (pick random (-3) to (3))\nend\nwait (1.7) seconds\nforever\n    set size to (200) %\n    repeat (15)\n        change size by (((100) - (size)) / (4))\n        go to x: (pick random (-3) to (3)) y: (pick random (-3) to (3))\n    end\n    wait (1) seconds\nend\n\nwhen flag clicked\nrepeat (100)\n    point in direction ((([sin v] of (Direction) ) * (7)) + (90))\nend\nwait (0.9) seconds\nforever\n    point in direction ((([sin v] of (Direction) ) * (7)) + (90))\nend\n\nwhen flag clicked\nwait (8) seconds\nbroadcast (Menu v)\n\nwhen flag clicked\nforever\n    change [direction v] by (10)\n    set y to ((([sin v] of ((Direction) * (2)) ) * (15)) + (0))\nend\n\nwhen I start as a clone\nif <(Clone ID) = [2]> then\n    go to x: (0) y: (0)\n    switch costume to (flash v)\n    set size to (100) %\n    point in direction (90)\n    repeat (7)\n        show\n        go to [front v] layer\n        go [forward v] (1) layers\n        clear graphic effects\n        repeat (25)\n            change [ghost v] effect by (10)\n        end\n        hide\n    end\n    hide\nend\n\nwhen I start as a clone\nif <(Clone ID) = [3]> then\n    switch costume to (explosion v)\n    go to x: (0) y: (0)\n    set size to (200) %\n    point in direction (90)\n    clear graphic effects\n    show\n    set [size v] to [90]\n    repeat (8)\n        go to [front v] layer\n        change size by (Size)\n        change [size v] by (-8)\n        change [ghost v] effect by (2)\n    end\n    repeat (20)\n        change [ghost v] effect by (5)\n        change size by (Size)\n        change [size v] by (-2)\n    end\nend\n\nwhen flag clicked\nwait (3.5) seconds\nchange [clone id v] by (1)\ncreate clone of (_myself_ v)\nwait (4.2) seconds\nchange [clone id v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(Clone ID) = [6]> then\n    switch costume to (explosion v)\n    go to x: (0) y: (0)\n    set size to (200) %\n    point in direction (90)\n    clear graphic effects\n    show\n    set [size v] to [90]\n    repeat (8)\n        go to [front v] layer\n        change size by (Size)\n        change [size v] by (-8)\n        change [ghost v] effect by (2)\n    end\n    repeat (20)\n        change [ghost v] effect by (5)\n        change size by (Size)\n        change [size v] by (-2)\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [7]> then\n    switch costume to (explosion v)\n    go to x: (0) y: (0)\n    set size to (200) %\n    point in direction (90)\n    clear graphic effects\n    show\n    set [size v] to [90]\n    repeat (8)\n        go to [front v] layer\n        change size by (Size)\n        change [size v] by (-8)\n        change [ghost v] effect by (2)\n    end\n    repeat (20)\n        change [ghost v] effect by (5)\n        change size by (Size)\n        change [size v] by (-2)\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [4]> then\n    set size to (70) %\n    go to x: (-229) y: (-172)\n    switch costume to (left light v)\n    point in direction (90)\n    show\n    repeat (300)\n        point in direction ((([sin v] of (Light Direction2) ) * (30)) + (90))\n        change [light direction2 v] by (8)\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [5]> then\n    set size to (70) %\n    go to x: (229) y: (-172)\n    switch costume to (right light v)\n    point in direction (90)\n    show\n    repeat (300)\n        point in direction ((([sin v] of (Light Direction) ) * (30)) + (90))\n        change [light direction v] by (8)\n    end\nend\n\nwhen I receive [menu v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n