⁂Platformer⁂
@Stage\n\nwhen flag clicked\nswitch backdrop to (bühnenbild2 v)\n\nwhen I receive [finished intro v]\nswitch backdrop to (front picture v)\n\nwhen I receive [start game v]\nswitch backdrop to (bühnenbild2 v)\n\n@layer\n\nwhen flag clicked\nswitch costume to (kostüm1 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nbroadcast (finished Intro v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (kostüm3 v)\n\nwhen I receive [next level v]\nnext costume\nset [ghost v] effect to (0)\n\nwhen I receive [previous level v]\nswitch costume to ((costume [number v]) - (1))\nset [ghost v] effect to (0)\n\n@moving_platforms\n\nwhen flag clicked\nswitch costume to (kostüm1 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nwait (0.5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nbroadcast (finished Intro v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [next level v]\nnext costume\nset [ghost v] effect to (0)\ngo to x: (-36) y: (-22)\nif <<(costume [number v]) = [7]> or <(costume [number v]) = [11]>> then\n    forever\n        repeat (40)\n            change x by (5)\n        end\n        repeat (40)\n            change x by (-5)\n        end\n    end\nend\n\nwhen I receive [previous level v]\nswitch costume to ((costume [number v]) - (1))\nset [ghost v] effect to (0)\ngo to x: (-36) y: (-22)\nif <<(costume [number v]) = [7]> or <(costume [number v]) = [11]>> then\n    forever\n        repeat (40)\n            change x by (5)\n        end\n        repeat (40)\n            change x by (-5)\n        end\n    end\nend\n\n@trampolines\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nswitch costume to (kostüm1 v)\nshow\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [previous level v]\nswitch costume to ((costume [number v]) - (1))\n\n@transformer\n\nwhen I receive [start game v]\ngo to x: (127) y: (-23)\nswitch costume to (kostüm3 v)\nset [ghost v] effect to (0)\nshow\n\nwhen I receive [next level v]\nshow\nset [knife? v] to [No]\ngo to x: (127) y: (-23)\nset [ghost v] effect to (0)\nnext costume\n\nwhen I receive [previous level v]\nshow\ngo to x: (127) y: (-23)\nset [ghost v] effect to (0)\nswitch costume to ((costume [number v]) - (1))\nif <(costume [number v]) = [11]> then\n    switch costume to ((costume [number v]) - (1))\nend\nset [knife? v] to [No]\n\nwhen flag clicked\nset [knife? v] to [No]\nhide\nforever\n    if <<touching (player v)?> and <(Knife?) = [Yes]>> then\n        switch costume to (kostüm2 v)\n        forever\n            repeat (15)\n                change y by (-5)\n            end\n            if <touching (danger v)?> then\n                repeat (10)\n                    change [ghost v] effect by (10)\n                    change y by (-2)\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [knife caught v]\nset [knife? v] to [Yes]\n\nwhen I receive [random v]\nhide\n\n@knife\n\nwhen I receive [next level v]\nshow\nset [ghost v] effect to (0)\nnext costume\nrepeat until <touching (player v)?>\n    go to x: (106) y: (134)\nend\n\nwhen I receive [previous level v]\nshow\nset [ghost v] effect to (0)\nswitch costume to ((costume [number v]) - (1))\nrepeat until <touching (player v)?>\n    go to x: (106) y: (134)\nend\n\nwhen I receive [start game v]\nset [ghost v] effect to (0)\nswitch costume to (kostüm2 v)\nshow\n\nwhen flag clicked\nhide\nforever\n    set size to (25) %\n    if <touching (player v)?> then\n        forever\n            go to (player v)\n            if <touching (player v)?> then\n                set [knife? v] to [Yes]\n            else\n                set [knife? v] to [No]\n            end\n        end\n    end\nend\n\n@trampolines_2\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nswitch costume to (kostüm1 v)\nshow\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [previous level v]\nswitch costume to ((costume [number v]) - (1))\n\n@water\n\nwhen I receive [start game v]\nset [color v] effect to (110)\nswitch costume to (beginning v)\n\nwhen I receive [previous level v]\nswitch costume to ((costume [number v]) - (1))\nhide\n\nwhen I receive [next level v]\nnext costume\nhide\n\nwhen flag clicked\nhide\nswitch costume to (beginning v)\n\nwhen I receive [show water v]\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\n@Speech\n\nwhen flag clicked\nhide\nswitch costume to (beginning v)\n\nwhen I receive [next level v]\nnext costume\nif <(costume [number v]) = [9]> then\n    next costume\nend\nif <(costume [number v]) = [14]> then\n    broadcast (Game completed! v)\nend\n\nwhen I receive [previous level v]\nswitch costume to ((costume [number v]) - (1))\nif <(costume [number v]) = [8]> then\n    switch costume to ((costume [number v]) - (1))\nend\n\nwhen I receive [start game v]\nswitch costume to (beginning v)\nshow\n\nwhen I receive [remove wall v]\nswitch costume to (kostüm4 v)\n\n@Figur1\n\nwhen flag clicked\nset [ghost v] effect to (100)\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) = [150]>\n            repeat (5)\n                change size by (10)\n            end\n        end\n    else\n        repeat until <(size) = [100]>\n            repeat (5)\n                change size by (-10)\n            end\n        end\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Start game v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@Player\n\nwhen flag clicked\nhide\ngo to x: (-200) y: (-96)\nset [x vel. v] to [0]\nset [y vel. v] to [0]\nforever\n    change [y vel. v] by (-1)\n    Controls\n    React to surroundings\n    React to Death\n    Jumping\n    Level Generator\nend\n\ndefine Controls\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    change [x vel. v] by (1)\n    switch costume to (player_right v)\nelse\n    switch costume to (player_normal v)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [x vel. v] by (-1)\n    switch costume to (player_left v)\nend\nset [x vel. v] to ((X vel.) * (0.9))\nchange x by (X vel.)\n\ndefine Jumping\nchange y by (-1)\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> and <<<touching (platform v)?> or <touching (moving_platforms v)?>> or <touching (water v)?>>> then\n    switch costume to (player_jumping v)\n    set [y vel. v] to [9]\nend\nchange y by (1)\n\ndefine React to Death\nif <<<touching (danger v)?> or <(y position) < [-170]>> or <touching (bad guy v)?>> then\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    switch costume to (player_dead v)\n    set [ghost v] effect to (50)\n    repeat (5)\n        change y by (5)\n    end\n    repeat (7)\n        change [ghost v] effect by (10)\n    end\n    go to x: (-200) y: (-96)\n    broadcast (Bad Guys Back v)\n    wait (1) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    set [x vel. v] to [0]\n    set [y vel. v] to [5]\nend\n\ndefine Level Generator\nif <<(x position) = [240]> or <(x position) > [240]>> then\n    broadcast (Next Level v)\n    go to x: (-200) y: (-96)\nend\n\nwhen I receive [start game v]\ngo to x: (-200) y: (-96)\nshow\n\ndefine React to surroundings\nchange [y vel. v] by (0.5)\nif <<touching (platform v)?> or <touching (moving_platforms v)?>> then\n    change x by ((X vel.) * (-1))\n    set [x vel. v] to [0]\nend\nchange y by (Y vel.)\nif <<touching (platform v)?> or <touching (moving_platforms v)?>> then\n    change y by ((Y vel.) * (-1))\n    set [y vel. v] to [0]\nend\nif <touching (layer v)?> then\n    broadcast (remove wall v)\nend\nif <touching (knife v)?> then\n    broadcast (Knife caught v)\nend\nif <touching (water v)?> then\n    change y by ((Y vel.) + (0.4))\n    set [y vel. v] to [0]\nend\nif <touching (trampolines v)?> then\n    set [y vel. v] to [15]\nend\nif <touching (trampolines_2 v)?> then\n    set [y vel. v] to [10]\nend\n\n@Platform\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nnext costume\nif <(costume [number v]) = [12]> then\n    broadcast (random v)\nend\nif <(costume [number v]) = [13]> then\n    broadcast (End v)\nend\nif <(costume [number v]) = [9]> then\n    next costume\nend\n\nwhen I receive [previous level v]\nswitch costume to ((costume [number v]) - (1))\nif <(costume [number v]) = [8]> then\n    switch costume to ((costume [number v]) - (1))\nend\n\nwhen I receive [start game v]\nswitch costume to (kostüm6 v)\nshow\n\nwhen I receive [remove wall v]\nswitch costume to (kostüm9 v)\n\n@Bad Guy\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nswitch costume to (kostüm2 v)\nshow\n\nwhen I receive [next level v]\ngo to x: (133) y: (-128)\nnext costume\nforever\n    if <(costume [number v]) = [12]> then\n        forever\n            React to Platform\n            set rotation style [left-right v]\n            point towards (player v)\n            move (2) steps\n        end\n    end\nend\n\nwhen I receive [previous level v]\ngo to x: (133) y: (-128)\nswitch costume to ((costume [number v]) - (1))\nforever\n    if <(costume [number v]) = [12]> then\n        React to Platform\n        set rotation style [left-right v]\n        point towards (player v)\n    end\nend\n\ndefine React to Platform\nchange [y vel v] by (-0.5)\nif <<touching (platform v)?> or <touching (moving_platforms v)?>> then\n    change x by ((x vel) * (-1))\n    set [x vel v] to [0]\nend\nchange y by (y vel)\nif <<touching (platform v)?> or <touching (moving_platforms v)?>> then\n    change y by ((y vel) * (-1))\n    set [y vel v] to [0]\nend\nif <touching (layer v)?> then\n    broadcast (remove wall v)\nend\nif <touching (knife v)?> then\n    broadcast (Knife caught v)\nend\nif <touching (water v)?> then\n    change y by ((y vel) + (0.4))\n    set [y vel v] to [0]\nend\nif <touching (trampolines v)?> then\n    set [y vel v] to [15]\nend\nif <touching (trampolines_2 v)?> then\n    set [y vel v] to [10]\nend\n\nmove (2) steps\n\nwhen I receive [bad guys back v]\ngo to x: (133) y: (-128)\n\n@Danger\n\nwhen flag clicked\nhide\nswitch costume to (beginning v)\nforever\n    if <touching (transformer v)?> then\n        broadcast (Show water v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n    end\nend\n\nwhen I receive [next level v]\nshow\nset [ghost v] effect to (0)\nnext costume\n\nwhen I receive [previous level v]\nshow\nset [ghost v] effect to (0)\nswitch costume to ((costume [number v]) - (1))\n\nwhen I receive [start game v]\nset [color v] effect to (0)\nswitch costume to (beginning v)\nshow\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (-195) y: (160)\nhide\n\nwhen this sprite clicked\nbroadcast (Next Level v)\n\nwhen I receive [start game v]\nshow\n\nwhen I receive [game completed! v]\nhide\n\n
-------------------------------Controls-------------------------------\nControl the player with the arrows:\nup arrow or w   --> jump\nleft arrow or a   --> left\nright arrow or d --> right.\n-------------------------------------------------------------------------\nEasy isn't it?\nWell then I won't hold you back!\nHave fun!!!