Colorful~Scrolling Platformer

Instructions: >>Instructions\n-Use WASD/Arrow Keys/Mobile to move\n-Don't touch spikes\n-Space to use the zoom feature\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

@Stage\n\n@Player\n\nwhen I receive [tick v]\nTick\nset [zy v] to ([y position v] of [mouse zoom v])\nset [zx v] to ([x position v] of [mouse zoom v])\n\ndefine Reset\nset [xv v] to [0]\nset [xp v] to (Spawn X)\nset [yp v] to (Spawn Y)\nset [yv v] to [0]\nset [falling? v] to [9]\nset rotation style [all around v]\npoint in direction (90)\nset size to (12) %\n\ndefine Tick\ngo to x: ((Xp) - (Xs)) y: ((Yp) - (Ys))\nif <(Dying?) = [no]> then\n    Jump\n    Movement+Detection\n    change [yv v] by (-1)\nend\nSpecial Detection\nCostume Set\nPosition Player\nVariables\n\ndefine Move Y (yv)\nchange [yp v] by (yv)\nchange [falling? v] by (1)\nPosition Player\nrepeat until <not <touching (ground v)?>>\n    if <(yv) > [0]> then\n        change [yp v] by (-1)\n        set [falling? v] to [99]\n    else\n        change [yp v] by (1)\n        set [falling? v] to [0]\n    end\n    set [yv v] to [0]\n    Position Player\nend\n\ndefine Move X (xv)\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > [10]>>> then\n    change [xv v] by (2)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < [-10]>>> then\n    change [xv v] by (-2)\nend\nchange [xp v] by (Xv)\nPosition Player\nif <touching (ground v)?> then\n    repeat (7)\n        change [yp v] by (1)\n        Position Player\n        if <not <touching (ground v)?>> then\n            stop [this script v]\n        end\n    end\n    change [yp v] by (-7)\n    repeat until <not <touching (ground v)?>>\n        if <(Xv) > [0]> then\n            change [xp v] by (-1)\n        else\n            change [xp v] by (1)\n        end\n        Position Player\n    end\nend\n\ndefine Position Player\ngo to x: (((Xp) - (Xs)) - ((Zx) / (3))) y: (((Yp) - (Ys)) - ((Zy) / (3)))\n\nwhen flag clicked\nset [spawn x v] to [0]\nset [spawn y v] to [0]\ngo to [back v] layer\nset [xs v] to [0]\nset [ys v] to [0]\nbroadcast (green flag v)\n\ndefine Movement+Detection\nMove X (Xv)\nMove Y (Yv)\n\ndefine Variables\nset [xv v] to ((Xv) * (.75))\nchange [ys v] by (((Yp) - (Ys)) / (7))\nchange [xs v] by (((Xp) - (Xs)) / (7))\nset [gy v] to (Ys)\nset [gx v] to (Xs)\n\ndefine Special Detection\nif <(Yv) < [-15]> then\n    set [yv v] to [-15]\nend\nif <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<(mouse y) < [-10]> and <mouse down?>>> then\n    change [yv v] by (-1)\nend\nif <touching (checkpoints v)?> then\n    set [touching2 v] to [yes]\nelse\n    set [touching2 v] to [no]\nend\n\nwhen flag clicked\nshow\nset [dying? v] to [no]\nforever\n    Death Sense\nend\n\nwhen flag clicked\nReset\nforever\n    broadcast (tick v)\nend\n\ndefine Death\nstart sound [punch v]\nset [dying? v] to [yes]\nset [ghost v] effect to (100)\nbroadcast (Jump! v)\nwait (1) seconds\nReset\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (.3) seconds\nset [dying? v] to [no]\n\nwhen flag clicked\nforever\n    if <<(Touching) = [yes]> and <(touching2) = [yes]>> then\n        broadcast (Checkpoint v)\n    end\nend\n\ndefine Death Sense\nif <touching (spikes v)?> then\n    Death\nend\nif <key (r v) pressed?> then\n    Death\nend\nif <(Ys) < [-1000]> then\n    Death\nend\n\ndefine Jump\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > [10]>>> and <(Falling?) < [5]>> then\n    set [yv v] to [10]\n    broadcast (No Jump v)\nend\n\ndefine Costume Set\nswitch costume to (stand v)\nif <[-2] > (round (Yv))> then\n    switch costume to (down v)\nelse\n    if <(round (Yv)) > [0]> then\n        switch costume to (up v)\n    end\nend\nif <(round (Xv)) > [1]> then\n    switch costume to (right v)\nend\nif <[-1] > (round (Xv))> then\n    switch costume to (left v)\nend\n\nwhen flag clicked\nforever\n    play sound [Sunshine v] until done\nend\n\n@Ground\n\nwhen I receive [tick v]\nGo to (((Platform X) + ((0) - (Xs))) - ((Zx) / (3))) (((Platform Y) + ((0) - (Ys))) - ((Zy) / (3)))\nset [brightness v] effect to (-10)\n\ndefine Clone || X (x) Y (y)\nchange [platform x v] by (x)\nchange [platform y v] by (y)\ncreate clone of (_myself_ v)\nnext costume\n\ndefine Go to (x) (y)\ngo to x: (x) y: (y)\nif <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>> then\n    if <(size) = [90]> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen flag clicked\nclear graphic effects\ngo to [front v] layer\ngo [backward v] (6) layers\nset size to (50) %\nset [platform x v] to [0]\nset [platform y v] to [0]\nswitch costume to (costume1 v)\nClone || X [0] Y [0]\nClone || X [400] Y [-30]\nClone || X [420] Y [-10]\nClone || X [425] Y [0]\nClone || X [425] Y [0]\nClone || X [425] Y [0]\nClone || X [425] Y [0]\nClone || X [425] Y [0]\nClone || X [425] Y [0]\n\nwhen I start as a clone\nset size to (90) %\n\nhide\n\n@Frame\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\ngo [backward v] (2) layers\n\n@Outline\n\nwhen flag clicked\nshow\nset [ghost v] effect to (95)\ngo to [front v] layer\ngo [backward v] (1) layers\ncreate clone of (_myself_ v)\nforever\n    set x to ((0) - (((timer) * (40)) mod (20)))\nend\n\nwhen I start as a clone\nset [ghost v] effect to (95)\ngo to [front v] layer\nset size to (135) %\nset x to (0)\nturn right (90) degrees\nforever\n    set y to ((0) - (((timer) * (40)) mod (28)))\n    go to [front v] layer\nend\n\n@Spikes\n\nwhen I receive [tick v]\n\ndefine Clone (x) (y)\nchange [platform x v] by (x)\nchange [platform y v] by (y)\ncreate clone of (_myself_ v)\nnext costume\n\ndefine Go to (x) (y)\ngo to x: (x) y: (y)\nif <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>> then\n    show\n    if <(size) = [90]> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen flag clicked\npoint in direction (90)\ngo to [front v] layer\ngo [backward v] (1000) layers\nset size to (80) %\nset [platform x v] to [0]\nset [platform y v] to [0]\nswitch costume to (costume1 v)\nClone [0] [0]\nClone [200] [-85]\nClone [250] [0]\nClone [670] [0]\nClone [350] [0]\nClone [800] [0]\nClone [200] [0]\nClone [500] [0]\n\nwhen I start as a clone\nset size to (90) %\n\nwhen flag clicked\n\nwhen I start as a clone\nforever\n    Go to (((Platform X) + ((0) - (Xs))) - ((Zx) / (3))) (((Platform Y) + ((0) - (Ys))) - ((Zy) / (3)))\n    set [brightness v] effect to (-1)\nend\n\n@Explosion\n\nwhen flag clicked\ngo to [front v] layer\ngo [backward v] (3) layers\nhide\n\nwhen I receive [jump! v]\ngo to (player v)\nswitch costume to (costume1 v)\nshow\nset size to (190) %\nrepeat (27)\n    go to (player v)\n    next costume\n    go to (player v)\nend\ngo to (player v)\nhide\n\nchange size by (1)\n\n@Trail\n\nwhen I start as a clone\ngo to [back v] layer\nshow\ngo [forward v] (1) layers\nset size to (70) %\nset [ghost v] effect to (50)\ngo to (player v)\nset [x v] to ((x position) + (Gx))\nset [y v] to ((y position) + (Gy))\nset [cxv! v] to [0]\nset [cyv! v] to [0]\nrepeat (8)\n    go to x: (((x) + ((0) - (Gx))) - ()) y: (((y) + ((0) - (Gy))) - ())\n    change [x v] by (CXV!)\n    change [y v] by (CYV!)\n    change [ghost v] effect by (7)\nend\ndelete this clone\n\nif <touching (ground v)?> then\n    delete this clone\nend\n\ndefine Clone (#)\nrepeat (#)\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nset [clones v] to [0]\nforever\n    if <(Dying?) = [no]> then\n    end\nend\n\nClone [1]\n\nwhen flag clicked\ndelete this clone\n\n@Particles\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nset size to (pick random (100) to (150)) %\nset [ghost v] effect to (100)\ngo to (random position v)\nset [color v] effect to (pick random (0) to (100))\nset [xp clone v] to ((x position) + (Gx))\nset [yp clone v] to ((y position) + (Gy))\nset [clone xv v] to (pick random (-3.5) to (3.5))\nset [clone yv v] to (pick random (-3.5) to (3.5))\nrepeat (pick random (10) to (18))\n    go to x: (((Xp Clone) + ((0) - (Gx))) - ((Zx) / (3))) y: (((Yp Clone) + ((0) - (Gy))) - ((Zy) / (3)))\n    change [xp clone v] by (Clone Xv)\n    change [yp clone v] by (Clone Yv)\n    change [ghost v] effect by (-1)\n    change [color v] effect by (2)\n    change size by (3)\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\nend\nrepeat until <touching (_edge_ v)?>\n    go to x: (((Xp Clone) + ((0) - (Gx))) - ((Zx) / (3))) y: (((Yp Clone) + ((0) - (Gy))) - ((Zy) / (3)))\n    change [xp clone v] by (Clone Xv)\n    change [yp clone v] by (Clone Yv)\n    change [ghost v] effect by (.5)\n    change [color v] effect by (2)\n    change size by (3)\nend\ndelete this clone\n\ndefine Clone (#)\nrepeat (#)\n    create clone of (_myself_ v)\nend\n\nif <(Dying?) = [no]> then\n\nwhen flag clicked\nforever\n    Clone [1]\nend\n\nwait (.08) seconds\n\n@Checkpoints\n\nwhen I receive [tick v]\n\nGo to (((Check X) + ((0) - (Xs))) - ((Zx) / (1))) (((Check Y) + ((0) - (Ys))) - ((Zy) / (3)))\n\ndefine Clone || X (x) Y (y)\nchange [check x v] by (x)\nchange [check y v] by (y)\ncreate clone of (_myself_ v)\nnext costume\n\ndefine Go to (x) (y)\ngo to x: (x) y: (y)\nshow\nif <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>> then\n    show\n    if <(size) = [250]> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen flag clicked\ngo to [front v] layer\ngo [backward v] (99) layers\nset size to (50) %\nset [check x v] to [0]\nset [check y v] to [0]\nswitch costume to (costume1 v)\nClone || X [1800] Y [-127]\n\nwhen I start as a clone\nset size to (250) %\n\ndefine Checkpoint\nbroadcast (Checkpoint v)\nset [spawn x v] to (Check X)\nset [spawn y v] to ((Check Y) + (50))\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        Checkpoint\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nswitch costume to (1 v)\nforever\n    if <touching (player v)?> then\n        set [touching v] to [yes]\n        stop [this script v]\n    else\n        set [touching v] to [no]\n        next costume\n        wait (0.001) seconds\n    end\nend\n\nwait (.1) seconds\n\nwhen flag clicked\n\nwhen I start as a clone\nforever\n    Go to (((Check X) + ((0) - (Xs))) - ((Zx) / (3))) (((Check Y) + ((0) - (Ys))) - ((Zy) / (3)))\nend\n\n@Checkpoint Particles\n\nwhen I start as a clone\ngo to [back v] layer\ngo [backward v] (999) layers\nshow\nset size to (pick random (30) to (50)) %\nset [ghost v] effect to (0)\ngo to (player v)\nset [color v] effect to (pick random (0) to (30))\nset [xp clone v] to ((x position) + (Gx))\nset [yp clone v] to ((y position) + (Gy))\nset [clone xv v] to (pick random (-5) to (5))\nset [clone yv v] to (pick random (7) to (15))\nrepeat (100)\n    go [backward v] (999) layers\n    go to x: (((Xp Clone) + ((0) - (Gx))) - (([x position v] of [mouse zoom v]) / (3))) y: (((Yp Clone) + ((0) - (Gy))) - (([y position v] of [mouse zoom v]) / (3)))\n    change [xp clone v] by (Clone Xv)\n    change [yp clone v] by (Clone Yv)\n    change [clone yv v] by (-1.4)\nend\ndelete this clone\n\ndefine Clone (#)\nrepeat (#)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [checkpoint v]\nif <<(x position) = [-100]> and <(y position) = [-100]>> then\n    Clone (pick random (20) to (30))\nend\n\ngo to x: (-100) y: (-100)\n\n@Clouds\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nset size to (pick random (20) to (40)) %\nset [ghost v] effect to (pick random (40) to (60))\nset [color v] effect to (0)\nset [xp clone v] to ((x position) + (Gx))\nset [yp clone v] to ((y position) + (Gy))\nset [clone xv v] to (pick random (1) to (3.))\nset [clone yv v] to [0]\nif <(pick random (1) to (2)) = [1]> then\n    switch costume to (costume1 v)\n    go to x: (-400) y: (pick random (0) to (300))\n    switch costume to (pick random (1) to (5))\n    set [clone xv v] to (pick random (1) to (3.))\n    set [clone yv v] to [0]\n    set [xp clone v] to ((x position) + (Gx))\n    set [yp clone v] to ((y position) + (Gy))\n    repeat until <(Xp Clone) > [3000]>\n        go to x: (((Xp Clone) + ((0) - (Gx))) - ((Zx) / (3))) y: (((Yp Clone) + ((0) - (Gy))) - ((Zy) / (3)))\n        change [xp clone v] by (Clone Xv)\n        change [yp clone v] by (Clone Yv)\n        change [ghost v] effect by (0)\n        change [color v] effect by (0)\n        change size by (0)\n    end\n    delete this clone\nelse\n    switch costume to (costume1 v)\n    go to x: (400) y: (pick random (0) to (300))\n    switch costume to (pick random (1) to (5))\n    set [clone xv v] to (pick random (-1) to (-3.))\n    set [clone yv v] to [0]\n    set [xp clone v] to ((x position) + (Gx))\n    set [yp clone v] to ((y position) + (Gy))\n    repeat until <(Xp Clone) < [-1000]>\n        go to x: (((Xp Clone) + ((0) - (Gx))) - (([x position v] of [mouse zoom v]) / (3))) y: (((Yp Clone) + ((0) - (Gy))) - (([y position v] of [mouse zoom v]) / (3)))\n        change [xp clone v] by (Clone Xv)\n        change [yp clone v] by (Clone Yv)\n        change [ghost v] effect by (0)\n        change [color v] effect by (0)\n        change size by (0)\n    end\n    delete this clone\nend\n\ndefine Clone (#)\nrepeat (#)\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nforever\n    Clone [1]\n    wait (pick random (3) to (6)) seconds\nend\n\n@Mouse Zoom\n\nwhen flag clicked\nset [zoom? v] to [0]\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nforever\n    if <(Zoom?) = [1]> then\n        point towards (mouse-pointer v)\n        move ((distance to [mouse-pointer v]) / (5)) steps\n    else\n        change x by ((0) - ((x position) / (5)))\n        change y by ((0) - ((y position) / (5)))\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (space v) pressed?> then\n        wait until <key (space v) pressed?>\n        change [zoom? v] by (1)\n        wait until <not <key (space v) pressed?>>\n        wait until <key (space v) pressed?>\n        change [zoom? v] by (-1)\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\n\n