Being Red - A platformer/scroller

Instructions: W,A,D and Left, Right, Up to Move, Jump\n\nSpace to Jump To.\nGet to the door.

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\nset [level v] to [1]\n\nwhen I receive [start_game v]\nforever\n    play sound [Here Comes a Thought - Steven Universe Karaoke \[Official Instrumental\] \(320  kbps\).mp3 v] until done\nend\n\n@Thumbnail\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\nwhen flag clicked\nforever\n    if <(level) = [11]> then\n        stop [all v]\n    end\nend\n\nset [space v] to [0]\nchange [space v] by (1)\n\n@Game Intro\n\nwhen flag clicked\nset [intro_id v] to [0]\nhide\nbroadcast (intro v)\n\nwhen I receive [intro v]\nrepeat (2)\n    create clone of (_myself_ v)\n    change [intro_id v] by (1)\nend\n\nwhen I start as a clone\nif <(Intro_ID) = [1]> then\n    show\n    go to x: (0) y: (0)\n    go to [front v] layer\n    go [backward v] (999) layers\n    forever\n        if <(space) = [1]> then\n            switch costume to (1 v)\n        end\n        if <(space) = [2]> then\n            switch costume to (3 v)\n            wait until <key (space v) pressed?>\n            broadcast (start_game v)\n            wait until <not <key (space v) pressed?>>\n            stop [this script v]\n        end\n    end\nelse\n    if <(Intro_ID) = [2]> then\n        show\n        set [ghost v] effect to (100)\n        go to [front v] layer\n        go to x: (0) y: (0)\n        switch costume to (2 v)\n        wait (3.6) seconds\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        wait (2) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        wait (2) seconds\n        broadcast (start_game v)\n    else\n    end\nend\n\nwhen I receive [start_game v]\nstop [other scripts in sprite v]\nhide\n\n@Player\n\nwhen flag clicked\nset [scroll v] to [1]\ngo to x: (-175) y: (-122)\npoint in direction (90)\nset [y-velocity v] to [0]\nset [x-velocity v] to [0]\nhide\n\ndefine None\nset rotation style [left-right v]\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x-velocity v] by (running speed)\n    point in direction (90)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x-velocity v] by ((running speed) * (-1))\n    point in direction (-90)\nend\nset [x-velocity v] to ((X-Velocity) * (friction))\nchange x by (X-Velocity)\nif <touching (platform v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (platform v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (platform v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (X-Velocity) ) )\n            if <touching (platform v)?> then\n                repeat (10)\n                    change x by ((([abs v] of (X-Velocity) ) / (X-Velocity)) * (-1))\n                end\n            end\n        end\n        set [x-velocity v] to [0]\n    end\nend\nchange y by (Y-Velocity)\nif <touching (platform v)?> then\n    repeat ([ceiling v] of ([abs v] of (Y-Velocity) ) )\n        if <touching (platform v)?> then\n            change y by ((([abs v] of (Y-Velocity) ) / (Y-Velocity)) * (-1))\n        end\n    end\n    if <<(([abs v] of (Y-Velocity) ) / (Y-Velocity)) = [-1]> and <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>>> then\n        set [y-velocity v] to (jump/height)\n    else\n        set [y-velocity v] to [0]\n    end\nelse\n    change [y-velocity v] by (-1)\nend\nswitch costume to (idle v)\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    switch costume to (Walk)\nend\nif <(Y-Velocity) > [2]> then\n    switch costume to (jump v)\nend\nif <(Y-Velocity) < [-3]> then\n    switch costume to (fall v)\nend\nif <(scroll) = [2]> then\n    set [x-velocity v] to ((X-Velocity) * (friction))\n    switch costume to (idle v)\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n        switch costume to (Walk)\n    end\n    if <(Y-Velocity) > [2]> then\n        switch costume to (jump v)\n    end\n    if <(Y-Velocity) < [-3]> then\n        switch costume to (fall v)\n    end\n    set rotation style [left-right v]\n    change [scroll x v] by ((x position) * (-1))\n    change [scroll y v] by ((y position) * (-1))\n    go to x: (0) y: (0)\nend\n\nwhen flag clicked\nset [walk v] to [5]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [8]> then\n        set [walk v] to [5]\n    end\n    wait (0.1) seconds\nend\n\nwhen I receive [start_game v]\nwait (2.5) seconds\nswitch backdrop to (backdrop1 v)\nshow\nset [scroll v] to [1]\nforever\n    Platform (11.5) (-1) (0.7) (3)\nend\n\nwhen flag clicked\nforever\n    if <touching (door v)?> then\n        go to x: (-175) y: (-109)\n        point in direction (90)\n        change [level v] by (1)\n        broadcast (scroll set v)\n        set [y-velocity v] to [0]\n        set [x-velocity v] to [0]\n    end\n    if <touching (spikes v)?> then\n        if <(scroll) = [1]> then\n            go to x: (-175) y: (-109)\n            point in direction (90)\n            set [y-velocity v] to [0]\n            set [x-velocity v] to [0]\n        end\n        if <(scroll) = [2]> then\n            go to x: (0) y: (0)\n            point in direction (90)\n            set [y-velocity v] to [0]\n            set [x-velocity v] to [0]\n            set [scroll x v] to [0]\n            set [scroll y v] to [0]\n        end\n    end\nend\n\nwhen I receive [scroll set v]\nif <(level) = [8]> then\n    go to x: (-175) y: (-109)\nend\n\n@Platform\n\nwhen flag clicked\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [level v] to [1]\nset [scroll v] to [1]\nhide\n\nwhen I receive [start_game v]\nhide\nset [space v] to [2]\nwait (2.5) seconds\nshow\nforever\n    if <(scroll) = [2]> then\n        go to x: (scroll x) y: (scroll y)\n        switch costume to (level)\n    else\n        go to x: (0) y: (0)\n        switch costume to (level)\n    end\nend\n\nwhen I receive [scroll set v]\nset [scroll y v] to [0]\nset [scroll x v] to [0]\nif <(level) > [4]> then\n    set [scroll v] to [1]\nend\nif <(level) = [5]> then\n    set [scroll v] to [2]\nend\nif <(level) = [6]> then\n    set [scroll v] to [2]\nend\nif <(level) = [7]> then\n    set [scroll v] to [2]\nend\nif <(level) = [8]> then\n    set [scroll v] to [1]\nend\nif <(level) = [10]> then\n    set [scroll v] to [2]\nend\n\n@Spikes\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    go to x: (0) y: (0)\n    switch costume to (level)\nend\n\nwhen flag clicked\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [level v] to [1]\nset [scroll v] to [1]\n\nwhen I receive [start_game v]\nhide\nset [space v] to [2]\nwait (2.5) seconds\nshow\nforever\n    if <(scroll) = [2]> then\n        go to x: (scroll x) y: (scroll y)\n        switch costume to (level)\n    else\n        go to x: (0) y: (0)\n        switch costume to (level)\n    end\nend\n\n@Door\n\nwhen flag clicked\nhide\nset [level v] to [1]\nforever\n    go to x: (0) y: (0)\n    switch costume to (level)\nend\n\nwhen I receive [start_game v]\nhide\nset [space v] to [2]\nwait (2.5) seconds\nshow\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [level v] to [1]\nset [scroll v] to [1]\nforever\n    if <(scroll) = [2]> then\n        go to x: (scroll x) y: (scroll y)\n        switch costume to (level)\n    else\n        go to x: (0) y: (0)\n        switch costume to (level)\n    end\nend\n\n@Text\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    go [backward v] (88) layers\n    go to x: (0) y: (0)\n    switch costume to (level)\nend\n\nwhen I receive [start_game v]\nhide\nset [space v] to [2]\nwait (2.5) seconds\nshow\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [level v] to [1]\nset [scroll v] to [1]\nforever\n    if <(scroll) = [2]> then\n        go to x: (scroll x) y: (scroll y)\n        switch costume to (level)\n    else\n        go to x: (0) y: (0)\n        switch costume to (level)\n    end\nend\n\n@Scroller Screen\n\nwhen flag clicked\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [level v] to [1]\nset [scroll v] to [1]\nforever\n    go to x: (0) y: (0)\n    if <(scroll) = [2]> then\n        show\n    else\n        hide\n    end\nend\n\n