Relaxation 5 #Games #Platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (blue sky v)\nforever\n    if <(Level) = [1]> then\n        switch backdrop to (blue sky v)\n    end\n    if <(Level) = [2]> then\n        switch backdrop to (almostcave v)\n    end\n    if <(Level) > [2]> then\n        switch backdrop to (cave v)\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Inferno v] until done\nend\n\n@Player\n\nwhen flag clicked\nset [hand v] to []\nset [level v] to [1]\nset [x v] to [0]\nset [y v] to [0]\ncreate clone of (_myself_ v)\nshow\nset [myself v] to [Player]\nset size to (80) %\nswitch costume to (hitbox v)\ngo to x: (-190) y: (50)\nset [ghost v] effect to (100)\nset drag mode [not draggable v]\npoint in direction (90)\nforever\n    set [sword direction v] to (direction)\n    set rotation style [left-right v]\n    if <<<mouse down?> and <(x position) > (mouse x)>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n        set [direction v] to [L]\n        change [x v] by (-1)\n        point in direction (-90)\n    end\n    if <<<mouse down?> and <(x position) < (mouse x)>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n        set [direction v] to [R]\n        change [x v] by (1)\n        point in direction (90)\n    end\n    set [x v] to ((X) * (0.9))\n    change x by (X)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change x by ((X) * (-1))\n                            change y by (-5)\n                            if <<<mouse down?> and <(y position) < (mouse y)>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                                if <(X) > [0]> then\n                                    set [x v] to [-7]\n                                else\n                                    set [x v] to [7]\n                                end\n                                set [y v] to [14]\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (-1)\n    if <touching (ground v)?> then\n        if <<<mouse down?> and <(y position) < (mouse y)>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            set [y v] to [14]\n            point in direction ((Y) * (0.5))\n        end\n    end\n    change y by (1)\n    change [y v] by (-1)\n    change y by (Y)\n    if <touching (ground v)?> then\n        change y by ((Y) * (-1))\n        set [y v] to [0]\n    end\n    hide variable [x v]\n    if <(x position) > [230]> then\n        if <(Level) = [9]> then\n            if <(Help) = [1]> then\n                broadcast (Restart v)\n                change [level v] by (1)\n                set [y v] to [0]\n                set [x v] to [0]\n                go to x: (-190) y: (0)\n            end\n        else\n            broadcast (Restart v)\n            change [level v] by (1)\n            set [y v] to [0]\n            set [x v] to [0]\n            go to x: (-190) y: (0)\n        end\n    end\n    if <<touching (danger v)?> or <<touching (zombies v)?> or <(y position) < [-170]>>> then\n        start sound [Meow v]\n        go to x: (-190) y: (-10)\n        broadcast (Restart v)\n    end\nend\n\nwhen I receive [hand v]\nset [hand v] to [-]\n\nwhen I start as a clone\nshow\nset [costume v] to [0]\nclear graphic effects\nforever\n    go to [front v] layer\n    go [backward v] (4) layers\n    switch costume to (join (join [R] (Costume)) (Hand))\n    go to (Myself)\n    if <<<mouse down?> and <(x position) > (mouse x)>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n        point in direction (-90)\n    end\n    if <<<mouse down?> and <(x position) < (mouse x)>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n        point in direction (90)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <not <<<<mouse down?> and <(x position) > (mouse x)>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<<mouse down?> and <(x position) < (mouse x)>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>>>> then\n        set [costume v] to [0]\n    else\n        if <(Costume) = [16]> then\n            set [costume v] to [1]\n        else\n            change [costume v] by (1)\n        end\n    end\nend\n\n@ground\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Danger\n\nwhen flag clicked\nforever\n    switch costume to (Level)\n    switch costume to (Level)\nend\n\n@Back\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Words\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Zombies\n\nwhen I receive [restart v]\ndelete this clone\n\ndefine Clone (type) (x) (y)\ngo to x: (x) y: (y)\nswitch costume to (type)\nset [clone# v] to (type)\ncreate clone of (_myself_ v)\n\nwhen I receive [restart v]\nhide\nif  then\n    delete this clone\nend\nif <(Level) = [5]> then\n    Clone [1] [151] [82]\n    Clone [1] [210] [82]\nend\nif <(Level) = [6]> then\n    Clone [1] [-64] [-125]\n    Clone [1] [26] [-125]\nend\nif <(Level) = [7]> then\n    Clone [1] [22] [89]\n    Clone [1] [211] [89]\nend\nif <(Level) = [8]> then\n    Clone [1] [172] [-77]\nend\nif <(Level) = [10]> then\n    Clone [1] [134] [-77]\n    Clone [1] [53] [-76]\n    Clone [1] [-37] [-76]\nend\nif <(Level) = [11]> then\n    Clone [1] [129] [-22]\nend\nif <(Level) = [12]> then\n    Clone [1] [-181] [101]\n    Clone [1] [-181] [101]\nend\nif <(Level) = [13]> then\n    Clone [1] [-67] [41]\n    Clone [1] [50] [41]\n    Clone [1] [122] [-29]\n    Clone [1] [203] [-109]\nend\nif <(Level) = [14]> then\n    Clone [1] [154] [69]\n    Clone [1] [0] [-61]\nend\nif <(Level) = [15]> then\n    Clone [1] [143] [-76]\nend\nif <(Level) = [16]> then\n    Clone [1] [-32] [-76]\nend\nif <(Level) = [17]> then\n    Clone [1] [207] [-43]\nend\nif <(Level) = [18]> then\n    Clone [1] [109] [-72]\n    Clone [1] [199] [-72]\nend\nif <(Level) = [19]> then\n    Clone [1] [175] [-83]\n    Clone [1] [86] [-83]\nend\n\nwhen I start as a clone\nclear graphic effects\nset size to (80) %\nshow\ngo to [front v] layer\ngo [backward v] (5) layers\nset [enemyx v] to [0]\nset [enemyy v] to [0]\nswitch costume to (1r1 v)\nwait (0) seconds\nforever\n    switch costume to (hitbox v)\n    change [enemyy v] by (-1)\n    if <([x position v] of [player v]) < ((x position) - (10))> then\n        change [enemyx v] by ((0) - ((Speed) / (10)))\n        point in direction (-90)\n    end\n    if <((x position) - (-10)) < ([x position v] of [player v])> then\n        change [enemyx v] by ((Speed) / (10))\n        point in direction (90)\n    end\n    set [enemyx v] to ((Enemyx) * (0.9))\n    change x by (Enemyx)\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((Enemyx) * (-1))\n        if <(y position) < ([y position v] of [player v])> then\n            set [enemyy v] to [10]\n            if <([abs v] of (x) ) = (x)> then\n                set [enemyx v] to [-10]\n            else\n                set [enemyx v] to [10]\n            end\n        else\n            set [enemyx v] to [0]\n        end\n    end\n    change y by (Enemyy)\n    if <touching (ground v)?> then\n        change y by ((Enemyy) - ((Enemyy) * (2)))\n        set [enemyy v] to [0]\n    end\n    change y by (-1)\n    if <<((y position) - (-50)) < ([y position v] of [player v])> and <touching (ground v)?>> then\n        set [enemyy v] to [14]\n    end\n    change y by (1)\n    switch costume to (join [1R] (Zombie costume))\n    if <<touching color (#b70000)?> or <<(y position) < [-175]> or <<touching (sword v)?> and <(Sword) = [1]>>>> then\n        switch costume to (1r1 v)\n        start sound [Meow v]\n        set [pitch v] effect to (-50)\n        clear graphic effects\n        set rotation style [all around v]\n        repeat (20)\n            turn right (15) degrees\n            change y by (10)\n            change [ghost v] effect by (5)\n        end\n        delete this clone\n    end\nend\n\nwhen flag clicked\nbroadcast (Restart v)\nset [speed v] to [2]\n\nwhen I start as a clone\nforever\n    if <(Zombie costume) = [5]> then\n        set [zombie costume v] to [1]\n        wait (0.1) seconds\n    else\n        change [zombie costume v] by (1)\n        wait (0.1) seconds\n    end\nend\n\n@Key\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        set [pick key? v] to [1]\n        play sound [Collect v] until done\n    end\nend\n\nwhen flag clicked\ngo to x: (15) y: (34)\nforever\n    repeat (5)\n        change y by (1)\n    end\n    wait (0.1) seconds\n    repeat (5)\n        change y by (-1)\n    end\n    wait (0.1) seconds\nend\n\nwhen I receive [restart v]\nhide\nset [pick key? v] to [0]\nforever\n    if <(Level) = [8]> then\n        if <(Pick Key?) = [1]> then\n            hide\n        else\n            show\n        end\n    end\nend\n\n@Blank2\n\n@Blank\n\n@Blank15\n\n@Blank3\n\n@Pico\n\nwhen flag clicked\nset [help v] to [0]\nswitch costume to (costume1 v)\nforever\n    if <(Level) = [9]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Help) = [0]> then\n        say [Help me! If you have the key, click the cage to save me!]\n        switch costume to (costume1 v)\n    else\n        say [Thank you very much! I will give you a sword. Use it to kill zombies!]\n        switch costume to (costume2 v)\n    end\nend\n\nwhen this sprite clicked\nset [help v] to [1]\nbroadcast (Hand v)\n\n@Blank4\n\n@Blank5\n\n@Blank6\n\n@Blank14\n\n@Blank12\n\n@Blank10\n\n@Blank13\n\n@Blank7\n\n@Blank11\n\n@Blank9\n\n@Blank8\n\n@Blank16\n\n@Blank17\n\n@Blank18\n\n@Blank19\n\n@Blank20\n\n@Sword\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo [backward v] (2) layers\nforever\n    set rotation style [left-right v]\n    go to (player v)\nend\n\nwhen I receive [sword v]\nwait (0) seconds\nset [sword v] to [1]\nswitch costume to (costume1 v)\nrepeat (6)\n    wait (0.05) seconds\n    next costume\nend\nwait (0.01) seconds\nrepeat (6)\n    wait (0.05) seconds\n    switch costume to ((costume [number v]) - (1))\nend\nset [sword v] to [0]\n\nwhen flag clicked\nforever\n    if <(Hand) = [-]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<mouse down?> and <(x position) > (mouse x)>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n        point in direction (-90)\n    end\n    if <<<mouse down?> and <(x position) < (mouse x)>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n        point in direction (90)\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\ngo to [front v] layer\ngo [backward v] (1) layers\nforever\n    if <(Hand) = [-]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Sword v)\n\nwhen [space v] key pressed\nbroadcast (Sword v)\n\n@Rock\n\nwhen I start as a clone\ngo to x: (300) y: (pick random (-160) to (160))\nset [ghost v] effect to (pick random (0) to (0))\nswitch costume to (pick random (1) to (3))\nset size to (100) %\nset rotation style [all around v]\ngo to [back v] layer\npoint in direction (90)\nshow\nrepeat until <[-280] > (x position)>\n    change x by (pick random (-10) to (-15))\nend\ndelete this clone\n\nwhen flag clicked\nswitch backdrop to (blue sky v)\nforever\n    if <(backdrop [number v]) = [3]> then\n        hide\n        create clone of (_myself_ v)\n        wait (0.4) seconds\n    else\n        delete this clone\n    end\nend\n\nwhen flag clicked\nhide\nrepeat until <(backdrop [number v]) = [3]>\n    delete this clone\nend\n\n@Blank21\n\n@Blank22\n\n@Blank23\n\n@Blank24\n\n@Blank25\n\n@Blank26\n\n@Blank27\n\n@Blank28\n\n@Blank29\n\n@Blank30\n\n@Chest\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    if <(Level) = [20]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [open v]\nstart sound [hit v]\nswitch costume to (costume2 v)\n\n@Blank31\n\n@Blank32\n\n@Blank33\n\n@Blank34\n\n@detector\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nset [actions \(love/fave\) v] to [0]\nforever\n    set [touching v] to [none]\n    Detect [love] at [-201] [-220]\n    Detect [fave] at [-201] [-220]\nend\n\ndefine Detect (thing) at (x) (y)\nswitch costume to (empty v)\nset size to (27000) %\ngo to x: (x) y: (y)\nset size to (100) %\nswitch costume to (thing)\nif <touching (mouse-pointer v)?> then\n    set [touching v] to (costume [name v])\nend\n\nwhen flag clicked\nforever\n    wait until <(touching) = [love]>\n    wait (0.2) seconds\n    if <(touching) = [love]> then\n        change [actions \(love/fave\) v] by (1)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    wait until <(touching) = [fave]>\n    wait (0.2) seconds\n    if <(touching) = [fave]> then\n        change [actions \(love/fave\) v] by (1)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nwait until <(Actions \(love/fave\)) = [2]>\nbroadcast (Open v)\n\n@TB\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to [front v] layer\nforever\n    reset timer\nend\n\nwhen [timer v] > (0)\nset [ghost v] effect to (0)\nswitch costume to (costume2 v)\nset size to (150) %\nswitch costume to (costume1 v)\nset [brightness v] effect to (100)\nrepeat (25)\n    change [brightness v] effect by (-4)\n    switch costume to (costume2 v)\n    go to [front v] layer\n    change size by (((size) + (-100)) / (-10))\n    switch costume to (costume1 v)\nend\nrepeat (25)\n    switch costume to (costume2 v)\n    go to [front v] layer\n    change size by (((size) + (-100)) / (-10))\n    switch costume to (costume1 v)\nend\n\n@Blank35\n\n@Blank36\n\n@Blank37\n\n@Blank42\n\n@Blank38\n\n@Blank39\n\n@Blank40\n\n@Blank41\n\n@Blank43\n\n@Blank44\n\n@Blank45\n\n@Blank46\n\n@Blank47\n\n@Blank48\n\n@Blank49\n\n@Blank50\n\n@Blank51\n\n
NEW GAME↓\nhttps://scratch.mit.edu/projects/905171028/\n\nUse the arrow keys or tap, or the w, a, and d keys\nPlease follow me.