BLUE - A Platformer

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

@Stage\n\n@Blue\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 [11]\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 (0.9)\n    create clone of (_myself_ v)\nend\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [x v] by (-0.9)\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 (120) %\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 (#ff3333)?> 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) < [-175]> 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\nwhen I receive [die v]\ngo to x: (-173) y: (-115)\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    if <<key (d v) pressed?> and <touching (postava12 v)?>> then\n        change [x v] by (1)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<key (a v) pressed?> and <touching (postava12 v)?>> then\n        change [x v] by (-1)\n    end\nend\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\nwhen flag clicked\ngo to [front v] layer\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 [Electro-Light-Symbolism-_NCS-Release_ 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\ngo to [front v] layer\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 (blue 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: (185) y: (105)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [2]> then\n        wait (0.5) seconds\n        go to x: (162) y: (-100)\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: (-200) y: (36)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [5]> then\n        wait (0.5) seconds\n        go to x: (199) y: (-95)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [7]> then\n        wait (0.5) seconds\n        go to x: (180) y: (-100)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        wait (0.5) seconds\n        go to x: (112) y: (90)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [10]> then\n        hide\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\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    if <(Level) = [9]> then\n        go to x: (-112) y: (155)\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    go to [front v] layer\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 (10)\n    change [ghost v] effect by (10)\n    wait (0.01) seconds\nend\n\nwhen flag clicked\nhide\nset [ghost v] effect to (0)\n\nwhen flag clicked\ngo to [front v] layer\n\n@THE END\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [10]> then\n        show\n    end\nend\n\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    if <not <(Level) = [10]>> 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@Postava2\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [2]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [2]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava3\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [2]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [2]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava4\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [2]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [2]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava5\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [2]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [2]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava6\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [4]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [4]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava7\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [4]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [4]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava8\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [4]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [4]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava9\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [4]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [4]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava10\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [4]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [4]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava11\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [4]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [4]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava12\n\nwhen flag clicked\nforever\n    if <<<not <(Level) = [6]>> and <not <(Level) = [7]>>> and <not <(Level) = [8]>>> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [6]> then\n        switch costume to (kostým1 v)\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [7]> then\n        switch costume to (kostým2 v)\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        switch costume to (kostým3 v)\n        show\n    end\nend\n\n@Postava13\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [6]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [6]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava14\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [6]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [6]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava15\n\nwhen flag clicked\nforever\n    if <(Level) = [6]> then\n        show\n        switch costume to (kostým2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<not <(Level) = [2]>> and <not <(Level) = [6]>>> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [2]> then\n        show\n        switch costume to (kostým1 v)\n    end\nend\n\n@Postava16\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [8]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava17\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [8]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava18\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [8]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava19\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(Level) = [8]>> then\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\n@Postava20\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\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\nwhen flag clicked\ngo to [front v] layer\n\n@Postava21\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\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\nwhen flag clicked\ngo to [front v] layer\n\n@Postava22\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Die v)\n    end\nend\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\nwhen flag clicked\ngo to [front v] layer\n\n