Marshmello Platformer


@Stage\n\nwhen flag clicked\nforever\n    play sound (pick random (1) to (7)) until done\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\nset volume to (100) %\nswitch costume to (costume1 v)\ngo to x: (-210) y: (-60)\nset [xvel v] to [0]\nset [yvel v] to [0]\nforever\n    if <key (right arrow v) pressed?> then\n        change [xvel v] by (1)\n    end\n    if <key (left arrow v) pressed?> then\n        change [xvel v] by (-1)\n    end\n    set [xvel v] to ((XVEL) * (0.9))\n    change x by (XVEL)\n    if <touching color (#010076)?> then\n        change y by (1)\n        if <touching color (#010076)?> then\n            change y by (1)\n            if <touching color (#010076)?> then\n                change y by (1)\n                if <touching color (#010076)?> then\n                    change y by (1)\n                    if <touching color (#010076)?> then\n                        change y by (1)\n                        if <touching color (#010076)?> then\n                            change x by ((XVEL) * (-1))\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                if <(XVEL) = [0]> then\n                                    set [xvel v] to [-5]\n                                else\n                                    set [xvel v] to [5]\n                                end\n                                set [yvel v] to [10]\n                            else\n                                set [xvel v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yvel v] by (-1)\n    change y by (YVEL)\n    if <touching color (#010076)?> then\n        change y by ((YVEL) * (-1))\n        set [yvel v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#010076)?> then\n        if <key (up arrow v) pressed?> then\n            set [yvel v] to [14]\n            start sound [Low Whoosh v]\n        end\n    end\n    if <touching color (#00fffc)?> then\n        if <key (up arrow v) pressed?> then\n            set [yvel v] to [8]\n        else\n            set [yvel v] to [-1.5]\n        end\n    end\n    if <touching color (#ffb500)?> then\n        start sound [quick dash v]\n        set [yvel v] to [19]\n    end\n    if <touching color (#f200ff)?> then\n        if <key (up arrow v) pressed?> then\n            set [yvel v] to [13]\n            start sound [quick dash v]\n        end\n    end\n    change y by (1)\nend\n\nwhen I receive [next level v]\ngo to x: (-210) y: (-60)\n\nwhen flag clicked\nshow variable [level v]\nforever\n    if <touching color (#ff0000)?> then\n        go to x: (-210) y: (-60)\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\nforever\n    go to (sprite1 v)\n    go to (sprite1 v)\n    go to (sprite1 v)\n    go to (sprite1 v)\nend\n\nwhen flag clicked\npoint in direction (90)\nset rotation style [left-right v]\nforever\n    if <(XVEL) > [0]> then\n        point in direction (90)\n    end\n    if <(XVEL) < [0]> then\n        point in direction (-90)\n    end\nend\n\nwhen flag clicked\nshow\nswitch costume to (costume39 v)\nforever\n    if <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> then\n        repeat until <(costume [number v]) = [18]>\n            next costume\n            if <key (up arrow v) pressed?> then\n                switch costume to (costume20 v)\n                wait (1) seconds\n                switch costume to (costume19 v)\n            end\n        end\n        switch costume to (costume39 v)\n    end\n    if <key (up arrow v) pressed?> then\n        switch costume to (costume20 v)\n        wait (1) seconds\n        switch costume to (costume39 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(x position) > [220]> then\n        broadcast (next level v)\n        wait (1) seconds\n    end\nend\n\nwhen I receive [win! v]\nhide\n\n@Sprite3\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    set [level v] to (costume [number v])\nend\n\nwhen I receive [next level v]\nnext costume\n\n@Sprite4\n\ndefine pen\nset pen size to (25)\nerase all\npen up\ngo to x: (-220) y: (-150)\npen down\ngo to x: (-220) y: (item ((hi) - (0)) of [list v])\npen up\ngo to x: (-180) y: (-150)\npen down\ngo to x: (-180) y: (item ((hi) - (1)) of [list v])\npen up\ngo to x: (-140) y: (-150)\npen down\ngo to x: (-140) y: ((item ((hi) - (2)) of [list v]) * (2))\npen up\ngo to x: (-100) y: (-150)\npen down\ngo to x: (-100) y: ((item ((hi) - (3)) of [list v]) * (2))\npen up\ngo to x: (-60) y: (-150)\npen down\ngo to x: (-60) y: ((item ((hi) - (4)) of [list v]) * (2))\npen up\ngo to x: (-20) y: (-150)\npen down\ngo to x: (-20) y: ((item ((hi) - (5)) of [list v]) * (2))\npen up\ngo to x: (20) y: (-150)\npen down\ngo to x: (20) y: ((item ((hi) - (6)) of [list v]) * (2))\npen up\ngo to x: (60) y: (-150)\npen down\ngo to x: (60) y: ((item ((hi) - (7)) of [list v]) * (2))\npen up\ngo to x: (100) y: (-150)\npen down\ngo to x: (100) y: ((item ((hi) - (8)) of [list v]) * (2))\npen up\ngo to x: (140) y: (-150)\npen down\ngo to x: (140) y: ((item ((hi) - (9)) of [list v]) * (2))\npen up\ngo to x: (180) y: (-150)\npen down\ngo to x: (180) y: ((item ((hi) - (10)) of [list v]) * (2))\npen up\ngo to x: (220) y: (-150)\npen down\ngo to x: (220) y: (item ((hi) - (11)) of [list v])\npen up\ngo to x: (-240) y: (-150)\npen down\ngo to x: (240) y: (-150)\n\nwhen flag clicked\ndelete (all) of [list v]\nerase all\npen up\nset pen color to (#9f00cb)\nhide\nforever\n    insert (loudness) at (last) of [list v] \n    go to x: (0) y: (0)\n    pen\n    set [hi v] to (length of [list v])\nend\n\nwhen [q v] key pressed\nstop [other scripts in sprite v]\n\n@Sprite5\n\nwhen flag clicked\nhide\ngo to x: (0) y: (-130)\nforever\n    if <(level) = [13]> then\n        point in direction (90)\n        go to x: (-50) y: (-130)\n        show\n        repeat until <not <(level) = [13]>>\n            turn right (3) degrees\n        end\n        hide\n    end\nend\n\nwhen flag clicked\nhide\ngo to x: (0) y: (-130)\nforever\n    if <(level) = [9]> then\n        point in direction (90)\n        go to x: (0) y: (-130)\n        show\n        repeat until <not <(level) = [9]>>\n            turn right (3) degrees\n        end\n        hide\n    end\nend\n\n@Sprite6\n\nwhen flag clicked\nhide\ngo to x: (0) y: (-130)\nforever\n    if <(level) = [13]> then\n        switch costume to (costume1 v)\n        point in direction (90)\n        go to x: (70) y: (80)\n        show\n        repeat until <not <(level) = [13]>>\n            turn left (3) degrees\n        end\n        hide\n    end\nend\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [17]> then\n        go to x: (0) y: (0)\n        point in direction (90)\n        switch costume to (costume2 v)\n        show\n        repeat until <not <(level) = [17]>>\n            turn left (5) degrees\n        end\n        hide\n    end\nend\n\n@Sprite7\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\ngo to [front v] layer\nhide\nforever\n    if <(level) = [21]> then\n        hide variable [level v]\n        broadcast (win! v)\n        show\n        forever\n            change [color v] effect by (3)\n        end\n    end\nend\n\n@Sprite8\n\nwhen flag clicked\nshow variable [time v]\nset [time v] to [0]\nforever\n    change [time v] by (0.2)\n    wait (0.1) seconds\nend\n\nwhen I receive [win! v]\nstop [other scripts in sprite v]\n\n