Travel A Platformer

Instructions: spam flag a platformer, full screen not recommended\n\narrow keys to move, space to jump.\n\nAvoid the lava and water to win and get inside the portal

@Stage\n\n@stickman\n\nwhen flag clicked\nset [level v] to [1]\nbroadcast (start level v)\n\nwhen I receive [start level v]\nset [jumping v] to [false]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    change [y velocity v] by (-1)\n    if <key (left arrow v) pressed?> then\n        if <(x velocity) > [-9]> then\n            change [x velocity v] by (-11)\n        end\n        if <(costume [number v]) = [1]> then\n            switch costume to (2 v)\n            wait (0.0000001) seconds\n            switch costume to (3 v)\n            wait (0.0000001) seconds\n            switch costume to (4 v)\n            wait (0.0000001) seconds\n            switch costume to (5 v)\n            wait (0.0000001) seconds\n            switch costume to (6 v)\n            wait (0.0000001) seconds\n            switch costume to (7 v)\n            wait (0.0000001) seconds\n            switch costume to (8 v)\n        else\n            switch costume to (1 v)\n        end\n    end\n    if <key (right arrow v) pressed?> then\n        if <(x velocity) < [9]> then\n            change [x velocity v] by (11)\n        end\n        if <(costume [number v]) = [1]> then\n            switch costume to (9 v)\n            wait (0.0000001) seconds\n            switch costume to (10 v)\n            wait (0.0000001) seconds\n            switch costume to (11 v)\n            wait (0.0000001) seconds\n            switch costume to (12 v)\n            wait (0.0000001) seconds\n            switch costume to (13 v)\n            wait (0.0000001) seconds\n            switch costume to (14 v)\n            wait (0.0000001) seconds\n            switch costume to (15 v)\n            wait (0.0000001) seconds\n            switch costume to (16 v)\n        else\n            switch costume to (1 v)\n        end\n    end\n    if <(x velocity) > [0]> then\n        change [x velocity v] by (-1)\n    end\n    if <(x velocity) < [0]> then\n        change [x velocity v] by (1)\n    end\n    change x by (x velocity)\n    move vertical\n    move horizontal\n    if <touching color (#000000)?> then\n        broadcast (next level v)\n    end\n    if <<(y position) < [-69]> or <touching color (#ec0000)?>> then\n        broadcast (start level v)\n    end\n    if <<touching color (#c6c6c6)?> or <touching color (#00e3ed)?>> then\n        broadcast (start level v)\n    end\nend\n\ndefine move vertical\nchange y by (y velocity)\nif <touching color (#239126)?> then\n    if <(y velocity) > [0]> then\n        repeat until <not <touching color (#239126)?>>\n            change y by (-1)\n        end\n    else\n        repeat until <not <touching color (#239126)?>>\n            change y by (1)\n        end\n        set [jumping v] to [false]\n    end\n    set [y velocity v] to [0]\nend\n\ndefine move horizontal\nif <touching color (#239126)?> then\n    if <(x velocity) > [0]> then\n        repeat until <not <touching color (#239126)?>>\n            change x by (-2)\n        end\n    else\n        repeat until <not <touching color (#239126)?>>\n            change x by (2)\n        end\n    end\n    set [x velocity v] to [0]\nend\n\nwhen I receive [start level v]\nif <(level) = [1]> then\n    go to x: (-4) y: (54)\n    broadcast (platform v)\nend\nif <(level) = [2]> then\n    go to x: (-65) y: (44)\n    broadcast (platform 2 v)\nend\nif <(level) = [3]> then\n    go to x: (-65) y: (44)\n    broadcast (platform 3 v)\nend\nif <(level) = [4]> then\n    go to x: (-65) y: (44)\n    broadcast (platform 4 v)\nend\nif <(level) = [5]> then\n    go to x: (-65) y: (44)\n    broadcast (platform 5 v)\nend\nif <(level) = [6]> then\n    go to x: (-65) y: (44)\n    broadcast (platform 6 v)\nend\nif <(level) = [7]> then\n    go to x: (-65) y: (44)\n    broadcast (platform 7 v)\nend\nif <(level) = [8]> then\n    go to x: (-65) y: (44)\n    broadcast (platform8 v)\nend\nif <(level) = [9]> then\n    go to x: (-65) y: (44)\n    broadcast (platform 9 v)\nend\nif <(level) = [10]> then\n    go to x: (-65) y: (44)\n    broadcast (platform 10 v)\nend\nif <(level) = [11]> then\n    go to x: (-65) y: (44)\n    broadcast (platform11 v)\nend\n\nwhen I receive [next level v]\nchange [level v] by (1)\nstop [other scripts in sprite v]\nbroadcast (start level v)\n\nwhen flag clicked\nrepeat (1)\n    start sound [Avicii - Levels v]\nend\n\nwhen [space v] key pressed\nshow\nset [yvelocity v] to [0]\nforever\n    if <touching (platform v)?> then\n        set [yvelocity v] to [0]\n        if <key (space v) pressed?> then\n            set [yvelocity v] to [18]\n        end\n    end\n    change y by (yvelocity)\n    change [yvelocity v] by (-1)\nend\n\n@platform\n\nwhen I receive [platform v]\nshow\nswitch costume to (level1 v)\n\nwhen I receive [platform 2 v]\nshow\nswitch costume to (level2 v)\n\nwhen I receive [platform 3 v]\nshow\nbroadcast (lava v)\nbroadcast (platform3 2 v)\nswitch costume to (level3 v)\n\nwhen I receive [platform 4 v]\nshow\nbroadcast (another effect v)\nswitch costume to (level4 v)\nwait (0.1) seconds\nswitch costume to (level12 v)\nwait (0.1) seconds\nswitch costume to (level13 v)\nwait (0.1) seconds\nswitch costume to (level14 v)\nwait (0.1) seconds\nswitch costume to (level14 v)\nwait (0.1) seconds\nswitch costume to (level13 v)\nwait (0.1) seconds\nswitch costume to (level12 v)\nwait (0.1) seconds\nswitch costume to (level4 v)\nwait (0.1) seconds\nswitch costume to (level4 v)\nwait (0.1) seconds\nswitch costume to (level12 v)\nwait (0.1) seconds\nswitch costume to (level13 v)\nwait (0.1) seconds\nswitch costume to (level14 v)\nwait (0.1) seconds\nswitch costume to (level14 v)\nwait (0.1) seconds\nswitch costume to (level13 v)\nwait (0.1) seconds\nswitch costume to (level12 v)\nwait (0.1) seconds\nswitch costume to (level4 v)\n\nwhen I receive [platform 5 v]\nshow\nswitch costume to (level5 v)\n\nwhen I receive [platform 6 v]\nshow\nbroadcast (Down v)\nswitch costume to (level6 v)\n\nwhen I receive [platform 7 v]\nshow\nbroadcast (water effect v)\nswitch costume to (level7 v)\n\nwhen I receive [platform8 v]\nshow\nswitch costume to (level8 v)\n\nwhen I receive [platform 9 v]\nshow\nbroadcast (Lava movement v)\nbroadcast (water animation v)\nswitch costume to (level9 v)\n\nwhen I receive [platform 10 v]\nshow\nswitch costume to (level11 v)\nwait (0.1) seconds\nswitch costume to (level16 v)\nwait (0.1) seconds\nswitch costume to (level17 v)\nwait (0.1) seconds\nswitch costume to (level18 v)\nwait (0.1) seconds\nswitch costume to (level11 v)\nwait (0.1) seconds\nswitch costume to (level15 v)\nwait (0.1) seconds\nswitch costume to (level11 v)\nwait (0.1) seconds\nswitch costume to (level18 v)\nwait (0.1) seconds\nswitch costume to (level17 v)\nwait (0.1) seconds\nswitch costume to (level16 v)\nwait (0.1) seconds\nswitch costume to (level11 v)\nwait (0.1) seconds\nswitch costume to (level11 v)\nwait (0.1) seconds\nswitch costume to (level16 v)\nwait (0.1) seconds\nswitch costume to (level17 v)\nwait (0.1) seconds\nswitch costume to (level18 v)\nwait (0.1) seconds\nswitch costume to (level11 v)\nwait (0.1) seconds\nswitch costume to (level15 v)\nwait (0.1) seconds\nswitch costume to (level11 v)\nwait (0.1) seconds\nswitch costume to (level18 v)\nwait (0.1) seconds\nswitch costume to (level17 v)\nwait (0.1) seconds\nswitch costume to (level16 v)\nwait (0.1) seconds\nswitch costume to (level11 v)\n\nwhen I receive [platform11 v]\nshow\nswitch costume to (level10 v)\n\n@moving platform\n\nwhen flag clicked\nhide\n\nwhen I receive [start level v]\nstop [other scripts in sprite v]\nif <(level) = [4]> then\n    show\nelse\n    hide\nend\nmove platform\n\ndefine move platform\ngo to x: (-159) y: (-106)\nforever\n    glide (1) secs to x: (57) y: (-106)\n    wait (0.1) seconds\n    glide (1) secs to x: (-105) y: (-106)\n    wait (0.1) seconds\n    glide (1) secs to x: (-159) y: (-106)\nend\n\n@Clouds\n\nwhen flag clicked\ngo to [front v] layer\nshow\nforever\n    switch costume to (costume1 v)\n    wait (0.03) seconds\n    go to x: (54) y: (28)\n    wait (0.03) seconds\n    go to x: (80) y: (28)\n    wait (0.03) seconds\n    go to x: (102) y: (28)\n    wait (0.03) seconds\n    go to x: (130) y: (28)\n    wait (0.03) seconds\n    go to x: (152) y: (28)\n    wait (0.03) seconds\n    go to x: (165) y: (28)\n    wait (0.03) seconds\n    go to x: (186) y: (28)\n    wait (0.03) seconds\n    go to x: (196) y: (28)\n    wait (0.03) seconds\n    go to x: (217) y: (28)\n    wait (0.03) seconds\n    go to x: (239) y: (28)\n    wait (0.03) seconds\n    go to x: (274) y: (28)\n    wait (0.03) seconds\n    go to x: (297) y: (28)\n    wait (0.03) seconds\n    go to x: (319) y: (28)\n    wait (0.03) seconds\n    go to x: (352) y: (28)\n    wait (0.03) seconds\n    go to x: (394) y: (28)\n    wait (0.03) seconds\n    go to x: (428) y: (28)\n    wait (0.03) seconds\n    go to x: (467) y: (28)\n    wait (0.03) seconds\n    go to x: (525) y: (28)\n    wait (0.03) seconds\n    go to x: (574) y: (28)\n    wait (0.03) seconds\n    go to x: (653) y: (28)\n    wait (0.03) seconds\n    go to x: (700) y: (28)\n    wait (0.03) seconds\n    go to x: (750) y: (28)\n    wait (0.03) seconds\n    go to x: (784) y: (28)\n    wait (0.03) seconds\n    go to x: (820) y: (28)\n    wait (0.03) seconds\nend\n\n@ lava effects\n\nwhen I receive [platform3 2 v]\nshow\nrepeat (1)\n    switch costume to (costume1 v)\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.003) seconds\n    switch costume to (costume1 v)\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.003) seconds\nend\n\nwhen flag clicked\nhide\n\n@ lava effects2\n\nwhen I receive [another effect v]\nshow\nrepeat (1)\n    switch costume to (costume1 v)\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.003) seconds\n    switch costume to (costume1 v)\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.03) seconds\n    next costume\n    wait (0.003) seconds\nend\n\nwhen flag clicked\nhide\n\n@Down\n\nwhen I receive [down v]\ngo to [front v] layer\nshow\nrepeat (1)\n    switch costume to (costume1 v)\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.03) seconds\n    switch costume to (costume1 v)\nend\nwait (2) seconds\nrepeat (1)\n    switch costume to (costume1 v)\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.01) seconds\n    switch costume to (costume1 v)\nend\n\nwhen flag clicked\nhide\n\n@moving platform2\n\nwhen flag clicked\nhide\n\nwhen I receive [start level v]\nstop [other scripts in sprite v]\nif <(level) = [7]> then\n    show\nelse\n    hide\nend\nmove platform\n\ndefine move platform\ngo to x: (-130) y: (-100)\nforever\n    glide (1) secs to x: (-56) y: (-100)\n    glide (1) secs to x: (52) y: (-100)\n    glide (1) secs to x: (-130) y: (-100)\nend\n\n@water animation\n\nwhen I receive [water animation v]\nshow\nrepeat (5)\n    switch costume to (costume1 v)\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [platform 10 v]\nhide\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    reset timer\nend\n\nwhen [timer v] > (.1)\ngo to [front v] layer\nset [ghost v] effect to (0)\nshow\n\nwhen flag clicked\nshow\ngo to [front v] layer\nset [ghost v] effect to (100)\nhide\n\n@Lava movement\n\nwhen I receive [lava movement v]\nshow\nrepeat (5)\n    switch costume to (costume1 v)\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [platform 10 v]\nhide\n\n@water effect\n\nwhen flag clicked\nhide\n\nwhen I receive [water effect v]\nshow\nrepeat (5)\n    switch costume to (costume1 v)\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\nend\n\nwhen I receive [platform8 v]\nhide\n\n@lava\n\nwhen I receive [lava v]\nshow\nrepeat (3)\n    switch costume to (costume1 v)\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\n    wait (0.1) seconds\n    next costume\nend\n\nwhen I receive [platform 4 v]\nhide\n\nwhen flag clicked\nhide\n\n