➳ invisible | platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [551527_BOT-LAB v] until done\nend\n\n@player\n\nwhen flag clicked\nswitch costume to (costume2 v)\nshow\ngo to x: (-204) y: (122)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <<(y position) < [-175]> or <touching (bad stuff v)?>> then\n        go to x: (-204) y: (122)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-1)\n    end\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (1)\n    end\n    set [xv v] to ((xv) * (0.85))\n    change x by (xv)\n    if <touching (levels v)?> then\n        change y by (-2)\n        if <touching (levels v)?> then\n            change y by (1)\n            if <touching (levels v)?> then\n                change y by (1)\n                if <touching (levels v)?> then\n                    change y by (1)\n                    if <touching (levels v)?> then\n                        change y by (1)\n                        if <touching (levels v)?> then\n                            change y by (1)\n                            if <touching (levels v)?> then\n                                change y by (-5)\n                                change x by ((-1) * (xv))\n                                if <<key (up arrow v) pressed?> and <not <(xv) = [0]>>> then\n                                    set [mode v] to [walljump]\n                                    set [yv v] to [8]\n                                    set [xv v] to (((xv) / ([abs v] of (xv) )) * (-10))\n                                else\n                                    set [mode v] to [wallslide]\n                                    set [xv v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change y by (2)\n    end\n    change y by (-3)\n    if <touching (levels v)?> then\n        if <(yv) = [-3]> then\n            if <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> then\n                set [mode v] to [run]\n            else\n                if <([abs v] of (xv) ) > [.1]> then\n                    set [mode v] to [skid]\n                else\n                    set [mode v] to [stand]\n                end\n            end\n        end\n        if <key (up arrow v) pressed?> then\n            set [mode v] to [jump]\n            set [yv v] to [9]\n        end\n    end\n    if <<<<(mode) = [jump]> or <(mode) = [walljump]>> and <(yv) < [0]>> or <<<(mode) = [run]> or <(mode) = [skid]>> and <(yv) < [-3]>>> then\n        set [mode v] to [fall]\n    end\n    change y by (3)\n    if <(yv) > [-15]> then\n        change [yv v] by (-0.5)\n    end\n    change y by (-2)\n    if <not <touching (levels v)?>> then\n        change y by (-1)\n        if <not <touching (levels v)?>> then\n            change y by (-1)\n            if <not <touching (levels v)?>> then\n                change y by (-1)\n                if <not <touching (levels v)?>> then\n                    change y by (-1)\n                    if <not <touching (levels v)?>> then\n                        change y by (-1)\n                        if <not <touching (levels v)?>> then\n                            change y by (5)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (2)\n    change y by (yv)\n    if <touching (levels v)?> then\n        change y by (-2)\n        if <touching (levels v)?> then\n            change y by ((-1) * (yv))\n            set [yv v] to [-3]\n        end\n        change y by (2)\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (right arrow v) pressed?> then\n        switch costume to (costume1.5 v)\n        wait (0) seconds\n        switch costume to (costume1 v)\n        wait until <not <key (right arrow v) pressed?>>\n        switch costume to (costume1.5 v)\n        wait (0) seconds\n        switch costume to (costume2 v)\n    end\n    if <key (left arrow v) pressed?> then\n        switch costume to (costume2.5 v)\n        wait (0) seconds\n        switch costume to (costume3 v)\n        wait until <not <key (left arrow v) pressed?>>\n        switch costume to (costume2.5 v)\n        wait (0) seconds\n        switch costume to (costume2 v)\n    end\n    if <not <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>>> then\n        switch costume to (costume2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (goal v)?> then\n        go to x: (-204) y: (122)\n        broadcast (message1 v)\n    end\nend\n\n@levels\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset [ghost v] effect to (100)\ngo to x: (0) y: (-20)\n\nwhen I receive [message1 v]\nnext costume\n\n@goal\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\n\n@bad stuff\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nset [ghost v] effect to (100)\ngo to x: (0) y: (-20)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [message1 v]\nnext costume\n\n@thing\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset [ghost v] effect to (0)\ngo to x: (0) y: (-200)\n\nwhen I receive [message1 v]\nnext costume\n\n@thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n