ORANGE - A Platformer

Instructions: HOW TO PLAY\nW - Jump\nA - Go left\nD - Go right\n\nJump over the lava and get to the yellow checkpoints to finish the game!\n

@Stage\n\n@Orange\n\ndefine Move\nchange y by (Y)\nif <<touching (levels v)?> or <touching (moving platform v)?>> then\n    repeat ([abs v] of (Y) )\n        if <<touching (levels v)?> or <touching (moving platform v)?>> then\n            change y by ((-1) * (([abs v] of (Y) ) / (Y)))\n        end\n    end\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <not <(Y) > [0]>>> then\n        set [y v] to [13]\n    else\n        set [y v] to [0]\n    end\nelse\n    change [y v] by (-1)\nend\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    change [x v] by (1)\n    create clone of (_myself_ v)\nend\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [x v] by (-1)\n    create clone of (_myself_ v)\nend\nchange x by (X)\nif <<touching (levels v)?> or <touching (moving platform v)?>> then\n    set [previous y v] to (y position)\n    repeat (([abs v] of (Y) ) + (1))\n        if <<touching (levels v)?> or <touching (moving platform v)?>> then\n            change y by (1)\n        end\n    end\n    if <<touching (levels v)?> or <touching (moving platform v)?>> then\n        set y to (Previous Y)\n        repeat ([ceiling v] of ([abs v] of (X) ) )\n            if <<touching (levels v)?> or <touching (moving platform v)?>> then\n                change x by ((-1) * (([abs v] of (X) ) / (X)))\n            end\n        end\n    end\nend\nset [x v] to ((X) * (0.9))\n\nwhen flag clicked\nforever\n    Move\nend\n\nwhen flag clicked\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (0) y: (0)\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (0)\nset size to (150) %\nrepeat (10)\n    change size by (-10)\n    change [ghost v] effect by (10)\nend\nhide\ndelete this clone\n\nwhen flag clicked\nhide\n\nset [ghost v] effect to (100)\n\nwhen I receive [start the game v]\nwait (1) seconds\nshow\ngo to x: (-173) y: (-115)\n\nrepeat (20)\n    change [ghost v] effect by (-5)\n    wait (0.01) seconds\nend\n\nwhen I receive [start the game v]\nforever\n    if <touching color (#ff3300)?> then\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        go to x: (-173) y: (-115)\n        repeat (10)\n            change [ghost v] effect by (-20)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(y position) < [-126]> then\n        repeat (2)\n            change [ghost v] effect by (50)\n        end\n        go to x: (-173) y: (-115)\n        repeat (2)\n            change [ghost v] effect by (-50)\n        end\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-173) y: (-115)\n\nwhen flag clicked\nforever\n    if <(y position) = [-107]> then\n        change y by (-1)\n    end\nend\n\nwhen I receive [teleport v]\ngo to x: (-229) y: (29)\n\nwhen flag clicked\nforever\n    if <(y position) = [-127]> then\n        change y by (-1)\n    end\nend\n\nwhen I receive [teleport 2 v]\ngo to x: (-236) y: (60)\n\n@Levels\n\nwhen I receive [start the game v]\nwait (1) seconds\nshow\n\nrepeat (20)\n    change [ghost v] effect by (-5)\n    wait (0.01) seconds\nend\n\nwhen flag clicked\nswitch costume to (kostým1 v)\nhide\n\nset [ghost v] effect to (100)\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nforever\n    set [level v] to (costume [number v])\nend\n\n@Play button\n\nwhen flag clicked\nset [ghost v] effect to (0)\nset size to (100) %\nset [play size v] to [6]\nforever\n    repeat until <(Play size) = [0]>\n        if <touching (mouse-pointer v)?> then\n            change size by (Play size)\n            change [play size v] by (-1)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    repeat until <(size) = [100]>\n        if <not <touching (mouse-pointer v)?>> then\n            change size by (-4)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(Play size) = [0]> and <(size) = [100]>> then\n        set [play size v] to [6]\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        repeat (10)\n            change size by (-2)\n            change [ghost v] effect by (10)\n        end\n        broadcast (Start the game v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(size) < [100]> then\n        set size to (100) %\n    end\nend\n\nwhen flag clicked\ngo to x: (-68) y: (-65)\nshow\n\nwhen I receive [start the game v]\nwait (1.5) seconds\nhide\ngo to x: (-200) y: (200)\n\n@ORANGE\n\nwhen flag clicked\ngo to x: (0) y: (-30)\nshow\n\nwhen I receive [start the game v]\nwait (1.5) seconds\nhide\ngo to x: (-200) y: (200)\n\n@Sound button\n\nwhen flag clicked\nforever\n    repeat until <(size) = [100]>\n        if <not <touching (mouse-pointer v)?>> then\n            change size by (-4)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(Sound siize) = [0]> and <(size) = [100]>> then\n        set [sound siize v] to [6]\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (0)\nset size to (100) %\nset [sound siize v] to [6]\nforever\n    repeat until <(Sound siize) = [0]>\n        if <touching (mouse-pointer v)?> then\n            change size by (Sound siize)\n            change [sound siize v] by (-1)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(size) < [100]> then\n        set size to (100) %\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [1]> then\n        forever\n            set volume to (100) %\n            play sound [videoplayback v] until done\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [2]> then\n        set volume to (0) %\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(costume [number v]) = [1]> and <not <(volume) = [100]>>> then\n        set volume to (100) %\n    end\nend\n\nwhen flag clicked\nswitch costume to (kostým1 v)\nshow\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        next costume\n        wait (0.5) seconds\n    end\nend\n\nwhen flag clicked\ngo to x: (54) y: (-65)\nshow\n\nwhen I receive [start the game v]\nwait (1.5) seconds\nhide\ngo to x: (-200) y: (200)\n\n@Background\n\nwhen I receive [start the game v]\nrepeat (25)\n    change x by (15)\nend\n\nwhen flag clicked\ngo to x: (100) y: (0)\n\n@Checkpoint\n\nwhen flag clicked\nhide\n\nset [ghost v] effect to (100)\n\nwhen I receive [start the game v]\nwait (1) seconds\nshow\n\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\n\nwhen flag clicked\npoint in direction (90)\nforever\n    turn right (5) degrees\nend\n\nwhen flag clicked\nforever\n    if <touching (orange v)?> then\n        broadcast (Next level v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        wait (1) seconds\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [1]> then\n        wait (0.5) seconds\n        go to x: (-162) y: (97)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [2]> then\n        wait (0.5) seconds\n        go to x: (162) y: (70)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [3]> then\n        wait (0.5) seconds\n        go to x: (200) y: (-90)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [4]> then\n        wait (0.5) seconds\n        go to x: (-220) y: (134)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [5]> then\n        wait (0.5) seconds\n        go to x: (199) y: (52)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [6]> then\n        wait (0.5) seconds\n        go to x: (214) y: (-92)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [7]> then\n        wait (0.5) seconds\n        go to x: (-179) y: (55)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        wait (0.5) seconds\n        go to x: (-200) y: (134)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [9]> then\n        hide\n    end\nend\n\n@Moving platform\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [3]> then\n        show\n        go to x: (-150) y: (-170)\n        glide (3) secs to x: (24) y: (-170)\n        wait (1) seconds\n        glide (3) secs to x: (-150) y: (-170)\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [3]>> then\n        hide\n    end\nend\n\n@Background 2\n\nwhen I receive [start the game v]\nwait (1) seconds\nshow\nrepeat (20)\n    change [ghost v] effect by (5)\n    wait (0.01) seconds\nend\n\nwhen flag clicked\nhide\nset [ghost v] effect to (0)\n\n@Portal\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [5]> then\n        show\n        if <touching (orange v)?> then\n            broadcast (Teleport v)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [5]>> then\n        hide\n    end\nend\n\n@Portal 2\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [6]> then\n        show\n        if <touching (orange v)?> then\n            broadcast (Teleport 2 v)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [6]>> then\n        hide\n    end\nend\n\n@THE END\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [9]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [9]>> then\n        hide\n    end\nend\n\n@Postava1\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nshow\ngo to [front v] layer\n\n