Mario Cube - Scrolling Platformer

Instructions: Welcome To Treasurer! \nHuge Inspo from @-PandaMC-\nControls\n- Arrow Keys or WASD to move\n- Up Arrow To Jump\n- Dodge The Dangerous Things!\n- Find The Pirate's Treasure\n\nThere are currently 12 levels (short I know!) \n\nMusic: Summertime - K-2\n\nMe for the rest! (tell me if I used something of yours, I will be sure to add it here if I did miss anything!)

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nset [level :d v] to [1]\nforever\n    switch backdrop to (level :D)\nend\n\nwhen flag clicked\nforever\n    play sound [Imagine Dragons - Thunder \(Lyrics\) v] until done\nend\n\nwhen [space v] key pressed\nchange [level :d v] by (1)\n\nwhen [m v] key pressed\nset volume to (0) %\n\nwhen [u v] key pressed\nset volume to (100) %\n\n@thumb\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nchange [ghost v] effect by (100)\n\n@lightning\n\nwhen flag clicked\nforever\n    wait (.1) seconds\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nshow\ngo to x: (70) y: (165)\nforever\n    change y by (-1)\nend\n\nwhen I start as a clone\ngo to (random position v)\nswitch costume to (pick random (1) to (2))\nforever\n    change y by (-1)\nend\n\nwhen flag clicked\nforever\n    if <(y position) < [-150]> then\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nwait (2) seconds\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <touching (mouse-pointer v)?> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nforever\n    wait (.1) seconds\n    go to [front v] layer\n    wait (.1) seconds\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\n@player\n\ndefine Platformer engine\nchange [y v] by (-0.5)\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x v] by (-0.8)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x v] by (0.8)\nend\nset [x v] to ((x) * (0.9))\nchange x by (x)\nif <touching (ground v)?> then\n    change y by (1)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (-6)\n                        change x by ((x) * (-1))\n                        if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                            set [y v] to [10]\n                            if <(x) > [0]> then\n                                set [x v] to [-10]\n                            else\n                                set [x v] to [10]\n                            end\n                        else\n                            set [x v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (y)\nif <touching (ground v)?> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\nend\nchange y by (-0.5)\nif <<touching (ground v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n    set [y v] to [10]\nend\nchange y by (0.5)\nif <(x position) > [200]> then\n    change [level :d v] by (1)\n    go to x: (x \(spawn\)) y: (y \(spawn\))\nend\nif <touching (trampoline v)?> then\n    set [y v] to [15]\nend\nif <[-195] > (y position)> then\n    go to x: (x \(spawn\)) y: (y \(spawn\))\nend\nif <touching (obstacles v)?> then\n    go to x: (x \(spawn\)) y: (y \(spawn\))\nend\n\nwhen flag clicked\nset [level :d v] to [1]\npoint in direction (90)\nset [x \(spawn\) v] to [-164]\nset [y \(spawn\) v] to [-82]\ngo to x: (x \(spawn\)) y: (y \(spawn\))\nshow\nset size to (50) %\nset [x v] to [0]\nset [y v] to [0]\nforever\n    Platformer engine\nend\n\nwhen flag clicked\nswitch costume to (normal v)\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (right v)\n    end\n    if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n        switch costume to (up v)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (left v)\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Easter Egg! v)\n\nwhen flag clicked\nforever\n    if <(y position) < [-128]> then\n        go to x: (x position) y: (-128)\n    end\nend\n\n@ground\n\nwhen flag clicked\nswitch costume to (costume1 v)\nshow\ngo to x: (0) y: (0)\nset [level :d v] to [1]\nforever\n    switch costume to (level :D)\nend\n\n@obstacles\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset [level :d v] to [1]\nforever\n    switch costume to (level :D)\nend\n\n@trampoline\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset [level :d v] to [1]\nforever\n    switch costume to (level :D)\nend\n\n@light\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nforever\n    wait (pick random (1) to (10)) seconds\n    show\n    change [ghost v] effect by (10)\n    wait (.03) seconds\n    clear graphic effects\n    hide\nend\n\n@clouds!\n\nwhen I start as a clone\nset [ghost v] effect to (pick random (20) to (40))\n\nwhen flag clicked\nset x to (190)\nhide\n\nwhen I start as a clone\nshow\nglide (pick random (4) to (6)) secs to x: (-284) y: (y position)\ndelete this clone\n\nwhen flag clicked\nforever\n    set y to (pick random (100) to (120))\n    create clone of (_myself_ v)\n    wait (pick random (2) to (3)) seconds\nend\n\nclear graphic effects\n\ngo to [front v] layer\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen I receive [easter egg! v]\nhide\ngo to x: (-1) y: (-43)\nshow\nglide (.5) secs to x: (0) y: (0)\nrepeat (10)\n    wait (.2) seconds\n    change [color v] effect by (25)\nend\nglide (.5) secs to x: (-1) y: (-43)\nhide\n\n