Rabbit Platformer

Instructions: ⭐ Rabbit Platformer ⭐\n- move with the arrow keys\n- travel trough three worlds:\n            grassland\n            desert\n            cloudy sky

@Stage\n\n@manager\n\ndefine Level (number or text)\nset [level v] to (number or text)\nbroadcast (Reset v)\nbroadcast (Setup v)\n\nLevel [3]\n\n@Platforms\n\nclone at x [360] y [0]\nclone at x [0] y [300]\n\nclone at x [450] y [10]\nclone at x [450] y [20]\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (scroll x)) ((y) - (scroll y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(level) = [1]> then\n    switch costume to (level 1 1 v)\n    clone at x [450] y [0]\n    clone at x [450] y [0]\n    clone at x [450] y [0]\n    clone at x [450] y [0]\n    clone at x [450] y [0]\nelse\n    if <(level) = [2]> then\n        switch costume to (level 2 1 v)\n        clone at x [450] y [0]\n        clone at x [450] y [0]\n        clone at x [450] y [10]\n        clone at x [450] y [20]\n    else\n        if <(level) = [3]> then\n            switch costume to (level 3 1 v)\n            clone at x [450] y [30]\n            clone at x [450] y [20]\n            clone at x [450] y [30]\n            clone at x [450] y [20]\n        else\n            switch costume to (end v)\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine clone at x (x) y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nshow\n\nset [level v] to [2]\nbroadcast (Setup v)\n\nwhen flag clicked\nshow\n\n@EXIT\n\nwhen I receive [open portal v]\nswitch costume to (open v)\n\nset [exit v] to []\n\nset [x v] to [-999999]\n\nswitch costume to (open v)\nclone at x [689] y [-122]\n\nif <(level) = [4]> then\n\nset [x v] to [-999999]\n\nswitch costume to (open v)\n\nclone at x [5000000000000000000000000000000000000000000000000000000000000000] y [-122]\n\nhide\n\nif <(level) = [3]> then\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (scroll x)) ((y) - (scroll y))\nif <<(costume [name v]) = [OPEN]> and <touching (player v)?>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\nhide\nhide variable [mouse v]\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(level) = [1]> then\n    switch costume to (open v)\n    clone at x [2550] y [84]\nelse\n    if <(level) = [2]> then\n        switch costume to (open v)\n        clone at x [2179] y [-80]\n        if <(level) = [2]> then\n            switch costume to (open v)\n            clone at x [2179] y [-80]\n        end\n    else\n        switch costume to (open v)\n        clone at x [2179] y [-92]\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine clone at x (x) y (y)\nset [x v] to (x)\nset [y v] to (y)\n\nshow\n\n@player\n\nwhen flag clicked\nshow\nset rotation style [left-right v]\nbroadcast (Green flag v) and wait\nbroadcast (play game v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(exit) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(exit) = [win]> then\n        game - win\n    else\n        Game-die\n    end\nend\n\ndefine Game On\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\ndefine Tick\nif <key (left arrow v) pressed?> then\n    change player x by [-8]\n    point in direction (-90)\nend\nif <key (right arrow v) pressed?> then\n    point in direction (90)\n    change player x by [8]\nend\nif <key (up arrow v) pressed?> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nchange [sy v] by (-2)\nchange player y by (sy)\ntest-die\nset [scroll x v] to (x)\nif <(scroll x) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (scroll y)) / (10)))\nif <(scroll y) < [0]> then\n    set [scroll y v] to [0]\nend\nposition\nif <<(y) < [-180]> or <touching (stacheln & co. v)?>> then\n    set [exit v] to [die]\nend\n\ndefine change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nposition\nrepeat until <not <touching (platforms v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    position\n    set [sy v] to [0]\nend\n\ndefine position\ngo to x: ((x) - (scroll x)) y: ((y) - (scroll y))\n\ndefine change player x by (sx)\nchange [x v] by (sx)\nposition\nif <touching (stacheln & co. v)?> then\n    set [exit v] to []\nend\nif <touching (platforms v)?> then\n    if <touching color (#00fd63)?> then\n        broadcast (egg v)\n    end\n    repeat until <not <touching (platforms v)?>>\n        repeat (12)\n            change [y v] by (-12)\n            if <(sx) > [0]> then\n                change [x v] by (-1)\n                change [y v] by (1)\n                position\n                if <not <touching (platforms v)?>> then\n                    stop [this script v]\n                end\n            else\n                change [x v] by (1)\n            end\n            position\n        end\n    end\nend\n\nGame-die\n\nif <touching (stacheln & co. v)?> then\n    set [exit v] to []\nend\n\nGame-die\n\ndefine Game-die\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\n\ndefine test-die\nif <touching (danger v)?> then\n    set [exit v] to [die]\nend\n\ndefine game - win\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nchange [level v] by (1)\nwait (1) seconds\n\nset [scroll y v] to [0]\n\nbroadcast (egg v)\n\nsay [Hallo!] for (1) seconds\n\n@Sprite2\n\nwhen flag clicked\nforever\n    play sound [Trunks Theme_Her v] until done\nend\n\n@Stacheln & Co.\n\nclone at x [360] y [0]\nclone at x [0] y [300]\n\nclone at x [450] y [10]\nclone at x [450] y [20]\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (scroll x)) ((y) - (scroll y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(level) = [1]> then\n    switch costume to (level 1 1 v)\n    clone at x [450] y [0]\n    clone at x [450] y [0]\n    clone at x [450] y [0]\n    clone at x [450] y [0]\n    clone at x [450] y [0]\nelse\n    if <(level) = [2]> then\n        switch costume to (level 2 1 v)\n        clone at x [450] y [0]\n        clone at x [450] y [0]\n        clone at x [450] y [10]\n        clone at x [450] y [20]\n    else\n        if <(level) = [3]> then\n            switch costume to (level 3 1 v)\n            clone at x [450] y [30]\n            clone at x [450] y [20]\n            clone at x [450] y [30]\n            clone at x [450] y [20]\n        else\n            switch costume to (end v)\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine clone at x (x) y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nshow\n\n@Sontiges\n\nclone at x [360] y [0]\nclone at x [0] y [300]\n\nclone at x [450] y [10]\nclone at x [450] y [20]\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (scroll x)) ((y) - (scroll y))\nif <(costume [name v]) = [level 3 2]> then\n    if <touching (player v)?> then\n        say [Search the white point to get on the cloud!]\n    else\n        say []\n    end\nend\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(level) = [1]> then\n    switch costume to (level 1 1 v)\n    clone at x [450] y [0]\n    clone at x [450] y [0]\n    clone at x [450] y [0]\n    clone at x [450] y [0]\n    clone at x [450] y [0]\nelse\n    if <(level) = [2]> then\n        switch costume to (level 2 1 v)\n        clone at x [450] y [0]\n        clone at x [450] y [0]\n        clone at x [450] y [10]\n        clone at x [450] y [20]\n    else\n        if <(level) = [3]> then\n            switch costume to (level 3 1 v)\n            clone at x [450] y [30]\n            clone at x [450] y [20]\n            clone at x [450] y [30]\n            clone at x [450] y [20]\n        else\n            switch costume to (end v)\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine clone at x (x) y (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nshow\n\nwhen flag clicked\nhide\n\n@Figur1\n\n@Figur2\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\nshow\ngo to [front v] layer\n\n