₁ ⋮ Pastel City - A platformer


@Stage\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [start v]\nset [ghost v] effect to (0)\nswitch backdrop to (backdrop1 v)\nforever\n    play sound [Bowser's Galaxy Generator v] until done\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen flag clicked\nbroadcast (Start v)\n\n@Player\n\ndefine Platform Physics (speed) (friction) (jump height)\nset rotation style [left-right v]\nchange [y vel v] by (-1)\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [x vel v] by (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 ((speed) * (-1))\nend\nset [x vel v] to ((X Vel) * (friction))\nchange x by (X Vel)\nset [slope v] to [0]\nif <touching (level v)?> then\n    repeat until <<not <touching (level v)?>> or <(slope) = [-8]>>\n        change [slope v] by (-1)\n        change y by (1)\n    end\nend\nif <touching (level v)?> then\n    change y by (slope)\n    repeat until <not <touching (level v)?>>\n        change x by ((([abs v] of (X Vel) ) / (X Vel)) * (-1))\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        set [y vel v] to [11.5]\n        if <(X Vel) > [0]> then\n            set [x vel v] to [-6]\n        else\n            set [x vel v] to [6]\n        end\n    else\n        set [x vel v] to [0]\n    end\nend\nchange y by (Y Vel)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((([abs v] of (Y Vel) ) / (Y Vel)) * (-1))\n    end\n    set [y vel v] to [0]\nend\nchange y by (-1)\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> and <touching (level v)?>> then\n    set [y vel v] to [13]\nend\nchange y by (1)\n\nwhen I receive [start v]\nshow\nset [level v] to [1]\npoint in direction (90)\nswitch costume to (player v)\nset [x vel v] to [0]\nset [y vel v] to [0]\ngo to x: (-215) y: (-30)\nrepeat until <(costume [number v]) = [2]>\n    Platform Physics [1] [0.9] [11]\nend\nforever\n    Platform Physics [2] [0.9] [22]\nend\n\nwhen I receive [start v]\nforever\n    if <(x position) > [210]> then\n        go to x: (-215) y: (-30)\n        change [level v] by (1)\n        broadcast (Next v)\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <<touching (spikes v)?> or <touching (lava v)?>> then\n        set [x vel v] to [0]\n        set [y vel v] to [0]\n        go to x: (-215) y: (-30)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    repeat (10)\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nrepeat (10)\n    change [ghost v] effect by (10)\n    change [color v] effect by (25)\nend\ndelete this clone\n\n@level\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\ngo to [front v] layer\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [start v]\nshow\n\n@spikes\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\nforever\n    switch costume to (Level)\n    change [color v] effect by (2)\nend\n\nwhen I receive [start v]\nshow\n\n@Lava\n\nwhen I receive [start v]\nshow\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\nforever\n    switch costume to (Level)\nend\n\ngo to [back v] layer\n\n@Thumbnail\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@cute-pastel-colorful-rainbow-spectrum-260nw-304348133\n\n@Sprite1\n\nwhen flag clicked\nforever\n    hide\n    go to x: (223) y: (35)\n    wait (20) seconds\n    show\n    repeat (1)\n        create clone of (_myself_ v)\n    end\n    hide\nend\n\nwhen I start as a clone\nglide (1) secs to x: (40) y: (-16)\nrepeat (10)\n    change [ghost v] effect by (25)\n    change [color v] effect by (25)\nend\nhide\ndelete this clone\n\n@Sprite2\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nforever\n    go to [front v] layer\n    switch costume to (Level)\nend\n\n@Sprite3\n\nwhen flag clicked\ngo to [back v] layer\ngo [forward v] (1) layers\nforever\n    go to x: ((mouse x) / (20)) y: ((mouse y) / (20))\nend\n\n@Sprite4\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    go to x: ((mouse x) / (50)) y: ((mouse y) / (50))\nend\n\n@detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nbroadcast (Message v)\nshow\ngo to [front v] layer\ngo to x: (0) y: (50)\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n