The Hot Steel ball - a platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (screen v)\nset volume to (20) %\nwait until <key (q v) pressed?>\nforever\n    play sound [Vexento - Occupy v] until done\nend\n\nwhen I receive [next level v]\nnext backdrop\n\nwhen flag clicked\nwait until <key (q v) pressed?>\nwait until <not <key (q v) pressed?>>\nforever\n    if <key (q v) pressed?> then\n        if <(volume) = [20]> then\n            set volume to (0) %\n        else\n            set volume to (20) %\n        end\n        wait until <not <key (q v) pressed?>>\n    end\nend\n\n@Player\n\nwhen flag clicked\nhide\nset [x v] to [0]\nset [y v] to [0]\nset [last v] to [0]\nset [on wall v] to [0]\nset [editing v] to [0]\nset [respawn v] to [0]\nset [tell time v] to [0]\n\nwhen flag clicked\nforever\n    if <<(WASD) = [2]> and <(editing) = [1]>> then\n        go to x: (-185) y: (0)\n        wait until <(editing) = [0]>\n        set [x v] to [0]\n        set [y v] to [0]\n        set [last v] to [0]\n        set [on wall v] to [0]\n    end\n    change x by (X)\n    change y by (Y)\nend\n\nwhen flag clicked\nforever\n    if <(Y) < [-15]> then\n        set [y v] to [-15]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(X) < [0]> then\n        set [last v] to [-1]\n    end\n    if <(X) > [0]> then\n        set [last v] to [1]\n    end\nend\n\nwhen I receive [begin v]\ngo to x: (-185) y: (0)\nshow\nforever\n    if <<(WASD) = [2]> and <(editing) = [1]>> then\n        wait until <(editing) = [0]>\n    end\n    if <<<(WASD) > [0]> and <<<<key (a v) pressed?> or <key (left arrow v) pressed?>> and <<key (d v) pressed?> or <key (right arrow v) pressed?>>> or <not <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<key (a v) pressed?> or <key (left arrow v) pressed?>>>>>> or <<(WASD) = [0]> and <<(Loudness) = [0]> or <(Loudness) > [24]>>>> then\n        if <(X) = [0]> then\n        else\n            if <(X) < [0]> then\n                change [x v] by (1)\n            else\n                change [x v] by (-1)\n            end\n        end\n    else\n        if <<<(WASD) > [0]> and <<key (a v) pressed?> or <key (left arrow v) pressed?>>> or <<(WASD) = [0]> and <<(Loudness) > [7]> and <(Loudness) < [25]>>>> then\n            if <(X) < [-6]> then\n            else\n                if <(On wall) = [0]> then\n                    change [x v] by (-1)\n                else\n                    Wall jump (-5)\n                end\n            end\n        end\n        if <<<(WASD) > [0]> and <<key (d v) pressed?> or <key (right arrow v) pressed?>>> or <<(WASD) = [0]> and <<(Loudness) > [0]> and <(Loudness) < [8]>>>> then\n            if <(X) > [6]> then\n            else\n                if <(On wall) = [0]> then\n                    change [x v] by (1)\n                else\n                    Wall jump (5)\n                end\n            end\n        end\n    end\n    if <not <touching color (#000000)?>> then\n        change [y v] by (-1)\n        set [on wall v] to [0]\n    end\n    if <touching color (#000000)?> then\n        set [on air from jump v] to [0]\n        change [y v] by ((Y) * (-1))\n        if <<<<(WASD) > [0]> and <<key (w v) pressed?> or <key (up arrow v) pressed?>>> or <<(WASD) = [0]> and <<(Loudness) > [4]> and <(Loudness) < [13]>>>> and <(on air from jump) = [0]>> then\n            set [on air from jump v] to [1]\n            set [y v] to [10]\n        end\n    end\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (1)\n                            if <touching color (#000000)?> then\n                                change y by (1)\n                                if <touching color (#000000)?> then\n                                    change y by (1)\n                                    if <touching color (#000000)?> then\n                                        change y by (1)\n                                        if <touching color (#000000)?> then\n                                            change y by (1)\n                                            if <touching color (#000000)?> then\n                                                change y by (1)\n                                                if <touching color (#000000)?> then\n                                                    change y by (1)\n                                                    if <touching color (#000000)?> then\n                                                        change y by (1)\n                                                        if <touching color (#000000)?> then\n                                                            change y by (1)\n                                                            if <touching color (#000000)?> then\n                                                                change y by (1)\n                                                                if <touching color (#000000)?> then\n                                                                    change y by (1)\n                                                                    if <touching color (#000000)?> then\n                                                                        change y by (-10)\n                                                                        broadcast (wall v)\n                                                                        set [on wall v] to [1]\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <<touching color (#ff0000)?> or <key (r v) pressed?>> then\n        set [respawn v] to [1]\n        set [x v] to [0]\n        set [y v] to [0]\n        go to x: (-185) y: (0)\n        wait (0.01) seconds\n        set [respawn v] to [0]\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <<(WASD) = [2]> and <(editing) = [1]>> then\n        wait until <(editing) = [0]>\n    end\nend\n\ndefine None\nif <(On wall) = [1]> then\n    if <(last) > [0]> then\n        set [x v] to (x)\n    end\n    if <(last) < [0]> then\n        set [x v] to (x)\n    end\nend\n\nwhen I receive [wall v]\nif <(last) > [0]> then\n    Touching wall (-1) Back (23)\nend\n\nwhen I receive [wall v]\nif <(last) < [0]> then\n    Touching wall (1) Back (-23)\nend\n\ndefine None\nif <touching color (#000000)?> then\n    change x by (go1back)\n    if <touching color (#000000)?> then\n        change x by (go1back)\n        if <touching color (#000000)?> then\n            change x by (go1back)\n            if <touching color (#000000)?> then\n                change x by (go1back)\n                if <touching color (#000000)?> then\n                    change x by (go1back)\n                    if <touching color (#000000)?> then\n                        change x by (go1back)\n                        if <touching color (#000000)?> then\n                            change x by (go1back)\n                            if <touching color (#000000)?> then\n                                change x by (go1back)\n                                if <touching color (#000000)?> then\n                                    change x by (go1back)\n                                    if <touching color (#000000)?> then\n                                        change x by (go1back)\n                                        if <touching color (#000000)?> then\n                                            change x by (go1back)\n                                            if <touching color (#000000)?> then\n                                                change x by (go1back)\n                                                if <touching color (#000000)?> then\n                                                    change x by (go1back)\n                                                    if <touching color (#000000)?> then\n                                                        change x by (go1back)\n                                                        if <touching color (#000000)?> then\n                                                            change x by (go1back)\n                                                            if <touching color (#000000)?> then\n                                                                change x by (go1back)\n                                                                if <touching color (#000000)?> then\n                                                                    change x by (go1back)\n                                                                    if <touching color (#000000)?> then\n                                                                        change x by (go1back)\n                                                                        if <touching color (#000000)?> then\n                                                                            change x by (go1back)\n                                                                            if <touching color (#000000)?> then\n                                                                                change x by (go1back)\n                                                                                if <touching color (#000000)?> then\n                                                                                    change x by (go1back)\n                                                                                    if <touching color (#000000)?> then\n                                                                                        change x by (go1back)\n                                                                                        if <touching color (#000000)?> then\n                                                                                            change x by (go1back)\n                                                                                            if <touching color (#000000)?> then\n                                                                                                change x by (back)\n                                                                                                if <touching color (#000000)?> then\n                                                                                                    Touching ceiling\n                                                                                                end\n                                                                                            end\n                                                                                        end\n                                                                                    end\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Touching ceiling\nset [y v] to [-1]\nset [x v] to [0]\nif <touching color (#000000)?> then\n    change y by (-1)\n    if <touching color (#000000)?> then\n        change y by (-1)\n        if <touching color (#000000)?> then\n            change y by (-1)\n            if <touching color (#000000)?> then\n                change y by (-1)\n                if <touching color (#000000)?> then\n                    change y by (-1)\n                    if <touching color (#000000)?> then\n                        change y by (-1)\n                        if <touching color (#000000)?> then\n                            change y by (-1)\n                            if <touching color (#000000)?> then\n                                change y by (-1)\n                                if <touching color (#000000)?> then\n                                    change y by (-1)\n                                    if <touching color (#000000)?> then\n                                        change y by (-1)\n                                        if <touching color (#000000)?> then\n                                            change y by (-1)\n                                            if <touching color (#000000)?> then\n                                                change y by (-1)\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [begin v]\nforever\n    if <<touching color (#ff00bf)?> or <<(WASD) = [0]> and <key (space v) pressed?>>> then\n        if <(WASD) = [2]> then\n            set [editing v] to [1]\n            set [tell time v] to [1]\n            wait (9.999999999999999e-26) seconds\n            set [tell time v] to [0]\n        else\n            set [x v] to [0]\n            set [y v] to [0]\n            go to x: (-185) y: (0)\n            broadcast (Next level v)\n            if <<(WASD) = [0]> and <key (space v) pressed?>> then\n                wait until <not <key (space v) pressed?>>\n            end\n        end\n    end\nend\n\n@Buttons\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    go to x: (150) y: (-135)\n    set size to (220) %\n    switch costume to (voice control v)\n    show\n    wait (0.1) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    Painetaanko (0) koko (6)\n    if <(WASD) = [0]> then\n        next backdrop\n        show variable [loudness v]\n        broadcast (Begin v)\n    end\n    delete this clone\nend\n\nwhen flag clicked\npen up\nerase all\nhide\nclear graphic effects\nset [wasd v] to [-1]\nset [loudness v] to [0]\nhide variable [loudness v]\nhide variable [☁ world's best \(sec\) v]\ngo to x: (30) y: (-135)\nset size to (500) %\nset [ghost v] effect to (100)\nswitch costume to (wasd v)\ncreate clone of (_myself_ v)\nswitch costume to (voice control v)\ncreate clone of (_myself_ v)\nswitch costume to (level creator v)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nforever\n    set [loudness v] to ((loudness) / (3))\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [3]> then\n    go to x: (-150) y: (130)\n    show\n    wait (0.1) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    Painetaanko (2) koko (5)\n    if <(WASD) = [2]> then\n        switch backdrop to (level creator v)\n        broadcast (Begin v)\n        broadcast (Draw v)\n    end\n    hide\nend\nif <<(WASD) = [0]> or <(WASD) = [1]>> then\n    delete this clone\nend\nset [ghost v] effect to (100)\nshow\nforever\n    if <(tell time) = [1]> then\n        say (join (join [Your time was ] (timer)) [ seconds]) for (3.5) seconds\n    end\nend\n\ndefine None\nrepeat until <(WASD) > [-1]>\n    if <touching (mouse-pointer v)?> then\n        repeat (10)\n            change size by (koko)\n            if <mouse down?> then\n                set [wasd v] to (controls)\n            end\n        end\n        repeat until <<not <touching (mouse-pointer v)?>> or <(WASD) > [-1]>>\n            if <mouse down?> then\n                set [wasd v] to (controls)\n            end\n        end\n        if <(WASD) = [-1]> then\n            repeat (10)\n                change size by ((koko) * (-1))\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    show\n    wait (0.1) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    Painetaanko (1) koko (10)\n    if <(WASD) = [1]> then\n        next backdrop\n        broadcast (Begin v)\n    end\n    if <(WASD) = [0]> then\n        delete this clone\n    end\n    hide\n    set [ghost v] effect to (100)\n    set x to (0)\n    reset timer\n    wait until <(backdrop [name v]) = [The end]>\n    show\n    if <<<(timer) < (☁ World's best \(sec\))> and <(WASD) = [1]>> and <not <(username) = [Hamuniii]>>> then\n        set [☁ world's best \(sec\) v] to (timer)\n        repeat (10)\n            set [☁ world's best \(sec\) v] to (☁ World's best \(sec\))\n        end\n    end\n    if <(WASD) = [1]> then\n        show variable [☁ world's best \(sec\) v]\n        say (join (join [Your time was ] (timer)) [ seconds]) for (7) seconds\n        say [Maybe try to get a better time?] for (5) seconds\n        hide\n    end\n    if <(WASD) = [0]> then\n        show variable [☁ world's best \(sec\) v]\n        say (join (join [Your time was ] (timer)) [ seconds]) for (7) seconds\n        say [You can't get a world record if you are playing in voice conrol mode.] for (5) seconds\n        hide\n    end\nend\n\n@Draw\n\nwhen I receive [draw v]\nset [editing v] to [1]\nforever\n    wait until <key (space v) pressed?>\n    set [editing v] to [0]\n    wait until <not <key (space v) pressed?>>\n    wait until <<key (space v) pressed?> or <(editing) = [1]>>\n    set [editing v] to [1]\n    wait until <not <key (space v) pressed?>>\nend\n\nwhen [z v] key pressed\nif <<(WASD) = [2]> and <(editing) = [1]>> then\n    set pen color to (#000000)\n    go to (mouse-pointer v)\n    say [Obstacle] for (1) seconds\nend\n\nwhen [b v] key pressed\nif <<(WASD) = [2]> and <(editing) = [1]>> then\n    erase all\n    go to (mouse-pointer v)\n    say [Cleared] for (1) seconds\nend\n\nwhen [v v] key pressed\nif <<(WASD) = [2]> and <(editing) = [1]>> then\n    set pen color to (#ffffff)\n    go to (mouse-pointer v)\n    say [Erase] for (1) seconds\nend\n\nwhen [x v] key pressed\nif <<(WASD) = [2]> and <(editing) = [1]>> then\n    set pen color to (#ff0000)\n    go to (mouse-pointer v)\n    say [Danger zone] for (1) seconds\nend\n\nwhen [c v] key pressed\nif <<(WASD) = [2]> and <(editing) = [1]>> then\n    set pen color to (#ff00bf)\n    go to (mouse-pointer v)\n    say [Finish] for (1) seconds\nend\n\nwhen I receive [draw v]\nwait until <not <mouse down?>>\nset pen color to (#000000)\nset pen size to (30)\nforever\n    if <<mouse down?> and <(editing) = [1]>> then\n        go to (mouse-pointer v)\n        pen down\n        repeat until <not <mouse down?>>\n            go to (mouse-pointer v)\n        end\n    else\n        pen up\n    end\nend\n\nwhen I receive [draw v]\nforever\n    repeat until <(editing) = [1]>\n        reset timer\n        wait until <<key (r v) pressed?> or <<(respawn) = [1]> or <(editing) = [1]>>>\n    end\n    wait until <(editing) = [0]>\nend\n\n