Galaxy | Scrolling Platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [Nebula v] until done\nend\n\n@Blank\n\ndefine Please\n[Get this on trending]\n[Love & Favourite]\n[Time taken: 36 hours O.O]\n[Propose it to be featured]\n[Don't hack]\n[Follow if you enjoyed]\n[Don't report, read the notes and credits carefully]\n[Honestly no one reported]\n[And I never copied]\n[So idk why I'm saying that]\n[Islands | Pen Platformer \[100% Pen\]]\n[Coming soon!]\n[Follow to stay tuned]\n[Thank you so much for 25+ followers!]\n[Find the secret define block]\n\ndefine (number or text)\n\n@Player\n\nwhen I receive [start game v]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Reset Player\n    repeat until <(STATUS) > []>\n        Tick\n        broadcast (Tick v)\n    end\n    if <(STATUS) = [Win]> then\n        broadcast (Win v) and wait\n    else\n        Player Die\n    end\nend\n\ndefine Reset Player\nset [scroll x v] to [0]\nset [scroll y v] to [50]\nset [player x v] to [0]\nset [player y v] to [50]\nset [status v] to []\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [in air? v] to [10]\npoint in direction (90)\nswitch costume to (centre v)\ngo to [front v] layer\nset size to (85) %\nclear graphic effects\nshow\n\ndefine Tick\nswitch costume to (hitbox v)\nif <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    change [speed x v] by (2)\nend\nif <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> then\n    change [speed x v] by (-2)\nend\nset [speed x v] to ((Speed X) * (0.8))\nif <([abs v] of (Speed X) ) > [0.9]> then\n    Change Player X by (round (Speed X))\nend\nif <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n    if <(In Air?) < [4]> then\n        set [speed y v] to [18]\n    end\nend\nchange [speed y v] by (-2)\nChange Player Y by (Speed Y)\nchange [scroll x v] by (round (((Player X) - (SCROLL X)) / (2)))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nPosition Player\nif <(Player Y) < [-170]> then\n    set [status v] to [Dead]\nend\nchange [scroll y v] by (round (((Player Y) - (SCROLL Y)) / (6)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition Player\nif <(Player Y) < [-170]> then\n    set [status v] to [Dead]\nend\nif <touching (danger v)?> then\n    set [status v] to [Dead]\nend\nAnimate Player\n\ndefine Change Player X by (speed x)\nchange [player x v] by (speed x)\nchange [in air? v] by (1)\nPosition Player\nif <touching (platforms v)?> then\n    repeat (10)\n        change [player y v] by (1)\n        Position Player\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [player y v] by (-10)\n    if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n        if <(speed x) > [0]> then\n            set [speed x v] to [-15]\n        else\n            set [speed x v] to [15]\n        end\n        set [in air? v] to [0]\n    else\n        set [speed x v] to [0]\n    end\n    repeat until <not <touching (platforms v)?>>\n        if <(speed x) > [0]> then\n            change [player x v] by (-1)\n        else\n            change [player x v] by (1)\n        end\n        Position Player\n    end\nend\n\ndefine Position Player\ngo to x: ((Player X) - (SCROLL X)) y: ((Player Y) - (SCROLL Y))\n\ndefine Change Player Y by (speed y)\nchange [player y v] by (speed y)\nchange [in air? v] by (1)\nPosition Player\nrepeat until <not <touching (platforms v)?>>\n    if <(speed y) > [0]> then\n        change [player y v] by (-1)\n    else\n        change [player y v] by (1)\n        set [in air? v] to [0]\n    end\n    Position Player\n    set [speed y v] to [0]\nend\nif <touching (semi-solid v)?> then\n    switch costume to (semi-solid v)\n    if <<(Speed Y) > [0]> or <<key (down arrow v) pressed?> or <<(mouse y) < (y position)> and <mouse down?>>>> then\n        switch costume to (hitbox v)\n        stop [this script v]\n    end\n    repeat until <not <touching (semi-solid v)?>>\n        if <(speed y) > [0]> then\n            change [player y v] by (-1)\n        else\n            change [player y v] by (1)\n            set [in air? v] to [0]\n        end\n        Position Player\n        set [speed y v] to [0]\n    end\nend\nswitch costume to (hitbox v)\n\ndefine Animate Player\nif <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    switch costume to (right v)\n    if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n        switch costume to (right-up v)\n    end\n    stop [this script v]\nend\nif <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>> then\n    switch costume to (left v)\n    if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n        switch costume to (left-up v)\n    end\n    stop [this script v]\nend\nif <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n    switch costume to (up v)\n    stop [this script v]\nend\nswitch costume to (centre v)\n\ndefine Player Die\nrepeat (pick random (20) to (30))\n    change [ghost v] effect by (10)\n    create clone of (particles v)\nend\nhide\nwait (1) seconds\n\nwhen flag clicked\nbroadcast (Start Game v)\n\n@Platforms\n\nwhen I receive [setup v]\nswitch costume to (1 v)\nset [x v] to [0]\nset [y v] to [0]\nCreate Clone at [0] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [0] [150]\nCreate Clone at [0] [150]\nCreate Clone at [0] [150]\nCreate Clone at [0] [150]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nset [x v] to [-9999999]\n\ndefine Create Clone at (x) (y)\nchange [x v] by (x)\nchange [y v] by (y)\ncreate clone of (_myself_ v)\nnext costume\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Semi-Solid\n\nwhen I receive [setup v]\nswitch costume to (1 v)\nset [x v] to [0]\nset [y v] to [0]\nCreate Clone at [0] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [0] [150]\nCreate Clone at [0] [150]\nCreate Clone at [0] [150]\nCreate Clone at [0] [150]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [360] [150]\nCreate Clone at [0] [100]\nCreate Clone at [0] [100]\nset [x v] to [-9999999]\n\ndefine Create Clone at (x) (y)\nchange [x v] by (x)\nchange [y v] by (y)\ncreate clone of (_myself_ v)\nnext costume\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\ngo to [back v] layer\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\ngo to [back v] layer\n\nwhen I receive [reset v]\ndelete this clone\n\n@Danger\n\nwhen I receive [setup v]\nswitch costume to (1 v)\nset [x v] to [0]\nset [y v] to [0]\nCreate Clone at [0] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [0] [150]\nCreate Clone at [0] [150]\nCreate Clone at [0] [150]\nCreate Clone at [0] [150]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nset [x v] to [-9999999]\n\ndefine Create Clone at (x) (y)\nchange [x v] by (x)\nchange [y v] by (y)\ncreate clone of (_myself_ v)\nnext costume\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Graphics\n\nwhen I receive [setup v]\nswitch costume to (1 v)\nset [x v] to [0]\nset [y v] to [0]\nCreate Clone at [0] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [0] [150]\nCreate Clone at [0] [150]\nCreate Clone at [0] [150]\nCreate Clone at [0] [150]\nCreate Clone at [480] [0]\nCreate Clone at [480] [0]\nCreate Clone at [360] [150]\nCreate Clone at [0] [100]\nCreate Clone at [0] [100]\nset [x v] to [-9999999]\n\ndefine Create Clone at (x) (y)\nchange [x v] by (x)\nchange [y v] by (y)\ncreate clone of (_myself_ v)\nnext costume\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\ngo to [back v] layer\ngo [forward v] (1) layers\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nbroadcast (Reset v) and wait\nbroadcast (Setup v) and wait\n\n@Particles\n\nwhen flag clicked\nset [x v] to [-99999999]\nhide\n\nwhen I start as a clone\nInitialise Particles\nrepeat (Sequence)\n    change [ghost v] effect by ((100) / (Sequence))\n    change size by (((Size) / (Sequence)) * (-1))\n    change [x v] by (Speed X)\n    change [y v] by (Speed Y)\n    Position ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\nend\ndelete this clone\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\n\ndefine Initialise Particles\nset [color v] effect to (pick random (0) to (50))\nswitch costume to (pick random (1) to (3))\nset size to (pick random (75) to (100)) %\nset [x v] to (([player x v] of [player v]) + (pick random (-10) to (10)))\nset [y v] to (([player y v] of [player v]) + (pick random (-10) to (10)))\nset [speed x v] to (pick random (-10) to (10))\nset [speed y v] to (pick random (-10) to (10))\nset [sequence v] to (pick random (10) to (20))\nset [size v] to (size)\nshow\n\n@Exit\n\nwhen I receive [setup v]\nSpawn Exit at [5310] [1050]\n\ndefine Spawn Exit at (x) (y)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen I receive [tick v]\nPosition ((X) - (SCROLL X)) ((Y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [status v] to [Win]\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\n@Notifications\n\nwhen I receive [setup v]\nhide\nswitch costume to (win v)\nset [clone? v] to [0]\nrepeat (2)\n    change [clone? v] by (1)\n    create clone of (_myself_ v)\n    next costume\nend\nset [clone? v] to []\nhide\n\nwhen I start as a clone\ngo to x: (0) y: (0)\nset size to (100) %\nset [ghost v] effect to (100)\nif <<(costume [name v]) = [Notification]> and <(Clone?) > []>> then\n    go to x: (0) y: (50)\n    set [ghost v] effect to (0)\n    forever\n        wait (pick random (5) to (10)) seconds\n        show\n        repeat until <(y position) < [6]>\n            change y by (((5) - (y position)) / (6))\n        end\n        wait (pick random (2) to (3)) seconds\n        repeat until <(y position) > [49.5]>\n            change y by (((y position) + (5)) / (5))\n        end\n        hide\n    end\nend\n\nwhen I receive [win v]\nif <(costume [name v]) = [Win]> then\n    if <(Clone?) > []> then\n        set [ghost v] effect to (100)\n        show\n        go to [front v] layer\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        wait (4) seconds\n        stop [all v]\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Thumbnail\n\nwhen I receive [tick v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\ngo to [front v] layer\nset size to (100) %\nshow\n\n