Planet II A Platformer

Instructions: Welcome to the platformer: "Planet"\n\n-Arrow keys or W,A,S,D to move \n-↓ or "S" to cower space to change color, r to resporn\nGood luck!\n\n-Have fun! All levels are possible! Write in the comments if you need help.\n

@Stage\n\n@WD\n\nwhen flag clicked\ngo to [back v] layer\nhide\nforever\n    if <(level) = [8]> then\n        wait (1) seconds\n        switch costume to (button1 v)\n        show\n        go to x: (170) y: (20)\n        point in direction (-90)\n        repeat until <<touching (figur12 v)?> or <touching (_edge_ v)?>>\n            move (5) steps\n        end\n        repeat (10)\n            next costume\n        end\n        hide\n    end\nend\n\ngo to x: (100) y: (-148)\n\nwhen flag clicked\nforever\n    if <not <(level) = [8]>> then\n        hide\n    end\nend\n\nwhen [c v] key pressed\nchange [color v] effect by (50)\n\nwhen flag clicked\nforever\n    play sound [Emotional Piano v] until done\nend\n\nwhen flag clicked\nset [color v] effect to (0)\n\nwhen flag clicked\nforever\n    start sound [Space Ambience v]\nend\n\nforever\n\n@die3\n\nwhen I receive [next v]\nnext costume\n\nwhen flag clicked\ngo to [back v] layer\nswitch costume to (1 v)\nshow\n\nwhen flag clicked\ngo to x: (66) y: (121)\nset [ghost v] effect to (25)\nforever\n    if <(level) = [6]> then\n        repeat (10)\n            change y by (1)\n        end\n        repeat (10)\n            change y by (-1)\n        end\n    end\nend\n\ngo [forward v] (1) layers\n\nwhen flag clicked\nforever\n    if <(level) = [9]> then\n        repeat (10)\n            change y by (1)\n        end\n        repeat (10)\n            change y by (-1)\n        end\n    end\nend\n\nchange [ghost v] effect by (25)\n\nforever\n\nwhen flag clicked\nforever\n    if <(level) = [13]> then\n        repeat (10)\n            change y by (1)\n        end\n        repeat (10)\n            change y by (-1)\n        end\n    end\nend\n\nwhen flag clicked\nset [color v] effect to (0)\n\n@die2\n\nwhen I receive [next v]\nnext costume\n\nwhen flag clicked\nswitch costume to (1 v)\nshow\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    if <(level) = [4]> then\n        go to x: (38) y: (-35)\n        turn right (17) degrees\n    end\n    if <(level) = [11]> then\n        go to x: (0) y: (63)\n        turn right (17) degrees\n    end\n    if <<(level) = [5]> or <(level) = [8]>> then\n        go to x: (30) y: (-20)\n        turn right (5) degrees\n        create clone of (_myself_ v)\n    end\n    if <(level) = [12]> then\n        go to x: (30) y: (138)\n        turn right (5) degrees\n    end\nend\n\nwhen I start as a clone\ngo to x: (30) y: (-20)\nif <<(level) = [5]> or <(level) = [8]>> then\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nelse\n    delete this clone\nend\n\nwhen flag clicked\nset [color v] effect to (0)\n\n@die\n\nwhen I receive [next v]\nnext costume\n\nwhen flag clicked\ngo to [back v] layer\ngo [forward v] (1) layers\nswitch costume to (1 v)\ngo to x: (0) y: (0)\nshow\n\nchange [color v] effect by (50)\n\nwhen flag clicked\nset [color v] effect to (0)\n\n@Platform\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [next v]\nnext costume\n\nwhen flag clicked\ngo to [front v] layer\n\nchange [color v] effect by (50)\n\nwhen flag clicked\nset [color v] effect to (0)\n\n@Figur12\n\ndefine Trampolin\nif <<touching (tranmpolin v)?> or <touching (tranmpolin e v)?>> then\n    set [y v] to [18]\nend\nif <touching (tranmpolin v)?> then\n    broadcast (sprung v)\nend\nif <touching (tranmpolin e v)?> then\n    broadcast (sprung2 v)\nend\n\nwhen flag clicked\nforever\n    if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n        repeat until <not <<key (down arrow v) pressed?> or <key (s v) pressed?>>>\n            switch costume to (player2 v)\n        end\n        if <not <<key (down arrow v) pressed?> or <key (s v) pressed?>>> then\n            switch costume to (player v)\n        end\n    end\nend\n\ndefine y\nchange [y v] by (-1)\nrepeat (4)\n    if <touching (platform v)?> then\n        change y by (1)\n    end\nend\nif <touching (platform v)?> then\n    change y by (-4)\n    change x by ((x) * (-1))\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        if <(x) > [0]> then\n            set [x v] to [-10]\n        else\n            set [x v] to [10]\n        end\n        set [y v] to [12]\n    else\n        set [x v] to [0]\n    end\nend\nchange y by (y)\nif <touching (platform v)?> then\n    if <(y) > [0]> then\n        repeat until <not <touching (platform v)?>>\n            change y by (-1)\n            set [y v] to [0]\n        end\n    else\n        repeat until <not <touching (platform v)?>>\n            change y by (1)\n            set [y v] to [0]\n        end\n    end\nend\nchange y by (-1)\nif <<touching (platform v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n    set [y v] to [12]\nend\nchange y by (1)\n\nwhen I receive [1 v]\ny\nright or left\nTrampolin\n\nwhen I receive [play v]\nset [y v] to [0]\nset [x v] to [0]\nset [x begin v] to [-200]\nset [y begin v] to [45]\ngo to x: (x begin) y: (y begin)\ngo to [front v] layer\n\nwhen I receive [works v]\nset [level v] to [1]\nhide\n\nwhen flag clicked\nbroadcast (works v)\nbroadcast (play v)\nnext or die\nset [level v] to [0]\n\nwhen I receive [play v]\nforever\n    broadcast (1 v)\n    broadcast (2 v)\nend\n\ndefine dead\ngo to x: (x begin) y: (y begin)\nGame - Reset x and y\n\ndefine next\ngo to x: (x begin) y: (y begin)\nchange [level v] by (1)\nGame - Reset x and y\n\ndefine next or die\nforever\n    if <<<touching (die3 v)?> or <<touching (die2 v)?> or <touching (die v)?>>> or <touching (wd v)?>> then\n        wait (0.00000000000000000000000000000000000000000000000000000000000000001) seconds\n        dead\n    end\n    if <(x position) > [225]> then\n        broadcast (next v)\n        next\n    end\nend\n\ndefine right or left\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x v] by (1.5)\n    point in direction (90)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x v] by (-1.5)\n    point in direction (-90)\nend\nset [x v] to ((x) * (0.85))\nchange x by (x)\nif <([abs v] of (x) ) < [0.1]> then\n    set [x v] to [0]\nend\n\nwhen flag clicked\nset [color v] effect to (0)\n\nwhen [space v] key pressed\nchange [color v] effect by (50)\n\nwhen [r v] key pressed\ndead\n\nwhen flag clicked\nhide\nwait (1) seconds\nshow\n\n@Apple\n\nwhen flag clicked\nset [color v] effect to (0)\ngo to [back v] layer\nforever\n    go to (figur12 v)\nend\n\nwhen [space v] key pressed\nchange [color v] effect by (50)\n\n@Apple2\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    wait (pick random (0.1) to (0.05)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to x: (pick random (-240) to (240)) y: (-230)\nset size to (pick random (20) to (90)) %\nset [color v] effect to (pick random (1) to (15))\nif <(pick random (1) to (3)) = [1]> then\n    switch costume to (apple v)\nend\nif <(pick random (1) to (3)) = [2]> then\n    switch costume to (apple2 v)\nend\nif <(pick random (1) to (3)) = [3]> then\n    switch costume to (apple3 v)\nend\nforever\n    change y by (pick random (2) to (7))\n    if <(y position) > [170]> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nset [color v] effect to (0)\n\n@Figur1\n\nwhen flag clicked\ngo to x: (0) y: (-200)\ngo to [back v] layer\nforever\n    turn right (0.5) degrees\nend\n\nmove (2) steps\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\n@Figur2\n\nmove (2) steps\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [14]> then\n        show\n    end\nend\n\nwhen [space v] key pressed\nchange [color v] effect by (50)\n\ngo to [back v] layer\n\nwhen flag clicked\nforever\n    if <not <(level) = [14]>> then\n        hide\n    end\nend\n\n@Tranmpolin\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nswitch costume to (normal v)\nhide\n\nwhen flag clicked\nforever\n    if <<not <(level) = [10]>> or <<not <(level) = [11]>> or <not <(level) = []>>>> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if  then\n        go to x: (-80) y: (-40)\n        show\n    end\n    if  then\n        go to x: (-80) y: (-60)\n        show\n    end\nend\n\nforever\n\nwhen I receive [sprung v]\nswitch costume to (gebeugt v)\nwait (0.2) seconds\nswitch costume to (normal v)\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen flag clicked\nset [color v] effect to (0)\n\nchange [color v] effect by (50)\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen flag clicked\nwait (0.01) seconds\ngo to [front v] layer\n\n@Tranmpolin e\n\nwhen flag clicked\ngo to [back v] layer\nswitch costume to (normal2 v)\nhide\n\nwhen flag clicked\nforever\n    if  then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(level) = [12]> or <(level) = [11]>> then\n        go to x: (87) y: (-60)\n        show\n    end\nend\n\nwhen I receive [sprung2 v]\nswitch costume to (gebeugt2 v)\nwait (0.2) seconds\nswitch costume to (normal2 v)\n\nwhen flag clicked\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen flag clicked\nwait (0.01) seconds\ngo to [front v] layer\n\nchange [color v] effect by (50)\n\nwhen flag clicked\nset [color v] effect to (0)\n\n@vordergrund\n\nwhen flag clicked\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\n    go to [front v] layer\nend\nhide\nbroadcast (nach vorscpann v)\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n