Change - A  Platformer
@Stage\n\n@Man\n\nwhen flag clicked\nset [walk v] to [5]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [11]> then\n        set [walk v] to [5]\n    end\n    wait (00.01) seconds\nend\n\ndefine platform physics (jump height) (gravity) (friction) (movement speed)\nswitch costume to (hitbox v)\nchange y by (y vel)\nif <touching (level v)?> then\n    repeat ([abs v] of (y vel) )\n        if <touching (level v)?> then\n            change y by ((-1) * (([abs v] of (y vel) ) / (y vel)))\n        end\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <not <(y vel) > [0]>>> 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 (gravity)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x vel v] by (movement speed)\n    point in direction (90)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x vel v] by ((-1) * (movement speed))\n    point in direction (-90)\nend\nchange x by (x vel)\nif <touching (level v)?> then\n    set [old y v] to (y position)\n    repeat ([abs v] of (x vel) )\n        if <touching (level v)?> then\n            change y by (1)\n        end\n    end\n    if <touching (level v)?> then\n        set y to (old y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <touching (level v)?> then\n                change x by ((-1) * (([abs v] of (x vel) ) / (x vel)))\n            end\n        end\n        set [x vel v] to [0]\n    end\nend\nset [x vel v] to ((x vel) * (friction))\nswitch costume to (standing v)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or > then\n    switch costume to (Walk)\nend\nif <(y vel) > [1]> then\n    switch costume to (jump v)\nend\nif <(y vel) < [-3]> then\n    switch costume to (falling v)\nend\n\nwhen flag clicked\npoint in direction (90)\ngo to x: (-230) y: (-100)\nforever\n    set rotation style [left-right v]\n    platform physics (10) (-1) (0.7) (1.7)\nend\n\nwhen flag clicked\nforever\n    if <touching (flag v)?> then\n        broadcast (Next Level v)\n        go to x: (-230) y: (-128)\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        go to x: (-230) y: (-130)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(y position) < [-187]> or <touching (spikes v)?>> then\n        go to x: (-230) y: (-127)\n    end\nend\n\nwhen I receive [skip v]\ngo to x: (-230) y: (-127)\n\nwhen flag clicked\nforever\n    play sound [Vexento - Particles v] until done\nend\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (level 1 v)\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [4]> then\n        broadcast (Change! v)\n    end\nend\n\nwhen flag clicked\n\nwhen flag clicked\nforever\n    set [level v] to (costume [number v])\nend\n\nswitch costume to (Level)\n\nwhen flag clicked\nforever\n    if <key (s v) pressed?> then\n        next costume\n        broadcast (Skip v)\n        wait (.5) seconds\n    end\nend\n\n\n\n\n\nwhen I receive [change! v]\nforever\n\n@Flag\n\nwhen flag clicked\nshow\ngo to x: (225) y: (-127)\nrepeat until <(Level) > [3]>\n    switch costume to (flag 1 v)\n    wait (.3) seconds\n    switch costume to (flag 2 v)\n    wait (.3) seconds\nend\n\nwhen I receive [change! v]\nrepeat until <(Level) = [15]>\n    switch costume to (flag 3 v)\n    wait (.3) seconds\n    switch costume to (flag 4 v)\n    wait (.3) seconds\nend\n\nwhen I receive [change! v]\nforever\n    if <(Level) = [6]> then\n        go to x: (178) y: (109)\n    else\n        go to x: (225) y: (-127)\n        if <(Level) = [9]> then\n            go to x: (-195) y: (87)\n        else\n            go to x: (225) y: (-127)\n            if <(Level) = [10]> then\n                go to x: (2) y: (124)\n            else\n                go to x: (225) y: (-127)\n                if <(Level) = [12]> then\n                    go to x: (105) y: (21)\n                else\n                    go to x: (225) y: (-127)\n                end\n            end\n        end\n    end\nend\n\nrepeat until <(Level) > [3]>\n\nwhen flag clicked\n\n\n\nwhen flag clicked\nforever\n\nstart sound [past-sadness-by-kevin-macleod v]\n\nrepeat until <[] > [3]>\n\nif <(Level) < [3]> then\n\nplay sound [Vexento - Particles v] until done\n\nwhen flag clicked\nif <(Level) = [14]> then\n    hide\n    stop [other scripts in sprite v]\nend\n\n@Background\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\ngo to [back v] layer\nforever\n    if <(Level) < [3]> then\n        switch costume to (costume1 v)\n    end\n    if <(Level) > [3]> then\n        switch costume to (costume2 v)\n    end\nend\n\n@Narration\n\nwhen flag clicked\ngo to x: (0) y: (100)\nforever\n    switch costume to (Level)\nend\n\n@Spikes\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Sprite1\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\nend\n\n
Finally... after over a month... I present to you... Change! -A Platformer\n-Arrow keys or WASD to move.\n-Press R to restart.\n-If worst comes worst... press S to skip. Try a level at least ten times before skipping!!!\n-Get to the flag.