Fall | A Platformer

Instructions: I moved to @-Waypoint-

@Stage\n\nwhen I receive [start v]\nforever\n    play sound [JJD - Adventure v] until done\nend\n\nwhen I receive [start v]\nset volume to (0) %\nrepeat (20)\n    change volume by (5)\n    wait (0.05) seconds\nend\n\n@Intro\n\nwhen flag clicked\ngo to [front v] layer\nshow\nswitch costume to (blank v)\ngo to x: (0) y: (0)\nset size to (0) %\nwait (0.1) seconds\nrepeat (2)\n    go to [front v] layer\n    switch costume to (blank v)\n    change size by (((100) - (size)) / (10))\n    switch costume to (logo :\) v)\nend\nstart sound [High Whoosh v]\nrepeat (38)\n    go to [front v] layer\n    switch costume to (blank v)\n    change size by (((100) - (size)) / (10))\n    switch costume to (logo :\) v)\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nwait (2) seconds\nbroadcast (Start v)\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen flag clicked\npoint in direction (-90)\nwait (0.15) seconds\nforever\n    turn right (((90) - (direction)) / (8)) degrees\nend\n\n@Player\n\nwhen I receive [next level v]\nReset Scene\n\nwhen flag clicked\ngo to [front v] layer\nshow\nset size to (100) %\nset rotation style [left-right v]\nset [scene v] to [1]\nbroadcast (Next Level v)\n\nforever\n    broadcast (Run v)\nend\n\nwhen I receive [run v]\n\nwhen flag clicked\nforever\n    controls x\n    set [x velocity v] to ((X Velocity) * (0.85))\n    change x by (X Velocity)\n    walljumping\n    controls y\n    change [y velocity v] by (-1)\n    change y by (Y Velocity)\n    if <touching (ground v)?> then\n        change y by ((Y Velocity) - ((Y Velocity) * (2)))\n        set [y velocity v] to [0]\n    end\n    change y by (-1)\n    if <<touching (ground v)?> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        set [y velocity v] to [15]\n    end\n    change y by (1)\n    next scene\n    if <touching (spikes v)?> then\n        Reset Scene\n        broadcast (You died XD v)\n    else\n        if <touching (lava v)?> then\n            Reset Scene\n            broadcast (You died XD v)\n        end\n        if <touching (spikes v)?> then\n            Reset Scene\n            broadcast (You died XD v)\n        end\n    end\nend\n\ndefine Reset Scene\nset [x velocity v] to [0]\nset [y velocity v] to [0]\ngo to x: (-216) y: (40)\n\nbroadcast (Reset v)\n\nbroadcast (Reset v)\n\nbroadcast (Reset v)\n\nbroadcast (Reset v)\n\ndefine controls x\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n    change [x velocity v] by (-1.5)\n    point in direction (-90)\nend\nif <<<mouse down?> and <(mouse x) > (x position)>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    change [x velocity v] by (1.5)\n    point in direction (90)\nend\n\ndefine walljumping\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (1)\nend\n\ndefine controls y\nif <touching (ground v)?> then\n    change y by (-4)\n    change x by ((X Velocity) * (-1))\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        if <(X Velocity) > [0]> then\n            set [x velocity v] to [-10]\n        else\n            set [x velocity v] to [10]\n        end\n        set [y velocity v] to [15]\n    else\n        set [x velocity v] to [0]\n    end\nend\n\ndefine next scene\nif <(x position) > [239]> then\n    broadcast (Bruh cool v)\n    broadcast (Next Level v) and wait\n    change [scene v] by (1)\nend\n\nwhen I receive [reset v]\ngo to x: (-216) y: (39)\n\nwhen flag clicked\nforever\n    switch costume to ([costume name v] of [thanks v])\nend\n\n@Player Trail\n\nwhen flag clicked\nbroadcast (Green Flag v)\nshow\nforever\n    point in direction ([direction v] of [player v])\n    switch costume to ([costume name v] of [player v])\n    go to x: ([x position v] of [player v]) y: ([y position v] of [player v])\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nrepeat (10)\n    change [ghost v] effect by (21)\nend\ndelete this clone\n\nwhen I receive [scroll v]\nhide\ndelete this clone\n\nwhen flag clicked\nforever\n    switch costume to ([costume name v] of [thanks v])\nend\n\n@Ground\n\nwhen flag clicked\nswitch costume to (Scene)\nforever\n    if <not <(costume [number v]) = [11]>> then\n        if <not <([y position v] of [player v]) > [179.9]>> then\n            switch costume to (Scene)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [11]> then\n        broadcast (eliminate skip v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [11]> then\n        if <([y position v] of [player v]) > [179.9]> then\n            switch costume to (12 v)\n        end\n    end\nend\n\n@Spikes\n\nwhen flag clicked\nforever\n    switch costume to (Scene)\nend\n\n@Thanks\n\nwhen flag clicked\nhide\nwait (1) seconds\nwait until <(Actions \(love/fave\)) = [2]>\nwait (1) seconds\nshow\ngo to x: (0) y: (50)\nreset timer\ngo to [front v] layer\nswitch costume to (red v)\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\nswitch costume to (blue v)\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\nswitch costume to (red v)\n\n@detector\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nset [actions \(love/fave\) v] to [0]\nforever\n    set [touching v] to [none]\n    Detect [love] at [-201] [-220]\n    Detect [fave] at [-201] [-220]\nend\n\ndefine Detect (thing) at (x) (y)\nswitch costume to (empty v)\nset size to (27000) %\ngo to x: (x) y: (y)\nset size to (100) %\nswitch costume to (thing)\nif <touching (mouse-pointer v)?> then\n    set [touching v] to (costume [name v])\nend\n\nwhen flag clicked\nforever\n    wait until <(touching) = [love]>\n    wait (0.2) seconds\n    if <(touching) = [love]> then\n        change [actions \(love/fave\) v] by (1)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    wait until <(touching) = [fave]>\n    wait (0.2) seconds\n    if <(touching) = [fave]> then\n        change [actions \(love/fave\) v] by (1)\n        stop [this script v]\n    end\nend\n\n@Love and fave reminder\n\nwhen flag clicked\nwait (2.5) seconds\ngo to [front v] layer\n\nwhen flag clicked\nhide\nwait (1) seconds\nforever\n    if <(Actions \(love/fave\)) < [2]> then\n        switch costume to (costume1 v)\n        go to x: (0) y: (150)\n        show\n        go to [front v] layer\n        repeat (11)\n            change y by (-6)\n        end\n        repeat (7)\n            change y by (3)\n        end\n        repeat (6)\n            change y by (-2)\n        end\n        wait (5) seconds\n        repeat (17)\n            change y by (7)\n        end\n        hide\n        wait (pick random (10) to (20)) seconds\n    else\n        stop [this script v]\n    end\nend\n\n@Thumb\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n