Pen Platformer

Instructions: Try to reacg the yellow "gate/portal" which brings you to the new level. Avoid to touch the red lines - Enjoy the music and atmosphere of my game and have fun!  (normal control via arrow keys).\nSend me your likes, comments and ideas to improve - many thanks!

@Stage\n\n@Pen\n\nwhen I receive [stopp v]\nif <key (right arrow v) pressed?> then\n    change [x v] by (-1)\nend\nif <key (left arrow v) pressed?> then\n    change [x v] by (1)\nend\nif <not <<key (right arrow v) pressed?> and <key (left arrow v) pressed?>>> then\n    change [x v] by (1)\nend\nLandschaft (X) (Y) Level (Level)\n\ndefine Gehe zu (x) (y)\npen up\ngo to x: (x) y: (y)\npen down\n\ndefine Landschaft (x) (y) Level (level)\nerase all\npoint in direction (90)\nstern draw\nset pen size to (10)\nGehe zu (x) (y)\nif <(level) = [1]> then\n    set pen color to (#00a8ff)\n    change y by (-240)\n    set pen color to (#003bff)\n    change x by (300)\n    set pen color to (#ff0000)\n    change x by (40)\n    set pen color to (#003bff)\n    change x by (80)\n    set pen color to (#00a9ff)\n    change y by (50)\n    set pen color to (#003bff)\n    change x by (200)\n    set pen color to (#ff0000)\n    change x by (40)\n    set pen color to (#00a8ff)\n    change y by (30)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#00a8ff)\n    change y by (-30)\n    set pen color to (#ff0000)\n    change x by (70)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#00a8ff)\n    change y by (-50)\n    set pen color to (#ff0000)\n    change x by (70)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#00a8ff)\n    change y by (-50)\n    set pen color to (#ff0000)\n    change x by (70)\n    set pen color to (#003bff)\n    change x by (300)\n    set pen color to (#00a8ff)\n    change y by (-70)\n    set pen color to (#ff0000)\n    change x by (50)\n    set pen color to (#00a8ff)\n    change y by (70)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#00a8ff)\n    change y by (-70)\n    set pen color to (#ff0000)\n    change x by (110)\n    set pen color to (#00a8ff)\n    change y by (70)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#f5fa00)\n    change y by (200)\nend\nif <(level) = [2]> then\n    set pen color to (#00a8ff)\n    change y by (-240)\n    set pen color to (#003bff)\n    change x by (200)\n    set pen color to (#ff0000)\n    change y by (30)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#ff0000)\n    change y by (30)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#ff0000)\n    change y by (30)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#ff0000)\n    change y by (30)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#00a8ff)\n    change y by (-200)\n    set pen color to (#003bff)\n    change x by (80)\n    set pen color to (#ff0000)\n    change x by (20)\n    set pen color to (#003bff)\n    change x by (80)\n    set pen color to (#ff0000)\n    change x by (20)\n    set pen color to (#003bff)\n    change x by (80)\n    set pen color to (#ff0000)\n    change x by (20)\n    set pen color to (#003bff)\n    change x by (80)\n    set pen color to (#ff0000)\n    change x by (20)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#ff0000)\n    change y by (20)\n    set pen color to (#ff0000)\n    change x by (30)\n    set pen color to (#ff0000)\n    change y by (-20)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#ff0000)\n    change y by (20)\n    set pen color to (#ff0000)\n    change x by (30)\n    set pen color to (#ff0000)\n    change y by (-20)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#ff0000)\n    change y by (20)\n    set pen color to (#ff0000)\n    change x by (35)\n    set pen color to (#ff0000)\n    change y by (-20)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#00a8ff)\n    change y by (-300)\n    set pen color to (#003bff)\n    change x by (200)\n    set pen color to (#00a8ff)\n    change y by (20)\n    set pen color to (#ff0000)\n    change x by (40)\n    set pen color to (#00a8ff)\n    change y by (20)\n    set pen color to (#003bff)\n    change x by (80)\n    set pen color to (#00a8ff)\n    change y by (20)\n    set pen color to (#ff0000)\n    change x by (40)\n    set pen color to (#00a8ff)\n    change y by (20)\n    set pen color to (#003bff)\n    change x by (80)\n    set pen color to (#00a8ff)\n    change y by (20)\n    set pen color to (#ff0000)\n    change x by (40)\n    set pen color to (#00a8ff)\n    change y by (20)\n    set pen color to (#003bff)\n    change x by (80)\n    set pen color to (#00a8ff)\n    change y by (20)\n    set pen color to (#ff0000)\n    change x by (50)\n    set pen color to (#00a8ff)\n    change y by (20)\n    set pen color to (#003bff)\n    change x by (80)\n    set pen color to (#f5fa00)\n    change y by (200)\nend\nif <(level) = [3]> then\n    set pen color to (#00a8ff)\n    change y by (-240)\n    set pen color to (#003bff)\n    change x by (300)\n    set pen color to (#00a9ff)\n    change y by (30)\n    set pen color to (#ff0000)\n    change x by (40)\n    set pen color to (#00a9ff)\n    change y by (30)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#00a9ff)\n    change y by (30)\n    set pen color to (#ff0000)\n    change x by (40)\n    set pen color to (#00a9ff)\n    change y by (30)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#00a9ff)\n    change y by (30)\n    set pen color to (#ff0000)\n    change x by (40)\n    set pen color to (#00a9ff)\n    change y by (30)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#00a9ff)\n    change y by (-300)\n    set pen color to (#003bff)\n    change x by (200)\n    set pen color to (#ff0000)\n    change x by (10)\n    set pen color to (#003bff)\n    change x by (70)\n    set pen color to (#ff0000)\n    change x by (10)\n    set pen color to (#003bff)\n    change x by (70)\n    set pen color to (#ff0000)\n    change x by (10)\n    set pen color to (#003bff)\n    change x by (70)\n    set pen color to (#ff0000)\n    change x by (10)\n    set pen color to (#003bff)\n    change x by (70)\n    set pen color to (#00a9ff)\n    change y by (50)\n    set pen color to (#003bff)\n    change x by (70)\n    set pen color to (#ff0000)\n    change x by (50)\n    set pen color to (#00a8ff)\n    change y by (30)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#00a9ff)\n    change y by (50)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#ff0000)\n    change x by (50)\n    set pen color to (#00a7ff)\n    change y by (30)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#00a8ff)\n    change y by (-70)\n    set pen color to (#ff0000)\n    change x by (100)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#00a8ff)\n    change y by (-70)\n    set pen color to (#ff0000)\n    change x by (100)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#f5fa00)\n    change y by (200)\nend\nif <(level) = [4]> then\n    set pen color to (#00a8ff)\n    change y by (-240)\n    set pen color to (#003bff)\n    change x by (300)\n    set pen color to (#ff0000)\n    change y by (25)\n    change x by (25)\n    set pen color to (#003bff)\n    change x by (60)\n    set pen color to (#ff0000)\n    change y by (25)\n    change x by (25)\n    set pen color to (#003bff)\n    change x by (60)\n    set pen color to (#ff0000)\n    change y by (25)\n    change x by (25)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#ff0000)\n    change y by (-100)\n    change x by (30)\n    set pen color to (#003bff)\n    change x by (70)\n    set pen color to (#ff0000)\n    change x by (30)\n    set pen color to (#003bff)\n    change x by (70)\n    set pen color to (#ff0000)\n    change x by (30)\n    set pen color to (#003bff)\n    change x by (100)\n    change x by (10)\n    set pen color to (#00a8ff)\n    change y by (70)\n    set pen color to (#ff0000)\n    change x by (20)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#ff0000)\n    change x by (20)\n    set pen color to (#003bff)\n    change x by (60)\n    set pen color to (#ff0000)\n    change x by (20)\n    set pen color to (#003bff)\n    change x by (60)\n    set pen color to (#ff0000)\n    change x by (20)\n    set pen color to (#003bff)\n    change x by (60)\n    set pen color to (#ff0000)\n    change x by (20)\n    set pen color to (#003bff)\n    change x by (60)\n    set pen color to (#f5fa00)\n    change y by (200)\nend\nif <(level) = [5]> then\n    set pen color to (#00a8ff)\n    change y by (-240)\n    set pen color to (#003bff)\n    change x by (300)\n    set pen color to (#00a8ff)\n    change y by (-200)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#ff0000)\n    change x by (30)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#ff0000)\n    change y by (50)\n    set pen color to (#003bff)\n    change x by (60)\n    set pen color to (#ff0000)\n    change y by (50)\n    set pen color to (#003bff)\n    change x by (40)\n    set pen color to (#ff0000)\n    change y by (40)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#ff0000)\n    change y by (-50)\n    change x by (85)\n    set pen color to (#003bff)\n    change x by (60)\n    set pen color to (#ff0000)\n    change x by (30)\n    set pen color to (#003bff)\n    change x by (200)\n    set pen color to (#003bff)\n    change x by (200)\n    change x by (-200)\n    set pen color to (#ff0000)\n    change y by (30)\n    change y by (-30)\n    set pen color to (#003bff)\n    change x by (200)\n    set pen color to (#ff0000)\n    change y by (40)\n    change y by (-40)\n    set pen color to (#003bff)\n    change x by (200)\n    set pen color to (#ff0000)\n    change y by (45)\n    change y by (-45)\n    set pen color to (#003bff)\n    change x by (200)\n    set pen color to (#f5fa00)\n    change y by (200)\nend\nif <(level) = [6]> then\n    set pen color to (#00a8ff)\n    change y by (-240)\n    set pen color to (#003bff)\n    change x by (300)\n    set pen color to (#ff0000)\n    change y by (40)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#ff0000)\n    change y by (40)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#ff0000)\n    change y by (40)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#ff0000)\n    change y by (40)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#ff0000)\n    change y by (40)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#ff0000)\n    change y by (40)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#ff0000)\n    change y by (40)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#ff0000)\n    change y by (40)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#ff0000)\n    change y by (40)\n    set pen color to (#003bff)\n    change x by (60)\n    set pen color to (#00a8ff)\n    change y by (-500)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#ff0000)\n    change y by (500)\n    set pen color to (#003bff)\n    change x by (60)\n    set pen color to (#ff0000)\n    change x by (80)\n    set pen color to (#003bff)\n    change x by (200)\n    set pen color to (#000000)\n    change y by (50)\n    set pen color to (#003bff)\n    change x by (-200)\n    set pen color to (#000000)\n    change x by (100)\n    set pen color to (#003bff)\n    change x by (100)\n    set pen color to (#000000)\n    change y by (70)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#000000)\n    change y by (70)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#000000)\n    change x by (100)\n    set pen color to (#003bff)\n    change x by (50)\n    set pen color to (#000000)\n    change x by (100)\n    set pen color to (#003bff)\n    change x by (200)\n    set pen color to (#ff0000)\n    change y by (50)\n    change y by (-50)\n    set pen color to (#000000)\n    change x by (65)\n    set pen color to (#003bff)\n    change x by (200)\n    set pen color to (#f5fa00)\n    change y by (200)\nend\n\nwhen I receive [stopp v]\nchange [zähler v] by (-1)\nset [abstand v] to [0]\nchange [x v] by (join (Y_X) [7])\nLandschaft (X) (Y) Level (Level)\n\nwhen I receive [züurück v]\nrepeat until <(Zähler) < [50]>\n    change [x v] by (80)\n    Landschaft (X) (Y) Level (Level)\n    set [y_x v] to [-]\n    change [zähler v] by (-16)\nend\nchange [x v] by (-50)\nLandschaft (X) (Y) Level (Level)\nset [y_x v] to [-]\nset [y v] to [180]\nset [x v] to [-240]\nLandschaft (X) (Y) Level (Level)\nset [zähler v] to [0]\n\nwhen I receive [züurück v]\nrepeat until <(Y) = [180]>\n    Landschaft (X) (Y) Level (Level)\n    if <(Y) > [180]> then\n        change [y v] by (-5)\n        Landschaft (X) (Y) Level (Level)\n    end\n    if <(Y) < [180]> then\n        change [y v] by (5)\n        Landschaft (X) (Y) Level (Level)\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Musik v] until done\nend\n\nwhen I receive [lv up v]\nset [y v] to [180]\nset [x v] to [-240]\nLandschaft (X) (Y) Level (Level)\n\nwhen flag clicked\nset [x v] to [-240]\nset [y v] to [180]\nforever\n    if <key (up arrow v) pressed?> then\n        set [falltempo v] to [-15]\n        repeat (10)\n            change [y v] by (Falltempo)\n            Landschaft (X) (Y) Level (Level)\n            change [falltempo v] by (1)\n        end\n        set [falltempo v] to [0]\n        repeat until <(Berührt) = [1]>\n            change [y v] by (Falltempo)\n            Landschaft (X) (Y) Level (Level)\n            change [falltempo v] by (1)\n        end\n    end\n    if <(Runter) = [1]> then\n        set [falltempo v] to [2]\n        repeat until <(Runter) = [0]>\n            change [y v] by (Falltempo)\n            Landschaft (X) (Y) Level (Level)\n            change [falltempo v] by (3)\n        end\n    end\nend\n\nwhen flag clicked\nswitch costume to (kostüm1 v)\nset [zähler v] to [0]\nset [x v] to [-240]\nset [y v] to [180]\nLandschaft (X) (Y) Level (Level)\nforever\n    if <key (right arrow v) pressed?> then\n        set [y_x v] to []\n        change [zähler v] by (1)\n        change [x v] by (-5)\n        Landschaft (X) (Y) Level (Level)\n    end\n    if <key (left arrow v) pressed?> then\n        change [x v] by (5)\n        Landschaft (X) (Y) Level (Level)\n        set [y_x v] to [-]\n        change [zähler v] by (-1)\n    end\nend\n\nwhen flag clicked\nforever\n    if <[2000] < (y position)> then\n        set [falltempo v] to [0]\n        broadcast (Züurück v)\n    end\n    if <(Level) = [7]> then\n        broadcast (win v)\n        stop [other scripts in sprite v]\n        stop all sounds\n        start sound [Win v]\n        stop [this script v]\n    end\nend\n\nset [level v] to [5]\n\nchange y by (40)\nchange x by (60)\n\nset pen color to (#00a8ff)\n\nset pen color to (#ff0000)\n\nchange x by (80)\nchange x by (60)\n\nset pen color to (#003bff)\nset pen color to (#003bff)\nset pen color to (#003bff)\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    if <<<(y position) = [3774]> or <(y position) = [3604]>> or <<(y position) = [3724]> or <<(y position) = [3864]> or <(y position) = [3604]>>>> then\n        forever\n            broadcast (error v)\n            show\n            switch costume to (kostüm2 v)\n            go to x: (0) y: (0)\n            erase all\n        end\n    else\n        hide\n        switch costume to (kostüm1 v)\n    end\nend\n\nset [level v] to [6]\n\nchange x by (30)\n\nset [level v] to [6]\n\nset pen color to (#00a8ff)\nchange y by (-200)\nset pen color to (#003bff)\n\nset pen color to (#000000)\n\nchange x by (200)\nchange x by (100)\n\nset pen color to (#003bff)\nchange x by (-200)\n\nset pen color to (#003bff)\n\nchange y by (70)\n\nset pen color to (#00a8ff)\nchange y by (-200)\nset pen color to (#003bff)\nchange x by (200)\n\ndefine stern create\ndelete all of [stern x v]\ndelete all of [stern y v]\ndelete all of [stern dicke v]\npen up\nrepeat (50)\n    go to (random position v)\n    add (x position) to [stern x v]\n    add (y position) to [stern y v]\n    add (pick random (2) to (7)) to [stern dicke v]\nend\n\nwhen flag clicked\nstern create\n\ndefine stern draw\nset [counter v] to [0]\nrepeat (length of [stern x v])\n    set pen color to (#ffffff)\n    change [counter v] by (1)\n    pen up\n    go to x: (item (counter) of [stern x v]) y: (item (counter) of [stern y v])\n    set pen size to (item (counter) of [stern dicke v])\n    pen down\n    change x by (0.1)\nend\n\nset [counter v] to [0]\n\n@Kreis+Anfangsbild\n\nwhen flag clicked\nset [color v] effect to (0)\nshow\nset [level v] to [1]\ngo to x: (-100) y: (-5)\nswitch costume to (kostüm1 v)\nforever\n    if <<touching color (#003bff)?> or <touching color (#ff0000)?>> then\n        set [berührt v] to [1]\n    else\n        set [berührt v] to [0]\n    end\n    if <touching color (#00a7ff)?> then\n        broadcast (Stopp v)\n    end\n    if <touching color (#ff0000)?> then\n        broadcast (Züurück v)\n    end\n    if <not <touching color (#003bff)?>> then\n        set [runter v] to [1]\n    else\n        set [runter v] to [0]\n    end\n    if <touching color (#f4fa00)?> then\n        broadcast (Lv up v) and wait\n        set [zähler v] to [0]\n        change [level v] by (1)\n    end\nend\n\nwhen I receive [win v]\nswitch costume to (kostüm2 v)\ngo to x: (0) y: (0)\nforever\n    change [color v] effect by (5)\nend\n\nwhen I receive [error v]\nhide\n\nwhen flag clicked\nforever\n    if <touching color (#00a8ff)?> then\n        broadcast (Stopp v)\n    end\nend\n\n@Figur1\n\nwhen flag clicked\nhide\n\n