Wizard quest- A platformer! #Games #Art #pixel

Instructions: #Bill

@Stage\n\n@Sprite1\n\nwhen flag clicked\nhide\n\n@Terrain\n\nwhen flag clicked\n\nwhen flag clicked\nforever\n    switch costume to (x)\nend\n\ngo to x: (0) y: (0)\nset size to (100) %\nshow\ngo to [front v] layer\nswitch costume to (1 v)\nif <(username) = [Bill-0]> then\n    next costume\nend\n\nwhen flag clicked\nset [x v] to [1]\n\nshow\n\nwhen flag clicked\nwait (2) seconds\nshow\n\nwhen flag clicked\nwait (5) seconds\nshow\n\nwhen I receive [bye bye v]\nshow\n\nwhen flag clicked\nshow\n\n@Sprite2\n\nwhen flag clicked\nhide\n\n@Sprite3\n\nwhen flag clicked\nforever\n    play sound [A Step Sideways v] until done\nend\n\nwhen [m v] key pressed\n\nset volume to (0) %\n\n@Player3\n\nwhen flag clicked\nshow\n\nwhen flag clicked\nshow\n\nwhen flag clicked\ngo to x: (-172) y: (-90)\nset [x vel v] to [0]\nset [y vel v] to [0]\nforever\n    physics (11) (0.8) (0) (1) (11) (8)\nend\n\nrepeat ([abs v] of (y vel) )\n    if <touching (terrain v)?> then\n        change y by (((y vel) / ([abs v] of (y vel) )) * (-1))\n    end\nend\nif <touching (terrain v)?> then\n    change y by (y vel)\nend\n\ndefine physics (jump height) (friction) (ceiling cling?) (slopes?) (wall jump horizontal power) (wall jump vertical power)\nchange y by (y vel)\nif <touching (terrain v)?> then\n    repeat ([abs v] of (y vel) )\n        if <touching (terrain v)?> then\n            change y by (((y vel) / ([abs v] of (y vel) )) * (-1))\n        end\n    end\n    if <touching (terrain v)?> then\n        change y by (y vel)\n    end\n    if <<<(y vel) < [0.01]> or <(ceiling cling?) = [1]>> and <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n        set [y vel v] to (jump height)\n    else\n        set [y vel v] to [0]\n    end\nelse\n    change [y vel v] by (-1)\nend\nset rotation style [left-right v]\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    point in direction (90)\n    change [x vel v] by (1)\nend\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    switch costume to (costume6 v)\n    point in direction (90)\n    change [x vel v] by (-1)\nend\nchange x by (x vel)\nif <touching (terrain v)?> then\n    if <(slopes?) = [1]> then\n        set [old_y v] to (y position)\n        repeat (([abs v] of (x vel) ) + (1))\n            if <touching (terrain v)?> then\n                change y by (1)\n            end\n        end\n        if <touching (terrain v)?> then\n            set y to (old_y)\n            repeat ([ceiling v] of ([abs v] of (x vel) ) )\n                if <touching (terrain v)?> then\n                    change x by (((x vel) / ([abs v] of (x vel) )) * (-1))\n                end\n            end\n            if <touching (terrain v)?> then\n                change x by (([ceiling v] of ([abs v] of (x vel) ) ) * ((x vel) / ([abs v] of (x vel) )))\n            end\n            set [x vel v] to [0]\n        end\n    else\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <touching (terrain v)?> then\n                change x by (((x vel) / ([abs v] of (x vel) )) * (-1))\n            end\n        end\n        if <touching (terrain v)?> then\n            change x by (([ceiling v] of ([abs v] of (x vel) ) ) * ((x vel) / ([abs v] of (x vel) )))\n        end\n        set [x vel v] to [0]\n    end\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <<not <(wall jump horizontal power) = [0]>> and <not <(wall jump vertical power) = [0]>>>> then\n        change y by (-1)\n        if <touching (terrain v)?> then\n            change y by (1)\n        else\n            change y by (1)\n            change x by (1)\n            if <<touching (terrain v)?> and <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n                set [x vel v] to (([abs v] of (wall jump horizontal power) ) * (-1))\n                set [y vel v] to (wall jump vertical power)\n            end\n            change x by (-2)\n            if <<touching (terrain v)?> and <<key (a v) pressed?> or <key (left arrow v) pressed?>>> then\n                set [x vel v] to ([abs v] of (wall jump horizontal power) )\n                set [y vel v] to (wall jump vertical power)\n            end\n            change x by (1)\n        end\n    end\nend\nset [x vel v] to ((x vel) * (friction))\n\nset [old_y v] to (y position)\nrepeat (([abs v] of (x vel) ) + (1))\n    if <touching (terrain v)?> then\n        change y by (1)\n    end\nend\nif <touching (terrain v)?> then\n    set y to (old_y)\n    repeat ([ceiling v] of ([abs v] of (x vel) ) )\n        if <touching (terrain v)?> then\n            change x by (((x vel) / ([abs v] of (x vel) )) * (-1))\n        end\n    end\n    if <touching (terrain v)?> then\n        change x by (([ceiling v] of ([abs v] of (x vel) ) ) * ((x vel) / ([abs v] of (x vel) )))\n    end\n    set [x vel v] to [0]\nend\n\nwhen flag clicked\nforever\n    if <(x position) = [239]> then\n        go to x: (-172) y: (-90)\n        change [x v] by (1)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#ff0000)?> then\n        go to x: (-182) y: (-152)\n    end\nend\n\nset x to (-219)\nchange y by (-140)\n\nwhen [space v] key pressed\nnext costume\n\nwhen flag clicked\ngo to x: (-196) y: (-96)\n\nwhen flag clicked\nif <touching color (#e6e030)?> then\n    go to x: (-238) y: (-167)\nend\n\ngo to x: (-172) y: (-90)\nset [x vel v] to [0]\nset [y vel v] to [0]\nforever\n    physics (11) (0.8) (0) (1) (11) (8)\nend\n\nwhen [down arrow v] key pressed\nswitch costume to (costume5 v)\n\nwhen flag clicked\nforever\n    if <(y position) = [-186]> then\n        go to x: (-172) y: (-90)\n    end\nend\n\nshow\n\nwhen flag clicked\nforever\n    if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n        switch costume to (costume1 v)\n        wait (0.06) seconds\n        switch costume to (costume2 v)\n        wait (0.06) seconds\n        switch costume to (costume5 v)\n        wait (0.06) seconds\n        switch costume to (costume3 v)\n        wait (0.06) seconds\n        switch costume to (costume4 v)\n    end\nend\n\nnext costume\n\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    next costume\n    wait (0.06) seconds\nend\n\nnext costume\nswitch costume to (costume3 v)\nnext costume\nswitch costume to (costume4 v)\n\nwhen flag clicked\nforever\n    play sound [Mishap v] until done\nend\n\nwhen [space v] key pressed\nstop all sounds\nset volume to (0) %\n\nset volume to (0) %\n\n