(DARK!) (Mobile Friendly Platformer)

Instructions: ~Dungeon Platformer~\nWelcome to my newest game! I hope you enjoy it!\n-Instructions-\nArrow keys to move left and right as well as jumping-\nSpace key to shrink your character-\n-Tips-\nUsing the shrink ability in midair is a useful strategy-\nIf you unshrink and you get stuck in a wall, simply shrink again to get out-\n\n

@Stage\n\n@Player\n\nwhen flag clicked\nforever\n    if <<(Speed Y) > [50]> or <touching (danger v)?>> then\n        start sound [death v]\n        broadcast (Level Reset v) and wait\n        wait (1) seconds\n    end\nend\n\nwait (.5) seconds\n\nwhen I receive [set up v]\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [ghost v] effect to (0)\nbroadcast (Reset v)\n\nwhen flag clicked\nbroadcast (Set up v)\n\nwhen I receive [level reset v]\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [pause v] to [1]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (Transition v)\n\nwhen flag clicked\nset [pause v] to [0]\nset [level complete v] to [0]\n\nif <touching ((join [] [portal]) v)?> then\n\nset [level complete v] to [1]\nbroadcast (Level Reset v) and wait\nset [speed x v] to [0]\nset [speed y v] to [0]\nwait (1) seconds\n\nwhen flag clicked\nshow\n\nwhen flag clicked\nforever\n    point in direction ((-1) * (Speed X))\n    set rotation style [left-right v]\nend\n\nwhen flag clicked\nforever\n    if <touching (water v)?> then\n        set [water? v] to [1]\n    else\n        set [water? v] to [0]\n    end\n    if <touching (left bubbles v)?> then\n        change [speed x v] by (-3)\n    end\n    if <touching (down bubbles v)?> then\n        change [speed y v] by (-3)\n    end\n    if <touching (right bubbles v)?> then\n        change [speed x v] by (3)\n    end\nend\n\nset [speed y v] to [1]\n\nset [speed x v] to [-10]\n\nset [level v] to [3]\nbroadcast (Level Reset v)\n\nwhen flag clicked\nforever\n    play sound [2019-09-29_-_Jump_Around_-_FesliyanStudios v] until done\nend\n\n@Platform\n\ndefine Platformer\nif <(Pause) = [0]> then\n    if <(Water?) = [0]> then\n        change [speed y v] by (1)\n    else\n        if <(Speed Y) < [5]> then\n            change [speed y v] by (.1)\n        end\n    end\n    change y by (Speed Y)\n    if <touching (player v)?> then\n        repeat until <not <touching (player v)?>>\n            if <(Speed Y) < [0]> then\n                change y by (1)\n            end\n            if <(Speed Y) > [0]> then\n                change y by (-1)\n            end\n        end\n        if <(Water?) = [0]> then\n            set [speed y v] to ((-15) * <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > [0]>>> and <(Speed Y) > [0]>>)\n        else\n            set [speed y v] to [0]\n        end\n    end\n    if <(Water?) = [1]> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > [0]>>> then\n            if <(Speed Y) > [-4]> then\n                change [speed y v] by (-1.5)\n            end\n        end\n    end\n    if <(Water?) = [0]> then\n        change [speed x v] by (((2) * <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < [0]>>>) + ((-2) * <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > [0]>>>))\n    else\n        change [speed x v] by (((1.25) * <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < [0]>>>) + ((-1.25) * <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > [0]>>>))\n    end\n    change x by (Speed X)\n    set [speed x v] to ((Speed X) * (.7))\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (player v)?>>>\n        change y by (-1)\n        change [slope v] by (1)\n    end\n    if <touching (player v)?> then\n        change y by (Slope)\n        repeat until <not <touching (player v)?>>\n            if <(Speed X) < [0]> then\n                change x by (1)\n            end\n            if <(Speed X) > [0]> then\n                change x by (-1)\n            end\n        end\n    end\nend\nbroadcast (Sync v)\n\nset [speed y v] to [-5]\n\nwhen flag clicked\nset [speed x v] to [0]\nset [level v] to [1]\nset [speed y v] to [0]\nforever\n    Platformer\nend\n\nwhen I receive [reset v]\ngo to x: (0) y: (0)\n\nset [speed y v] to [-2]\n\nswitch costume to (costume3 v)\n\nwhen flag clicked\nforever\n    switch costume to (join (Level) (join [-] (Key Collected?)))\nend\n\n@Transition\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\nend\n\nwhen I receive [transition v]\nswitch costume to (0 v)\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nchange [level v] by (Level Complete)\nset [level complete v] to [0]\nbroadcast (Set up v)\nwait (.2) seconds\nset [pause v] to [0]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nset [ghost v] effect to (0)\n\nhide\n\nwait (.25) seconds\n\n@Portal\n\nwhen I receive [sync v]\nset x to ((Offset X) + (([x position v] of [platform v]) + (X)))\nset y to ((Offset Y) + (([y position v] of [platform v]) + (Y)))\nif <<(round ((Offset X) + (([x position v] of [platform v]) + (X)))) = (round (x position))> and <(round ((Offset Y) + (([y position v] of [platform v]) + (Y)))) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [1]> then\n        set [x v] to [1458]\n        set [y v] to [-60]\n    else\n        if <(Level) = [2]> then\n            set [x v] to [1535]\n            set [y v] to [-120]\n        else\n            if <(Level) = [3]> then\n                set [x v] to [1790]\n                set [y v] to [-310]\n            else\n                if <(Level) = [4]> then\n                    set [x v] to [123412342134]\n                    set [y v] to [123412341234]\n                end\n            end\n        end\n    end\nend\n\npoint in direction (90)\n\nwhen flag clicked\nforever\n    if <(Pause) = [0]> then\n        set [offset y v] to [5]\n        set [offset x v] to [-5]\n    end\n    repeat (10)\n        if <(Pause) = [0]> then\n            change [offset x v] by (1)\n        end\n    end\n    repeat (10)\n        if <(Pause) = [0]> then\n            change [offset y v] by (-1)\n        end\n    end\n    repeat (10)\n        if <(Pause) = [0]> then\n            change [offset x v] by (-1)\n        end\n    end\n    repeat (10)\n        if <(Pause) = [0]> then\n            change [offset y v] by (1)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        start sound [next level cobalt v]\n        set [level complete v] to [1]\n        broadcast (Level Reset v)\n        wait (1) seconds\n    end\nend\n\n@clouds\n\nwhen I start as a clone\ngo to [front v] layer\nchange [clone count v] by (1)\nshow\nset [brightness v] effect to (100)\nswitch costume to (pick random (1) to (4))\ngo to x: (0) y: (0)\nset [right? v] to (pick random (0) to (1))\ngo to (random position v)\nset [x v] to ((x position) + ((-1) * ([x position v] of [platform v])))\nset [y v] to ((y position) + ((-1) * ([y position v] of [platform v])))\nset [ghost v] effect to (100)\nset [ghost v] to [100]\nforever\n    if <not <(Ghost) = [70]>> then\n        change [ghost v] effect by (-1)\n        change [ghost v] by (-1)\n    end\n    if <(Right?) = [0]> then\n        change [x v] by (1)\n    else\n        change [x v] by (-1)\n    end\n    go to x: ((X) + ([x position v] of [platform v])) y: ((Y) + ([y position v] of [platform v]))\n    if <<(round (x position)) = (round ((X) + ([x position v] of [platform v])))> and <(round (y position)) = (round ((Y) + ([y position v] of [platform v])))>> then\nend\n\nwhen flag clicked\nset [clone count v] to [0]\nhide\nforever\n    if <not <(Clone Count) = [5]>> then\n        wait (.5) seconds\n        create clone of (_myself_ v)\n    end\nend\n\n@Danger\n\nwhen I receive [sync v]\nset x to ((Offset X) + (([x position v] of [platform v]) + (X)))\nset y to ((Offset Y) + (([y position v] of [platform v]) + (Y)))\nif <(Clone?) = [1]> then\n    if <<(Clone Level) = (Level)> and <<(round ((Offset X) + (([x position v] of [platform v]) + (X)))) = (round (x position))> and <(round ((Offset Y) + (([y position v] of [platform v]) + (Y)))) = (round (y position))>>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen I start as a clone\nset [offset x v] to [0]\nset [offset y v] to [0]\nset [clone? v] to [1]\npoint in direction (90)\nswitch costume to (1 v)\n\ndefine Create Clone: Clone Type: (type) Level: (level) X: (x) Y: (y)\nset [clone level v] to (level)\nset [clone type v] to (type)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    if <(Pause) = [0]> then\n        turn right (6) degrees\n    end\nend\n\nwhen I receive [reset v]\nset [clone? v] to [0]\nCreate Clone: Clone Type: [1] Level: [1] X: [100] Y: [-35]\nCreate Clone: Clone Type: [1] Level: [1] X: [448] Y: [-100]\nCreate Clone: Clone Type: [2] Level: [1] X: [832] Y: [-163]\nCreate Clone: Clone Type: [1] Level: [1] X: [1200] Y: [-280]\nCreate Clone: Clone Type: [2] Level: [1] X: [1270] Y: [-425]\nCreate Clone: Clone Type: [1] Level: [2] X: [125] Y: [-166]\nCreate Clone: Clone Type: [1] Level: [2] X: [320] Y: [-65]\nCreate Clone: Clone Type: [1] Level: [2] X: [450] Y: [-135]\nCreate Clone: Clone Type: [1] Level: [2] X: [830] Y: [-120]\nCreate Clone: Clone Type: [1] Level: [2] X: [575] Y: [-230]\nCreate Clone: Clone Type: [2] Level: [2] X: [832] Y: [-420]\nCreate Clone: Clone Type: [1] Level: [2] X: [1230] Y: [-290]\nCreate Clone: Clone Type: [1] Level: [2] X: [1325] Y: [-290]\nCreate Clone: Clone Type: [1] Level: [3] X: [190] Y: [-165]\nCreate Clone: Clone Type: [2] Level: [3] X: [450] Y: [-100]\nCreate Clone: Clone Type: [2] Level: [3] X: [580] Y: [-355]\nCreate Clone: Clone Type: [1] Level: [3] X: [1155] Y: [-355]\nCreate Clone: Clone Type: [2] Level: [3] X: [1480] Y: [-355]\nCreate Clone: Clone Type: [1] Level: [3] X: [1620] Y: [-220]\nCreate Clone: Clone Type: [1] Level: [3] X: [1660] Y: [-485]\n\nwhen I receive [set up v]\ndelete this clone\n\ndefine Move 8\nset [offset x v] to [-80]\nrepeat (20)\n    wait until <(Pause) = [0]>\n    change [offset x v] by (8)\nend\nwait (1) seconds\nrepeat (20)\n    wait until <(Pause) = [0]>\n    change [offset x v] by (-8)\nend\nwait (1) seconds\n\nwhen I start as a clone\nforever\n    if <(Clone Type) = [2]> then\n        Move 8\n    end\nend\n\nbroadcast (Level Reset v)\n\nbroadcast (Level Reset v)\n\nset [key collected? v] to [1]\n\nCreate Clone: Clone Type: [1] Level: [3] X: [1560] Y: [-220]\n\n@water\n\nwhen I receive [sync v]\nset [ghost v] effect to (50)\nset x to ((Offset X) + (([x position v] of [platform v]) + (X)))\nset y to ((Offset Y) + (([y position v] of [platform v]) + (Y)))\nif <<(round ((Offset X) + (([x position v] of [platform v]) + (X)))) = (round (x position))> and <(round ((Offset Y) + (([y position v] of [platform v]) + (Y)))) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nforever\n    switch costume to (join (Level) (join [-] (Key Collected?)))\nend\n\n@left bubbles\n\nwhen I receive [sync v]\nset x to ((Offset X) + (([x position v] of [platform v]) + (X)))\nset y to ((Offset Y) + (([y position v] of [platform v]) + (Y)))\nif <(Clone?) = [1]> then\n    if <<(Clone Level) = (Level)> and <<(round ((Offset X) + (([x position v] of [platform v]) + (X)))) = (round (x position))> and <(round ((Offset Y) + (([y position v] of [platform v]) + (Y)))) = (round (y position))>>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen I start as a clone\nset [offset x v] to [0]\nset [offset y v] to [0]\nset [clone? v] to [1]\npoint in direction ((pick random (1) to (4)) * (90))\nswitch costume to (1 v)\nset x to ((Offset X) + (([x position v] of [platform v]) + (X)))\nset y to ((Offset Y) + (([y position v] of [platform v]) + (Y)))\nrepeat until <not <touching (platform v)?>>\n    Movement\nend\nrepeat (40)\n    Movement\nend\nrepeat (10)\n    Movement\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\ndefine Create Clone: Clone Type: (type) Level: (level) X: (x) Y: (y)\nset [clone level v] to (level)\nset [clone type v] to (type)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [reset v]\nset [clone? v] to [0]\nwait until <(Pause) = [0]>\nrepeat until <(Pause) = [1]>\n    if <(Level) = [1]> then\n        Create Clone: Clone Type: [right] Level: [1] X: [160] Y: [-100]\n        wait (.25) seconds\n    end\nend\n\nwhen I receive [set up v]\ndelete this clone\n\ndefine Movement\nif <(Pause) = [0]> then\n    if <(Clone Type) = [up]> then\n        change [offset y v] by (4)\n    else\n        if <(Clone Type) = [left]> then\n            change [offset x v] by (-4)\n        else\n            if <(Clone Type) = [right]> then\n                change [offset x v] by (4)\n            end\n        end\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen [timer v] > (0)\nswitch costume to (costume6 v)\nset [brightness v] effect to (0)\nset [ghost v] effect to (0)\ngo to [front v] layer\nshow\n\nwhen flag clicked\nswitch costume to (costume6 v)\nshow\nset [brightness v] effect to (100)\nset [ghost v] effect to (0)\nwait (.5) seconds\nrepeat (50)\n    change [brightness v] effect by (-2)\nend\nwait (1) seconds\nrepeat (50)\n    change [brightness v] effect by (2)\nend\nrepeat (50)\n    change [ghost v] effect by (2)\nend\n\n@Key\n\nwhen I receive [sync v]\nset x to ((Offset X) + (([x position v] of [platform v]) + (X)))\nset y to ((Offset Y) + (([y position v] of [platform v]) + (Y)))\nif <(Clone?) = [1]> then\n    if <<(Clone Level) = (Level)> and <<(round ((Offset X) + (([x position v] of [platform v]) + (X)))) = (round (x position))> and <(round ((Offset Y) + (([y position v] of [platform v]) + (Y)))) = (round (y position))>>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen I start as a clone\nset [offset x v] to [0]\nset [offset y v] to [0]\nset [clone? v] to [1]\npoint in direction (90)\nswitch costume to (1 v)\n\ndefine Create Clone: Clone Type: (type) Level: (level) X: (x) Y: (y)\nset [clone level v] to (level)\nset [clone type v] to (type)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    point in direction (75)\nend\n\nwhen I receive [reset v]\nset [clone? v] to [0]\nCreate Clone: Clone Type: [1] Level: [2] X: [385] Y: [-190]\nCreate Clone: Clone Type: [1] Level: [3] X: [520] Y: [-270]\n\nwhen I receive [set up v]\nset [key collected? v] to [0]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        start sound [build-up v]\n        repeat (20)\n            change [brightness v] effect by (5)\n        end\n        set [key collected? v] to [1]\n        start sound [unlockboom v]\n        delete this clone\n    end\nend\n\nif <(Clone Type) = [2]> then\n\nbroadcast (Level Reset v)\n\nset [level v] to [2]\n\n@down bubbles\n\nwhen I receive [sync v]\nset x to ((Offset X) + (([x position v] of [platform v]) + (X)))\nset y to ((Offset Y) + (([y position v] of [platform v]) + (Y)))\nif <(Clone?) = [1]> then\n    if <<(Clone Level) = (Level)> and <<(round ((Offset X) + (([x position v] of [platform v]) + (X)))) = (round (x position))> and <(round ((Offset Y) + (([y position v] of [platform v]) + (Y)))) = (round (y position))>>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen I start as a clone\nset [offset x v] to [0]\nset [offset y v] to [0]\nset [clone? v] to [1]\npoint in direction ((pick random (1) to (4)) * (90))\nswitch costume to (1 v)\nset x to ((Offset X) + (([x position v] of [platform v]) + (X)))\nset y to ((Offset Y) + (([y position v] of [platform v]) + (Y)))\nrepeat until <not <touching (platform v)?>>\n    Movement\nend\nrepeat (40)\n    Movement\nend\nrepeat (10)\n    Movement\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\ndefine Create Clone: Clone Type: (type) Level: (level) X: (x) Y: (y)\nset [clone level v] to (level)\nset [clone type v] to (type)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [reset v]\nset [clone? v] to [0]\nwait until <(Pause) = [0]>\nrepeat until <(Pause) = [1]>\n    if <(Level) = [2]> then\n        Create Clone: Clone Type: [down] Level: [2] X: [830] Y: [-280]\n        wait (.25) seconds\n    end\nend\n\nwhen I receive [set up v]\ndelete this clone\n\ndefine Movement\nif <(Pause) = [0]> then\n    if <(Clone Type) = [up]> then\n        change [offset y v] by (4)\n    else\n        if <(Clone Type) = [left]> then\n            change [offset x v] by (-4)\n        else\n            if <(Clone Type) = [right]> then\n                change [offset x v] by (4)\n            else\n                if <(Clone Type) = [down]> then\n                    change [offset y v] by (4)\n                end\n            end\n        end\n    end\nend\n\n@right bubbles\n\nwhen I receive [sync v]\nset x to ((Offset X) + (([x position v] of [platform v]) + (X)))\nset y to ((Offset Y) + (([y position v] of [platform v]) + (Y)))\nif <(Clone?) = [1]> then\n    if <<(Clone Level) = (Level)> and <<(round ((Offset X) + (([x position v] of [platform v]) + (X)))) = (round (x position))> and <(round ((Offset Y) + (([y position v] of [platform v]) + (Y)))) = (round (y position))>>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen I start as a clone\nset [offset x v] to [0]\nset [offset y v] to [0]\nset [clone? v] to [1]\npoint in direction ((pick random (1) to (4)) * (90))\nswitch costume to (1 v)\nset x to ((Offset X) + (([x position v] of [platform v]) + (X)))\nset y to ((Offset Y) + (([y position v] of [platform v]) + (Y)))\nrepeat until <not <touching (platform v)?>>\n    Movement\nend\nrepeat (40)\n    Movement\nend\nrepeat (10)\n    Movement\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\ndefine Create Clone: Clone Type: (type) Level: (level) X: (x) Y: (y)\nset [clone level v] to (level)\nset [clone type v] to (type)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [reset v]\nset [clone? v] to [0]\nwait until <(Pause) = [0]>\nrepeat until <(Pause) = [1]>\n    if <(Level) = [3]> then\n        Create Clone: Clone Type: [left] Level: [3] X: [770] Y: [-320]\n        wait (.25) seconds\n    end\nend\n\nwhen I receive [set up v]\ndelete this clone\n\ndefine Movement\nif <(Pause) = [0]> then\n    if <(Clone Type) = [up]> then\n        change [offset y v] by (4)\n    else\n        if <(Clone Type) = [left]> then\n            change [offset x v] by (-4)\n        else\n            if <(Clone Type) = [right]> then\n                change [offset x v] by (4)\n            else\n                if <(Clone Type) = [down]> then\n                    change [offset y v] by (4)\n                end\n            end\n        end\n    end\nend\n\n