Pixel Dash! (Platformer)

Instructions: Pixel Dash! \nThe objective is to get to the blue crystal.\nTry to beat all 10 levels!\nThis game uses rendered graphics so it will be a bit laggy at the start...\nUp arrow to jump. Avoid the orange spikes!!!\n\nHave fun!

@Stage\n\nwhen flag clicked\nforever\n    play sound [Epic 8bit v] until done\nend\n\nwhen flag clicked\nforever\n    set [attempts show v] to (join [Attempt ] (Attempts))\n    set [level show v] to (join [Level ] (Level))\n    set [highscore show v] to (join [HI: ] (join (☁ Highscore) [ attempts]))\nend\n\n@Render Tiles\n\ndefine render\nclear graphic effects\nhide\ngo to x: (-232) y: (-158)\nset size to (100) %\nshow\nerase all\nrepeat (23)\n    repeat (30)\n        switch costume to (render v)\n        if <touching color (#663b00)?> then\n            switch costume to (brown  v)\n            stamp\n        else\n            if <touching color (#00cc44)?> then\n                switch costume to (brown no grass v)\n                stamp\n            else\n                if <touching color (#009933)?> then\n                    switch costume to (brown w grass v)\n                    stamp\n                else\n                    if <touching color (#009933)?> then\n                        switch costume to (brown w grass v)\n                        stamp\n                    else\n                        if <touching color (#666666)?> then\n                            switch costume to (grey up spike v)\n                            stamp\n                        else\n                            if <touching color (#a5a3f4)?> then\n                                switch costume to (crystal v)\n                                stamp\n                            else\n                                if <touching color (#cccccc)?> then\n                                    switch costume to (grey  v)\n                                    stamp\n                                else\n                                    if <touching color (#003fff)?> then\n                                        switch costume to (grey down spike v)\n                                        stamp\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change x by (16)\n    end\n    set x to (-232)\n    change y by (16)\nend\nhide\nbroadcast (hide v)\n\nwhen flag clicked\nset [level v] to [1]\nerase all\nwait (0.1) seconds\nrender\n\nwhen I receive [next level and render v]\nchange [level v] by (1)\nerase all\nwait (0.1) seconds\nrender\n\nwhen flag clicked\nforever\n    set [mousex v] to (mouse x)\n    set [mousey v] to (mouse y)\nend\n\n@Level \n\nwhen I receive [hide v]\nset [ghost v] effect to (100)\n\nwhen I receive [next level and render v]\nset [ghost v] effect to (0)\nnext costume\n\nwhen flag clicked\nswitch costume to (costume9 v)\nset size to (1600) %\nset [ghost v] effect to (0)\ngo to x: (0) y: (6.5)\nclear graphic effects\nforever\n    if <(costume [number v]) = [11]> then\n        hide variable [level show v]\n        if <(Attempts) < (☁ Highscore)> then\n            set [☁ highscore v] to (Attempts)\n        end\n    end\nend\n\n@Hitbox\n\nwhen flag clicked\nhide\n\nwhen I receive [next level and render v]\nhide\n\nwhen I receive [hide v]\nset [ghost v] effect to (100)\nshow\nset [y vel v] to [0]\nset [x vel v] to [0]\nset size to (50) %\ngo to x: (-215) y: (-147)\npoint in direction (90)\nwait (0.5) seconds\nrepeat until <touching color (#ff9400)?>\n    if <(x position) < [-235]> then\n        set x to (-235)\n    end\n    if <(x position) > [235]> then\n        set x to (235)\n    end\n    if <key (right arrow v) pressed?> then\n        change [x vel v] by (1)\n    end\n    if <key (left arrow v) pressed?> then\n        change [x vel v] by (-1)\n    end\n    set [x vel v] to ((x vel) * (0.8))\n    change [y vel v] by (-1)\n    change x by (x vel)\n    if <touching (level  v)?> then\n        change y by (1)\n        if <touching (level  v)?> then\n            change y by (1)\n            if <touching (level  v)?> then\n                change y by (1)\n                if <touching (level  v)?> then\n                    change y by (1)\n                    if <touching (level  v)?> then\n                        change y by (1)\n                        if <touching (level  v)?> then\n                            change x by ((x vel) * (-1))\n                            change y by (-5)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (y vel)\n    if <touching (level  v)?> then\n        reverse\n        set [y vel v] to [0]\n    end\n    if <(y position) < [-160]> then\n        set [y vel v] to [0]\n        go to x: (-215) y: (-147)\n    end\n    change y by (-1)\n    if <touching (level  v)?> then\n        if <key (up arrow v) pressed?> then\n            set [y vel v] to [12]\n            start sound [Jump v]\n        end\n    end\n    change y by (1)\n    if <touching color (#ff9400)?> then\n        start sound [low tom v]\n        change [attempts v] by (1)\n        broadcast (hide v)\n    end\n    if <touching color (#00ffff)?> then\n        set [y vel v] to [0]\n        go to x: (-215) y: (-147)\n        set [x vel v] to [0]\n        point in direction (90)\n        broadcast (next level and render v)\n    end\nend\n\ndefine reverse\nif <(y vel) > [0]> then\n    repeat until <not <touching (level  v)?>>\n        change y by (-1)\n    end\nelse\n    repeat until <not <touching (level  v)?>>\n        change y by (1)\n    end\nend\n\nchange y by ((y vel) * (-1))\n\n@Ninja Turtle2\n\nwhen I receive [hide v]\nshow variable [level show v]\nshow variable [attempts show v]\nshow variable [highscore show v]\nshow\nset size to (50) %\npoint in direction (90)\nwait (0.5) seconds\nrepeat until <touching color (#ff9400)?>\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n    end\nend\nbroadcast (hide v)\n\nwhen I receive [hide v]\nswitch costume to (nt v)\nwait (1) seconds\nforever\n    if <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> then\n        switch costume to (nt2 v)\n        wait (0.2) seconds\n        switch costume to (nt3 v)\n        wait (0.2) seconds\n    else\n        switch costume to (nt v)\n    end\nend\n\nwhen I receive [next level and render v]\nhide\n\nwhen flag clicked\nhide variable [level show v]\nhide variable [attempts show v]\nhide variable [highscore show v]\nhide\nset [attempts v] to [1]\nforever\n    go to (hitbox v)\nend\n\n