Doge (A Platformer)
@Stage\n\nwhen flag clicked\nforever\n    broadcast (tick v)\nend\n\nwhen flag clicked\nset [pitch v] effect to (0)\nset volume to (100) %\nswitch backdrop to (backdrop1 v)\nstart sound [cottagecore-17463 \(1\) v]\nrepeat until <(underground) = [1]>\n    play sound [cottagecore-17463 \(1\) v] until done\nend\n\nwhen I receive [ununderground v]\nrepeat (25)\n    change volume by (-4)\nend\nstop all sounds\nstart sound [cottagecore-17463 \(1\) v]\nrepeat (50)\n    change volume by (2)\nend\nrepeat until <(underground) = [1]>\n    play sound [cottagecore-17463 \(1\) v] until done\nend\n\nwhen flag clicked\n\nif <<(swinging) = [1]> and <<(holding) = [sword]> or <(holding) = [goldsword]>>> then\n    set [pitch v] effect to (0)\n    play sound (pick random (35) to (39)) until done\n    wait (0.2) seconds\nend\n\nset [pitch v] effect to (pick random (0) to (100))\n\nwhen I receive [underground v]\nrepeat (25)\n    change volume by (-4)\nend\nstop all sounds\nstart sound [gamemusic-6082 \(1\) v]\nrepeat (50)\n    change volume by (2)\nend\nrepeat until <(underground) = [0]>\n    play sound [gamemusic-6082 \(1\) v] until done\nend\n\nwhen I receive [player dead oh nooo v]\nset volume to (0) %\n\nstop all sounds\n\nwhen flag clicked\n\nforever\n    if <key (g v) pressed?> then\n        wait (0.1) seconds\n        set [money v] to ((money) - (100))\n    end\nend\n\n@blank\n\nset [money v] to [100]\n\n@player\n\nwhen flag clicked\ngo to [front v] layer\nset [xv v] to [0]\nset [yv v] to [0]\ngo to x: (-30) y: (50)\nset size to (50) %\nforever\n    if <(pause) = [0]> then\n        if <(underground) = [0]> then\n            set [player x v] to (round (x position))\n            set [player y v] to (round (y position))\n            if  then\n                change [xv v] by (-1)\n                point in direction (-90)\n            end\n            if  then\n                change [xv v] by (1)\n                point in direction (90)\n            end\n            set [xv v] to ((Xv) * (0.8))\n            change x by (Xv)\n            if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> or <<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>>> then\n                change y by (1)\n                if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> or <<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>>> then\n                    change y by (1)\n                    if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> or <<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>>> then\n                        change y by (1)\n                        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> or <<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>>> then\n                            change y by (1)\n                        end\n                        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> or <<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>>> then\n                            change y by (1)\n                            if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> or <<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>>> then\n                                change x by ((Xv) * (-1))\n                                change y by (-5)\n                                \n                                    set [xv v] to [0]\n                                else\n                                    set [xv v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n            change [yv v] by (-1)\n            change y by (Yv)\n            if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> or <<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>>> then\n                change y by ((Yv) * (-1))\n                set [yv v] to [0]\n            end\n            change y by (-1)\n            if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> or <<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>>> then\n                if <<key (w v) pressed?> or <key (space v) pressed?>> then\n                    set [yv v] to [12]\n                end\n            end\n            change y by (1)\n        end\n    end\nend\n\ndefine movement\n\nmovement\n\nwhen I receive [tick v]\nbroadcast (tick v)\n\nset pen color to (#000000)\n\nstamp\n\nwhen flag clicked\nset rotation style [left-right v]\n\nwhen I receive [underground v]\ngo to x: (0) y: (170)\nset [xv v] to [0]\nset [yv v] to [0]\n\nwhen I receive [ununderground v]\nset [xv v] to [0]\nset [yv v] to [0]\ngo to x: (-30) y: (50)\n\nwhen flag clicked\nset [uncrouchable? v] to [0]\nset [ghost v] effect to (0)\nforever\n    if <key (s v) pressed?> then\n        switch costume to (costume3 v)\n        create clone of (_myself_ v)\n        wait until <not <key (s v) pressed?>>\n    else\n        if <(uncrouchable?) = [0]> then\n            switch costume to (costume2 v)\n        end\n    end\nend\n\nwhen I start as a clone\nswitch costume to (costume4 v)\nset [ghost v] effect to (100)\nforever\n    set [ghost v] effect to (100)\n    go to x: (player x) y: (player y)\n    if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> or <<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>>> then\n        set [uncrouchable? v] to [1]\n    else\n        set [uncrouchable? v] to [0]\n    end\n    if <not <key (s v) pressed?>> then\n        if <(uncrouchable?) = [1]> then\n            set [uncrouchable? v] to [1]\n        else\n            if <(uncrouchable?) = [0]> then\n                delete this clone\n            end\n        end\n    end\nend\n\nif <(uncrouchable?) = [0]> then\n\nwhen flag clicked\ngo to [front v] layer\nset [xv v] to [0]\nset [yv v] to [0]\ngo to x: (-30) y: (50)\nset size to (50) %\nforever\n    if <(pause) = [0]> then\n        if <(underground) = [1]> then\n            set [player x v] to (round (x position))\n            set [player y v] to (round (y position))\n            if <<key (a v) pressed?> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                change [xv v] by (-1)\n                point in direction (-90)\n            end\n            if <<key (d v) pressed?> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                change [xv v] by (1)\n                point in direction (90)\n            end\n            set [xv v] to ((Xv) * (0.8))\n            change x by (Xv)\n            if <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>> then\n                change y by (1)\n                if <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>> then\n                    change y by (1)\n                    if <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>> then\n                        change y by (1)\n                        if <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>> then\n                            change y by (1)\n                        end\n                        if <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>> then\n                            change y by (1)\n                            if <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>> then\n                                change x by ((Xv) * (-1))\n                                change y by (-5)\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [0]\n                                else\n                                    set [xv v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n            change [yv v] by (-1)\n            change y by (Yv)\n            if <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>> then\n                change y by ((Yv) * (-1))\n                set [yv v] to [0]\n            end\n            change y by (-1)\n            if <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>> then\n                if <<key (w v) pressed?> or <key (space v) pressed?>> then\n                    set [yv v] to [12]\n                end\n            end\n            change y by (1)\n        end\n    end\nend\n\nwhen flag clicked\nclear graphic effects\n\nchange [xv v] by (-1)\nchange [yv v] by (1)\n\nwhen I receive [tick v]\n\nwhen I receive [immune v]\nset [ghost v] effect to (50)\nwait (0.3) seconds\nset [ghost v] effect to (0)\n\nwhen flag clicked\nswitch costume to (costume2 v)\nclear graphic effects\nforever\n    if <<<touching (bad v)?> or <<touching (bad2 v)?> or <touching (bad3 v)?>>> and <(pause) = [0]>> then\n        set [pknockback v] to [1]\n    else\n        set [pknockback v] to [0]\n    end\nend\n\nhide\n\nclear graphic effects\n\nwhen flag clicked\n\nswitch costume to (costume5 v)\nrepeat (100)\n    change [brightness v] effect by (-1)\nend\n\nwhen I receive [player dead oh nooo v]\ngo to [front v] layer\nset [color v] effect to ((1) / (0))\nset [brightness v] effect to (25)\nset [player dead x v] to (x position)\nset [player dead y v] to (y position)\n\nwhen I receive [tick v]\nif <(pknockback) = [1]> then\n    if <touching (bad v)?> then\n        if  then\n            set [xv v] to [2]\n            set [yv v] to [0]\n        end\n        if  then\n            change [xv v] by (-2)\n            change [yv v] by (0)\n        end\n    end\n    if <touching (bad2 v)?> then\n        if <([x position v] of [bad2 v]) < (x position)> then\n            set [xv v] to [2]\n            set [yv v] to [0]\n        end\n        if <([x position v] of [bad2 v]) > (x position)> then\n            change [xv v] by (-2)\n            change [yv v] by (0)\n        end\n    end\n    if <touching (bad3 v)?> then\n        if <([x position v] of [bad3 v]) < (x position)> then\n            set [xv v] to [2]\n            set [yv v] to [0]\n        end\n        if <([x position v] of [bad3 v]) > (x position)> then\n            change [xv v] by (-2)\n            change [yv v] by (0)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<key (a v) pressed?> and <(Yv) = [0]>> then\n        set [pitch v] effect to (pick random (0) to (100))\n        play sound (pick random (2) to (7)) until done\n    end\n    if <<key (d v) pressed?> and <(Yv) = [0]>> then\n        set [pitch v] effect to (pick random (0) to (100))\n        play sound (pick random (2) to (7)) until done\n    end\nend\n\nwhen I receive [respawn v]\nset [xv v] to [0]\nset [yv v] to [0]\ngo to x: (-30) y: (50)\nset size to (50) %\n\nwhen I receive [respawn v]\nclear graphic effects\n\nwhen [r v] key pressed\nif <<(player dead?) = [0]> and <(pause) = [0]>> then\n    set [xv v] to [0]\n    set [yv v] to [0]\n    go to x: (-30) y: (50)\n    set size to (50) %\n    set [underground v] to [0]\n    broadcast (ununderground v)\nend\n\n@grass layer\n\nwhen flag clicked\nerase all\nshow\ngo to x: (0) y: (0)\nswitch costume to (pick random (1) to (5))\n\nwhen flag clicked\nwait (1) seconds\ngo to [front v] layer\nstamp\nhide\n\n@blocks\n\nwhen flag clicked\nerase all\nset pen color to (#ffffff)\nforever\n    if <(backstone) = [1]> then\n        switch costume to (stone v)\n    end\n    if <(backdirt) = [1]> then\n        switch costume to (dirt v)\n    end\n    if <<(backsky) = [1]> and <not <(holding) = [wood]>>> then\n        switch costume to (sky v)\n    end\nend\n\nwhen flag clicked\npoint in direction (90)\nforever\n    if <key (left arrow v) pressed?> then\n        turn left (22.5) degrees\n        wait (0.1) seconds\n    end\n    if <key (right arrow v) pressed?> then\n        turn right (22.5) degrees\n        wait (0.1) seconds\n    end\nend\n\nwhen I receive [tick v]\ngo to (reach v)\nset drag mode [not draggable v]\nif <(underground) = [0]> then\n    if <<(hotbar?) = [0]> and <(inventory) = [0]>> then\n        if <(holding) = [axe]> then\n            set size to (75) %\n            if <<mouse down?> and <(axe minable?) = [1]>> then\n                stamp\n                change [wood v] by (1)\n            end\n        end\n        if <(holding) = [pickaxe]> then\n            set size to (75) %\n            if <<mouse down?> and <(mineable?) = [1]>> then\n                stamp\n            end\n        end\n        if <(holding) = [goldpickaxe]> then\n            set size to (100) %\n            if <<mouse down?> and <(mineable?) = [1]>> then\n                stamp\n            end\n        end\n        if <<(holding) = [wood]> and <(placeable) = [1]>> then\n            if <(wood) > [0.9]> then\n                if <(blocktype) = [block]> then\n                    switch costume to (planks v)\n                end\n                if <(blocktype) = [wall]> then\n                    switch costume to (planks2 v)\n                end\n                set size to (70) %\n                if <mouse down?> then\n                    stamp\n                    change [wood v] by (-1)\n                end\n            end\n        end\n        if <<(holding) = [dirt]> and <(placeable) = [1]>> then\n            if <(dirt2) > [0.4]> then\n                if <(blocktype) = [block]> then\n                    switch costume to (dirt2 v)\n                end\n                if <(blocktype) = [wall]> then\n                    switch costume to (dirt v)\n                end\n                set size to (70) %\n                if <mouse down?> then\n                    stamp\n                    change [dirt2 v] by (-1)\n                end\n            end\n        end\n        if <<(holding) = [stone]> and <(placeable) = [1]>> then\n            if <(stone) > [0.4]> then\n                if <(blocktype) = [block]> then\n                    switch costume to (stone2 v)\n                end\n                if <(blocktype) = [wall]> then\n                    switch costume to (stone v)\n                end\n                set size to (70) %\n                if <mouse down?> then\n                    stamp\n                    change [stone v] by (-1)\n                end\n            end\n        end\n        if <<(holding) = [red]> and <(placeable) = [1]>> then\n            if <(blocktype) = [block]> then\n                switch costume to (red v)\n            end\n            if <(blocktype) = [wall]> then\n                switch costume to (red2 v)\n            end\n            set size to (70) %\n            if <mouse down?> then\n                stamp\n            end\n        end\n        if <<(holding) = [blue]> and <(placeable) = [1]>> then\n            if <(blocktype) = [block]> then\n                switch costume to (blue v)\n            end\n            if <(blocktype) = [wall]> then\n                switch costume to (blue2 v)\n            end\n            set size to (70) %\n            if <mouse down?> then\n                stamp\n            end\n        end\n        if <<(holding) = [green]> and <(placeable) = [1]>> then\n            if <(blocktype) = [block]> then\n                switch costume to (green v)\n            end\n            if <(blocktype) = [wall]> then\n                switch costume to (green2 v)\n            end\n            set size to (70) %\n            if <mouse down?> then\n                stamp\n            end\n        end\n        if <<(holding) = [yellow]> and <(placeable) = [1]>> then\n            if <(blocktype) = [block]> then\n                switch costume to (yellow v)\n            end\n            if <(blocktype) = [wall]> then\n                switch costume to (yellow2 v)\n            end\n            set size to (70) %\n            if <mouse down?> then\n                stamp\n            end\n        end\n    end\nend\n\nswitch costume to (red v)\n\nswitch costume to (blue v)\n\nswitch costume to (green v)\n\nswitch costume to (yellow v)\n\nif <(wood) < [1]> then\n    set [wood v] to [0]\nend\nif <(stone) < [1]> then\n    set [stone v] to [0]\nend\nif <(dirt) < [1]> then\n    set [dirt v] to [0]\nend\n\nwhen I receive [tick v]\nif <(holding) = [axe]> then\n    if <<(axe minable?) = [1]> and <(other) = [1]>> then\n        set size to (175) %\n        if <mouse down?> then\n            stamp\n        end\n    end\nend\n\nset [money v] to [100]\n\nif <(time?) = [day]> then\n    switch costume to (sky v)\nend\nif <(time?) = [night]> then\n    switch costume to (sky2 v)\nend\n\nif <<<not <<touching color (#00c10e)?> or <<touching color (#915c33)?> or <<touching color (#545454)?> or <<touching color (#673c00)?> or <<touching color (#5a3400)?> or <<touching color (#c29250)?> or <<touching color (#9d7640)?> or <<touching color (#643f23)?> or >>>>>>>>> and <not <<touching (player v)?> or <touching (deryll :d v)?>>>> and <(mineable?) = [1]>> then\n    set size to (75) %\n    if <<mouse down?> and <(mineable?) = [1]>> then\n        stamp\n    end\nend\n\nwhen flag clicked\nset [blocktype v] to [block]\nforever\n    if <key (z v) pressed?> then\n        set [blocktype v] to [block]\n    end\n    if <key (x v) pressed?> then\n        set [blocktype v] to [wall]\n    end\nend\n\nswitch costume to (planks v)\n\nswitch costume to (stone2 v)\n\n@cursor\n\nwhen flag clicked\nswitch costume to (costume1 v)\ncreate clone of (_myself_ v)\ngo to [front v] layer\nhide\npoint in direction (90)\nforever\n    if <key (left arrow v) pressed?> then\n        turn left (22.5) degrees\n        wait (0.1) seconds\n    end\n    if <key (right arrow v) pressed?> then\n        turn right (22.5) degrees\n        wait (0.1) seconds\n    end\nend\n\nwhen I receive [tick v]\ngo to (reach v)\n\nwhen flag clicked\nforever\n    if <<<(holding) = [wood]> or <<(holding) = [dirt]> or <(holding) = [stone]>>> or <<(holding) = [red]> or <<(holding) = [blue]> or <<(holding) = [green]> or <(holding) = [yellow]>>>>> then\n        create clone of (_myself_ v)\n        wait () seconds\n        show\n        wait until <not <<<(holding) = [wood]> or <<(holding) = [dirt]> or <(holding) = [stone]>>> or <<(holding) = [red]> or <<(holding) = [blue]> or <<(holding) = [green]> or <(holding) = [yellow]>>>>>>\n    else\n        hide\n    end\nend\n\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nhide\nforever\n    if <(blocktype) = [block]> then\n        switch costume to (costume2 v)\n    end\n    if <(blocktype) = [wall]> then\n        switch costume to (costume4 v)\n    end\n    if <<(blocktype) = [block]> and <<not <<touching color (#00c10e)?> or <<touching color (#915c33)?> or <<touching color (#545454)?> or <<touching color (#c29250)?> or <<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>>>>>>> and <<<(holding) = [wood]> or <<(holding) = [dirt]> or <(holding) = [stone]>>> or <<(holding) = [red]> or <<(holding) = [blue]> or <<(holding) = [green]> or <(holding) = [yellow]>>>>>>> then\n        set [placeable v] to [1]\n    else\n        if <<(blocktype) = [wall]> and <<not <<touching color (#896438)?> or <<touching color (#3b3b3b)?> or <<touching color (#643f23)?> or <<touching color (#00c10e)?> or <<touching color (#915c33)?> or <<touching color (#545454)?> or <<touching color (#c29250)?> or <<<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>> or <<touching color (#9c3f3f)?> or <<touching color (#3e659c)?> or <<touching color (#40923a)?> or <touching color (#94883b)?>>>>>>>>>>>>> and <<<(holding) = [wood]> or <<(holding) = [dirt]> or <(holding) = [stone]>>> or <<(holding) = [red]> or <<(holding) = [blue]> or <<(holding) = [green]> or <(holding) = [yellow]>>>>>>> then\n            set [placeable v] to [1]\n        else\n            set [placeable v] to [0]\n        end\n    end\n    if <not <<<(holding) = [wood]> or <<(holding) = [dirt]> or <(holding) = [stone]>>> or <<(holding) = [red]> or <<(holding) = [blue]> or <<(holding) = [green]> or <(holding) = [yellow]>>>>>> then\n        delete this clone\n    end\nend\n\nwhen I receive [tick v]\n\nwhen flag clicked\nwait (0.2) seconds\ngo to [front v] layer\n\nwhen I receive [tick v]\nif <<touching (player v)?> or <touching (deryll :d v)?>> then\n    set [placeable v] to [0]\nend\n\nwhen I receive [tick v]\n\nswitch costume to (costume1 v)\n\nswitch costume to (costume2 v)\n\nshow\n\n@reach\n\nwhen flag clicked\ngo to x: (-161) y: (-101)\nset [radius v] to [45]\nforever\n\nwhen flag clicked\ngo to [front v] layer\n\nforever\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        repeat until <not <mouse down?>>\n            set [dragging v] to [1]\n        end\n    else\n        set [dragging v] to [1]\n    end\nend\n\nwhen I receive [tick v]\ngo to (player v)\nif <(distance to [mouse-pointer v]) > (radius)> then\n    point towards (mouse-pointer v)\n    move (radius) steps\nelse\n    go to x: (mouse x) y: (mouse y)\nend\n\nwhen I receive [tick v]\nif <<(y position) < [0]> and <(y position) > [-109]>> then\n    set [backdirt v] to [1]\n    set [backstone v] to [0]\n    set [backsky v] to [0]\nend\nif <<(y position) < [-115]> and <(y position) > [-180]>> then\n    set [backstone v] to [1]\n    set [backdirt v] to [0]\n    set [backsky v] to [0]\nend\nif <<(y position) < [180]> and <(y position) > [-30]>> then\n    set [backsky v] to [1]\n    set [backdirt v] to [0]\n    set [backstone v] to [0]\nend\nif <<touching color (#5d3700)?> or <touching color (#673d00)?>> then\n    set [axe minable? v] to [1]\nelse\n    set [axe minable? v] to [0]\nend\nif <<touching color (#896438)?> or > then\n    set [mineable? v] to [1]\nelse\n    set [mineable? v] to [0]\nend\nif <<not <<<<touching color (#00c10e)?> or <<touching color (#915c33)?> or <<touching color (#545454)?> or <<touching color (#673c00)?> or <<touching color (#5a3400)?> or <<touching color (#c29250)?> or <<touching color (#9d7640)?> or <<touching color (#643f23)?> or <<touching color (#3b3b3b)?> or <touching color (#57d8ff)?>>>>>>>>>> and <not <<touching (player v)?> or <touching (deryll :d v)?>>>> or <<touching color (#896438)?> or <<touching color (#3b3b3b)?> or <<touching color (#643f23)?> or <<touching color (#00c10e)?> or <<touching color (#915c33)?> or <<touching color (#545454)?> or <<touching color (#c29250)?> or <<<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>> or <<touching color (#9c3f3f)?> or <<touching color (#3e659c)?> or <<touching color (#40923a)?> or <touching color (#94883b)?>>>>>>>>>>>>>> and <(treeminable) = [1]>> then\n    if <(speech) = [0]> then\n        set size to (25) %\n        switch costume to (costume4 v)\n        set [other v] to [1]\n        set [axe minable? v] to [1]\n    end\nelse\n    set size to (100) %\n    switch costume to (costume4 v)\n    set [other v] to [0]\nend\nif <(y position) > [0]> then\n    set [treeminable v] to [1]\nelse\n    set [treeminable v] to [0]\nend\nif <<(y position) < [-5]> and <(y position) > [-35]>> then\n    set [grass layer v] to [1]\nelse\n    set [grass layer v] to [0]\nend\n\nwhen I receive [tick v]\nif <<<(holding) = [wood]> or <<(holding) = [dirt]> or <(holding) = [stone]>>> or <<(holding) = [red]> or <<(holding) = [blue]> or <<(holding) = [green]> or <(holding) = [yellow]>>>>> then\n    hide\nend\nif <touching (player v)?> then\n    set [placeable v] to [0]\nend\n\nwhen I receive [tick v]\nif <<<<touching color (#00c10e)?> or <touching color (#915c33)?>> and <<mouse down?> and <<(holding) = [pickaxe]> or <(holding) = [goldpickaxe]>>>> and <(hotbar?) = [0]>> then\n    change [dirt2 v] by (0.5)\nend\nif <<<touching color (#545454)?> and <<mouse down?> and <<(holding) = [pickaxe]> or <(holding) = [goldpickaxe]>>>> and <(hotbar?) = [0]>> then\n    if <<(underground) = [0]> and <(speech) = [0]>> then\n        change [stone v] by (0.5)\n    end\nend\nif <<< or <<touching color (#c29250)?> or <touching color (#9d7640)?>>> and <<mouse down?> and <<(holding) = [pickaxe]> or <(holding) = [goldpickaxe]>>>> and <(hotbar?) = [0]>> then\n    change [wood v] by (1)\nend\nif <<<<<touching color (#673c00)?> or <touching color (#5a3400)?>> or > and <<mouse down?> and <(holding) = [axe]>>> and <(hotbar?) = [0]>> then\n    change [wood v] by (1)\nend\n\nwhen flag clicked\nforever\n    if <not <<<(holding) = [wood]> or <<(holding) = [dirt]> or <(holding) = [stone]>>> or <<(holding) = [red]> or <<(holding) = [blue]> or <<(holding) = [green]> or <(holding) = [yellow]>>>>>> then\n        wait () seconds\n        show\n    end\nend\n\nwhen I receive [tick v]\nif <<<(holding) = [wood]> or <<(holding) = [dirt]> or <(holding) = [stone]>>> or <<(holding) = [red]> or <<(holding) = [blue]> or <<(holding) = [green]> or <(holding) = [yellow]>>>>> then\n    set [radius v] to [70]\n    switch costume to (costume2 v)\nelse\n    set [radius v] to [45]\nend\n\nwhen flag clicked\nset [dirt v] to [0]\nforever\n\nswitch costume to (costume2 v)\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nforever\n    if <(other) = [0]> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<<<touching color (#00c10e)?> or <<touching color (#643f23)?> or <(grass layer) = [1]>>> or <touching color (#915c33)?>> and <<mouse down?> and <<(holding) = [pickaxe]> or <(holding) = [goldpickaxe]>>>> and <(hotbar?) = [0]>> then\n        set [pitch v] effect to (pick random (0) to (100))\n        play sound (pick random (7) to (13)) until done\n    end\n    if <<<<touching color (#545454)?> or <touching color (#3b3b3b)?>> and <<mouse down?> and <<(holding) = [pickaxe]> or <(holding) = [goldpickaxe]>>>> and <(hotbar?) = [0]>> then\n        if <(underground) = [0]> then\n            set [pitch v] effect to (pick random (-25) to (25))\n            play sound (pick random (2) to (6)) until done\n        end\n    end\n    if <<<<<<touching color (#ff6666)?> or <<touching color (#66a6ff)?> or <<touching color (#70ff66)?> or <touching color (#ffeb66)?>>>> or <<touching color (#9c3f3f)?> or <<touching color (#3e659c)?> or <<touching color (#40923a)?> or <touching color (#94883b)?>>>>> or <<touching color (#c29250)?> or <touching color (#9d7640)?>>> and <<mouse down?> and <<(holding) = [pickaxe]> or <(holding) = [goldpickaxe]>>>> and <(hotbar?) = [0]>> then\n        set [pitch v] effect to (pick random (-25) to (25))\n        play sound (pick random (2) to (6)) until done\n    end\n    if <<<<<touching color (#673c00)?> or <touching color (#5a3400)?>> or > and <<mouse down?> and <(holding) = [axe]>>> and <(hotbar?) = [0]>> then\n        set [pitch v] effect to (pick random (-25) to (25))\n        play sound (pick random (14) to (16)) until done\n    end\nend\n\n@holding\n\nwhen flag clicked\nset [radius2 v] to [10]\ngo to [front v] layer\nset rotation style [all around v]\nwait (0.3) seconds\ngo to [front v] layer\n\nwhen I receive [tick v]\nif <(holding) = [sword]> then\n    switch costume to (costume2 v)\nend\nif <(holding) = [pickaxe]> then\n    switch costume to (costume5 v)\nend\nif <(holding) = [axe]> then\n    switch costume to (costume7 v)\nend\nif <(holding) = [wood]> then\n    switch costume to (costume6 v)\nend\nif <(holding) = [dirt]> then\n    switch costume to (costume8 v)\nend\nif <(holding) = [stone]> then\n    switch costume to (costume9 v)\nend\nif <(holding) = [nothing]> then\n    switch costume to (costume10 v)\nend\nif <(holding) = [red]> then\n    switch costume to (costume11 v)\nend\nif <(holding) = [blue]> then\n    switch costume to (costume12 v)\nend\nif <(holding) = [green]> then\n    switch costume to (costume13 v)\nend\nif <(holding) = [yellow]> then\n    switch costume to (costume14 v)\nend\nif <(holding) = [goldpickaxe]> then\n    switch costume to (goldpicxk v)\nend\nif <(holding) = [goldsword]> then\n    switch costume to (goldsword v)\nend\n\nwhen I receive [tick v]\nif <(pause) = [0]> then\n    go to (player v)\n    if <(distance to [mouse-pointer v]) > (radius2)> then\n        point towards (reach v)\n        move (radius2) steps\n    else\n        point towards (mouse-pointer v)\n        go to x: (mouse x) y: (mouse y)\n        pen up\n    end\nend\n\nwhen I receive [tick v]\nif <(swinging) = [0]> then\n    show\nelse\n    hide\nend\n\n@assests\n\nset [pixelate v] effect to (0)\n\nset [pixelate v] effect to (50)\n\n@hotbar\n\nwhen flag clicked\nclear graphic effects\ngo to [front v] layer\ngo to x: (-137) y: (158)\nswitch costume to (2a v)\nset [holding v] to [pickaxe]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [hotbar? v] to [1]\n    else\n        set [hotbar? v] to [0]\n    end\nend\n\nif  then\n    switch costume to (1a v)\n    set [holding v] to [sword]\nend\nif <key (2 v) pressed?> then\n    switch costume to (2a v)\n    set [holding v] to [pickaxe]\nend\nif <key (3 v) pressed?> then\n    switch costume to (3a v)\n    set [holding v] to [axe]\nend\nif <key (4 v) pressed?> then\n    switch costume to (4a v)\n    set [holding v] to [wood]\nend\nif <key (5 v) pressed?> then\n    switch costume to (5a v)\n    set [holding v] to [dirt]\nend\nif <key (6 v) pressed?> then\n    switch costume to (6a v)\n    set [holding v] to [stone]\nend\n\nwhen flag clicked\nset [open? v] to [0]\nset [hotuse v] to [1]\nforever\n    if <(open?) = [0]> then\n        if <<<<<(mouse x) > [-239]> and <(mouse x) < [-200]>> and <<(mouse y) < [178]> and <(mouse y) > [138]>>> and <mouse down?>> or <key (1 v) pressed?>> then\n            if <(metal?) = [iron]> then\n                switch costume to (1a v)\n                set [holding v] to [sword]\n            end\n            if <(metal?) = [gold]> then\n                switch costume to (1a2 v)\n                set [holding v] to [goldsword]\n            end\n            set [hotuse v] to [1]\n        end\n        if <<<<<(mouse x) > [-200]> and <(mouse x) < [-158]>> and <<(mouse y) < [178]> and <(mouse y) > [138]>>> and <mouse down?>> or <key (2 v) pressed?>> then\n            if <(metal?) = [iron]> then\n                switch costume to (2a v)\n                set [holding v] to [pickaxe]\n            end\n            if <(metal?) = [gold]> then\n                switch costume to (2a2 v)\n                set [holding v] to [goldpickaxe]\n            end\n            set [hotuse v] to [1]\n        end\n        if <<<<<(mouse x) > [-158]> and <(mouse x) < [-116]>> and <<(mouse y) < [178]> and <(mouse y) > [138]>>> and <mouse down?>> or <key (3 v) pressed?>> then\n            if <(metal?) = [iron]> then\n                switch costume to (3a v)\n            end\n            if <(metal?) = [gold]> then\n                switch costume to (3a2 v)\n            end\n            set [holding v] to [axe]\n            set [hotuse v] to [1]\n        end\n        if <<<<<(mouse x) > [-116]> and <(mouse x) < [-76]>> and <<(mouse y) < [178]> and <(mouse y) > [138]>>> and <mouse down?>> or <key (4 v) pressed?>> then\n            if <(metal?) = [iron]> then\n                switch costume to (4a v)\n            end\n            if <(metal?) = [gold]> then\n                switch costume to (4a2 v)\n            end\n            set [holding v] to [wood]\n            set [hotuse v] to [1]\n        end\n        if <<<<<(mouse x) > [-76]> and <(mouse x) < [-36]>> and <<(mouse y) < [178]> and <(mouse y) > [138]>>> and <mouse down?>> or <key (5 v) pressed?>> then\n            if <(metal?) = [iron]> then\n                switch costume to (5a v)\n            end\n            if <(metal?) = [gold]> then\n                switch costume to (5a2 v)\n            end\n            set [holding v] to [dirt]\n            set [hotuse v] to [1]\n        end\n        if <<<<<(mouse x) > [-36]> and <(mouse x) < [6]>> and <<(mouse y) < [178]> and <(mouse y) > [138]>>> and <mouse down?>> or <key (6 v) pressed?>> then\n            if <(metal?) = [iron]> then\n                switch costume to (6a v)\n            end\n            if <(metal?) = [gold]> then\n                switch costume to (6a2 v)\n            end\n            set [holding v] to [stone]\n            set [hotuse v] to [1]\n        end\n    end\n    if <(open?) = [1]> then\n        if <(metal?) = [iron]> then\n            switch costume to (7a v)\n            set [holding v] to [nothing]\n            wait until <(open?) = [0]>\n            switch costume to (2a v)\n            set [holding v] to [pickaxe]\n        end\n        if <(metal?) = [gold]> then\n            switch costume to (7a2 v)\n            set [holding v] to [nothing]\n            wait until <(open?) = [0]>\n            switch costume to (2a2 v)\n            set [holding v] to [goldpickaxe]\n        end\n    end\nend\n\nif <(invuse?) = [1]> then\n    wait () seconds\n    switch costume to (7 v)\n    set [hotuse v] to [0]\nend\n\nwhen I receive [tick v]\n\nwhen I receive [player dead oh nooo v]\nset [color v] effect to ((1) / (0))\nset [brightness v] effect to (15)\n\nbroadcast (player dead oh nooo v)\n\nwhen I receive [respawn v]\nclear graphic effects\n\nwhen I receive [respawn v]\nclear graphic effects\n\nwhen I receive [gold v]\nswitch costume to (2a2 v)\nset [holding v] to [goldpickaxe]\n\n@deryll :D\n\nwhen flag clicked\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nset [xv2 v] to [0]\nset [yv2 v] to [0]\ngo to x: (30) y: (50)\nset size to (50) %\nforever\n    if <(pause) = [0]> then\n        \n            change [xv2 v] by (-1)\n            point in direction (-90)\n        end\n        \n            change [xv2 v] by (1)\n            point in direction (90)\n        end\n        set [xv2 v] to ((xv2) * (0.8))\n        change x by (xv2)\n        if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> then\n            change y by (1)\n            if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> then\n                change y by (1)\n                if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> then\n                    change y by (1)\n                    if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> then\n                        change y by (1)\n                    end\n                    if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> then\n                        change y by (1)\n                        if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> then\n                            change x by ((xv2) * (-1))\n                            change y by (-5)\n                            if <(xv2) > [0]> then\n                                set [xv2 v] to [0]\n                            else\n                                set [xv2 v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change [yv2 v] by (-1)\n        change y by (yv2)\n        if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> then\n            change y by ((yv2) * (-1))\n            set [yv2 v] to [0]\n        end\n        change y by (-1)\n        if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> then\n            \n                set [yv2 v] to [12]\n            end\n        end\n        change y by (1)\n        set [guidex v] to (x position)\n        set [guidey v] to (y position)\n    end\nend\n\nwhen flag clicked\nset rotation style [left-right v]\nforever\n    wait (0.5) seconds\n    set [direction v] to (pick random (-1) to (1))\n    if <(direction) = [0]> then\n        set [direction v] to (pick random (-1) to (1))\n    end\nend\n\nwhen flag clicked\npoint in direction (90)\nforever\n    if <(pause) = [0]> then\n        wait (pick random (1) to (3)) seconds\n        if <(direction) = [90]> then\n            set [moving? v] to [1]\n            set [go v] to [1]\n            repeat (pick random (20) to (60))\n                change [xv2 v] by (0.5)\n            end\n            set [moving? v] to [0]\n            wait (pick random (1) to (3)) seconds\n            point in direction ((direction) * (direction))\n        end\n        if <(direction) = [-90]> then\n            set [moving? v] to [1]\n            set [go v] to [1]\n            repeat (pick random (20) to (60))\n                change [xv2 v] by (-0.5)\n            end\n            set [moving? v] to [0]\n            wait (pick random (1) to (3)) seconds\n            point in direction ((direction) * (direction))\n        end\n    end\nend\n\npoint in direction ((direction) * (-1))\n\nwhen flag clicked\nforever\n    if on edge, bounce\n    if <touching (_edge_ v)?> then\n        point in direction ((direction) * (-1))\n    end\n    if <not <<(direction) = [90]> or <(direction) = [-90]>>> then\n        point in direction (90)\n    end\nend\n\nset [go v] to [0]\n\nwhen flag clicked\nforever\n    if <(go) = [1]> then\n        wait (pick random (0.4) to (0.8)) seconds\n        set [go v] to [0]\n        if <<(moving?) = [1]> and <<(xv2) = [0.5]> or <(xv2) = [-0.5]>>> then\n            set [yv2 v] to [12]\n        end\n        if <<(moving?) = [1]> and <(xv2) = [0]>> then\n            set [yv2 v] to [12]\n        end\n    end\nend\n\ngo to [front v] layer\n\nwhen I start as a clone\nshow\npoint in direction (90)\nset [name v] to (pick random (1) to (150))\nswitch costume to (costume4 v)\nif <(name) = [2]> then\n    switch costume to (costume4 v)\nelse\n    switch costume to (costume3 v)\nend\nforever\n    go to x: (guidex) y: (guidey)\n    if <(underground) = [1]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<touching (reach v)?> or <touching (cursor v)?>> and <(swinging) = [0]>> then\n        switch costume to (costume5 v)\n        if <mouse down?> then\n            set [speech v] to [1]\n        end\n    else\n        switch costume to (costume2 v)\n    end\n    if <(underground) = [1]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (enterence v)?> then\n        go to x: (30) y: (160)\n        set [xv2 v] to [0]\n        set [yv2 v] to [0]\n    end\nend\n\nwhen I receive [ununderground v]\nset [xv2 v] to [0]\nset [yv2 v] to [0]\ngo to x: (30) y: (50)\n\nwhen flag clicked\nforever\n    if <(pause) = [1]> then\n        set [xv2 v] to [0]\n        set [yv2 v] to [0]\n    end\nend\n\n@dirtlevel2\n\nwhen flag clicked\nerase all\nshow\ngo to x: (0) y: (0)\nswitch costume to (pick random (1) to (10))\n\nwhen flag clicked\nwait (0.5) seconds\nstamp\nhide\n\n@stonelayer\n\nwhen flag clicked\nerase all\nshow\ngo to x: (0) y: (-10)\nswitch costume to (pick random (1) to (8))\n\nwhen flag clicked\nset [pause v] to [1]\nwait (1.5) seconds\ngo to [front v] layer\nstamp\nhide\nbroadcast (generated v)\nset [pause v] to [0]\n\n@animation\n\nwhen flag clicked\nwait () seconds\ngo to [front v] layer\nset size to (25) %\nset rotation style [left-right v]\nforever\n    if <<mouse down?> and <<(holding) = [pickaxe]> and <<(hotbar?) = [0]> and <(pause) = [0]>>>> then\n        wait () seconds\n        set size to (25) %\n        set rotation style [left-right v]\n        set [swinging v] to [1]\n        switch costume to (pick1 v)\n        repeat (8)\n            next costume\n        end\n        repeat (8)\n            switch costume to ((costume [number v]) - (1))\n        end\n        switch costume to (pick1 v)\n    end\n    if <not <mouse down?>> then\n        set [swinging v] to [0]\n        set rotation style [left-right v]\n    end\nend\n\nwhen I receive [tick v]\ngo to (holding v)\nif <(swinging) = [1]> then\n    point towards (reach v)\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\n\nwhen flag clicked\nset rotation style [left-right v]\nforever\n    if <<mouse down?> and <<(holding) = [axe]> and <<(hotbar?) = [0]> and <(pause) = [0]>>>> then\n        wait () seconds\n        set size to (25) %\n        set rotation style [left-right v]\n        set [swinging v] to [1]\n        switch costume to (costume20 v)\n        repeat (12)\n            next costume\n        end\n        repeat (12)\n            switch costume to ((costume [number v]) - (1))\n        end\n        switch costume to (costume20 v)\n    end\n    if <not <mouse down?>> then\n        set [swinging v] to [0]\n        set rotation style [left-right v]\n    end\nend\n\nwhen flag clicked\nset rotation style [left-right v]\nforever\n    if <<mouse down?> and <<(holding) = [sword]> and <<(hotbar?) = [0]> and <(pause) = [0]>>>> then\n        wait () seconds\n        set rotation style [all around v]\n        set size to (25) %\n        set [swinging v] to [1]\n        switch costume to (costume6 v)\n        repeat (5)\n            next costume\n        end\n        repeat (5)\n            switch costume to ((costume [number v]) - (1))\n        end\n        switch costume to (costume6 v)\n    end\n    if <not <mouse down?>> then\n        set [swinging v] to [0]\n        set rotation style [left-right v]\n    end\nend\n\nwhen flag clicked\nset rotation style [left-right v]\nforever\n    if <<mouse down?> and <<(holding) = [goldsword]> and <<(hotbar?) = [0]> and <(pause) = [0]>>>> then\n        wait () seconds\n        set rotation style [left-right v]\n        set size to (25) %\n        set [swinging v] to [1]\n        switch costume to (sword5 v)\n        repeat (7)\n            next costume\n        end\n        repeat (7)\n            switch costume to ((costume [number v]) - (1))\n        end\n        switch costume to (sword5 v)\n    end\n    if <not <mouse down?>> then\n        set [swinging v] to [0]\n        set rotation style [left-right v]\n    end\nend\n\nwhen flag clicked\nwait () seconds\ngo to [front v] layer\nset size to (25) %\nset rotation style [left-right v]\nforever\n    if <<mouse down?> and <<(holding) = [goldpickaxe]> and <<(hotbar?) = [0]> and <(pause) = [0]>>>> then\n        wait () seconds\n        set size to (25) %\n        set rotation style [left-right v]\n        set [swinging v] to [1]\n        switch costume to (pick2 v)\n        repeat (8)\n            next costume\n        end\n        repeat (8)\n            switch costume to ((costume [number v]) - (1))\n        end\n        switch costume to (pick2 v)\n    end\n    if <not <mouse down?>> then\n        set [swinging v] to [0]\n        set rotation style [left-right v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(swinging) = [1]> and <<(holding) = [sword]> or <(holding) = [goldsword]>>> then\n        set [pitch v] effect to (0)\n        play sound (pick random (2) to (6)) until done\n        wait (0.2) seconds\n    end\nend\n\n@underground levelSprite1Sprite1\n\nwhen flag clicked\nset drag mode [not draggable v]\ngo to x: (0) y: (0)\nswitch costume to (pick random (6) to (10))\nhide\n\nwhen I receive [underground v]\nshow\n\nwhen I receive [ununderground v]\nhide\n\n@deep\n\nwhen flag clicked\nset drag mode [not draggable v]\nswitch costume to (pick random (7) to (11))\nhide\n\nwhen I receive [underground v]\nif <(underground) = [1]> then\n    show\nend\n\nwhen I receive [ununderground v]\nhide\n\n@enterence\n\nwhen flag clicked\nset [ghost v] effect to (100)\nset [underground v] to [0]\ngo to x: (0) y: (-179)\n\nwhen flag clicked\nforever\n    if <<touching (player v)?> and <(underground) = [1]>> then\n        set [underground v] to [0]\n        broadcast (ununderground v)\n        wait (1) seconds\n        go to x: (0) y: (-179)\n    end\n    if <touching (player v)?> then\n        set [underground v] to [1]\n        broadcast (underground v)\n        wait (1) seconds\n        go to x: (0) y: (176)\n    end\nend\n\nwhen I receive [respawn v]\ngo to x: (0) y: (-179)\n\nwhen [r v] key pressed\nset [underground v] to [0]\ngo to x: (0) y: (-179)\n\n@backdrop\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nset drag mode [not draggable v]\ngo to [back v] layer\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [underground v]\nshow\n\nwhen I receive [ununderground v]\nhide\n\n@inventory\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (-218) y: (129)\nset [wood v] to [0]\nset [dirt v] to [0]\nset [stone v] to [0]\n\nwhen flag clicked\nset [open? v] to [0]\n\nwhen flag clicked\nset [invuse? v] to [0]\nforever\n    if <<(open?) = [1]> and <<touching (mouse-pointer v)?> and <mouse down?>>> then\n        switch costume to (costume1 v)\n        set [open? v] to [0]\n        set [invuse? v] to [0]\n        create clone of (_myself_ v)\n        wait (0.1) seconds\n    end\n    if <<(open?) = [0]> and <<touching (mouse-pointer v)?> and <mouse down?>>> then\n        switch costume to (costume2 v)\n        set [open? v] to [1]\n        create clone of (_myself_ v)\n        wait (0.1) seconds\n    end\nend\n\nwhen I receive [tick v]\n\nwhen I start as a clone\nset [invuse? v] to [0]\ngo to x: (-218) y: (129)\nswitch costume to (costume3 v)\nforever\n    if <(open?) = [0]> then\n        delete this clone\n    end\n    if <<<<(mouse x) > [-239]> and <(mouse x) < [-200]>> and <<(mouse y) < [122]> and <(mouse y) > [82]>>> and <mouse down?>> then\n        switch costume to (costume4 v)\n        set [invuse? v] to [1]\n        if <(red) = [1]> then\n            set [holding v] to [red]\n        end\n    end\n    if <<<<(mouse x) > [-200]> and <(mouse x) < [-158]>> and <<(mouse y) < [122]> and <(mouse y) > [82]>>> and <mouse down?>> then\n        switch costume to (costume5 v)\n        set [invuse? v] to [1]\n        if <(blue) = [1]> then\n            set [holding v] to [blue]\n        end\n    end\n    if <<<<(mouse x) > [-158]> and <(mouse x) < [-116]>> and <<(mouse y) < [122]> and <(mouse y) > [82]>>> and <mouse down?>> then\n        switch costume to (costume6 v)\n        set [invuse? v] to [1]\n        if <(green) = [1]> then\n            set [holding v] to [green]\n        end\n    end\n    if <<<<(mouse x) > [-116]> and <(mouse x) < [-76]>> and <<(mouse y) < [122]> and <(mouse y) > [82]>>> and <mouse down?>> then\n        switch costume to (costume7 v)\n        set [invuse? v] to [1]\n        if <(yellow) = [1]> then\n            set [holding v] to [yellow]\n        end\n    end\n    if <touching (mouse-pointer v)?> then\n        set [inventory v] to [1]\n    else\n        set [inventory v] to [0]\n    end\nend\n\nif <(invuse?) = [1]> then\n\nwhen I receive [underground v]\ngo to [front v] layer\n\nif <<<<(mouse x) > [-76]> and <(mouse x) < [-36]>> and <<(mouse y) < [122]> and <(mouse y) > [82]>>> and <mouse down?>> then\n    switch costume to (5 v)\n    set [holding v] to [dirt]\nend\nif <<<<(mouse x) > [-36]> and <(mouse x) < [6]>> and <<(mouse y) < [122]> and <(mouse y) > [82]>>> and <mouse down?>> then\n    switch costume to (6 v)\n    set [holding v] to [stone]\nend\n\nset [holding v] to [sword]\nset [holding v] to [pickaxe]\nset [holding v] to [axe]\nset [holding v] to [wood]\n\nswitch costume to (costume3 v)\n\nwhen I receive [tick v]\n\nif <(hotuse) = [1]> then\n    switch costume to (costume3 v)\nend\n\nwait () seconds\n\nif <(hotuse) = [1]> then\n    wait (0.02) seconds\n    set [invuse? v] to [0]\nend\n\nwhen flag clicked\nforever\n\nset [money v] to [100]\n\n@Tree1\n\nwhen flag clicked\nset y to (56)\nset x to (pick random (-280) to (-260))\nrepeat (5)\n    set x to ((x position) + (pick random (75) to (100)))\n    set y to (pick random (40) to (56))\n    switch costume to (pick random (1) to (6))\n    set [pixelate v] effect to (pick random (50) to (75))\n    set rotation style [left-right v]\n    point in direction (pick random (-90) to (90))\n    set size to (75) %\n    go to [back v] layer\n    stamp\nend\nhide\n\nwhen I start as a clone\nswitch costume to (pick random (1) to (4))\nshow\nset [pixelate v] effect to (pick random (50) to (75))\nset y to (56)\nset x to (pick random (-240) to (240))\nset rotation style [left-right v]\npoint in direction (pick random (-90) to (90))\nset size to (75) %\ngo to [back v] layer\nforever\n    if <touching color (#5a3400)?> then\n        set x to (pick random (-240) to (240))\n    end\nend\n\n@ShiftClickLearn's counter\n\ndefine text: (text) size: (size) x: (x) y: (y) spacing: (spacing) centered: (centered) textID: (id)\nif <(centered) = [true]> then\n    go to x: (((((length of (text)) * ((spacing) * (size))) * (-0.5)) + (((spacing) * (size)) / (2))) + (x)) y: (y)\nelse\n    go to x: (x) y: (y)\nend\nset size to (size) %\nset [~i v] to [1]\nrepeat (length of (text))\n    switch costume to (letter (~i) of (text))\n    set [~cloneid v] to (id)\n    create clone of (_myself_ v)\n    change x by ((spacing) * (size))\n    change [~i v] by (1)\nend\n\nwhen flag clicked\nwait () seconds\ngo to [front v] layer\nset [.value v] to [0]\nset [~updatecounter v] to ((.value) + (1))\nforever\n    if <not <(~updateCounter) = (.value)>> then\n        broadcast (deleteClones v)\n        text: (.value) size: [25] x: [-110] y: [132] spacing: [0.30] centered: [false] textID: [1]\n        set [~updatecounter v] to (.value)\n    end\nend\n\nwhen I start as a clone\nshow\nclear graphic effects\nset [brightness v] effect to (100)\nset [~clonex v] to (x position)\nset [~cloney v] to (y position)\nif <(~cloneID) = [1]> then\n    change y by (9)\nend\nforever\n    change x by (((~cloneX) - (x position)) / (5))\n    change y by (((~cloneY) - (y position)) / (5))\nend\n\nwhen I receive [deleteclones v]\ndelete this clone\n\nwhen flag clicked\nforever\n    set [.value v] to (round (wood))\nend\n\n@counter2\n\ndefine text: (text) size: (size) x: (x) y: (y) spacing: (spacing) centered: (centered) textID: (id)\nif <(centered) = [true]> then\n    go to x: (((((length of (text)) * ((spacing) * (size))) * (-0.5)) + (((spacing) * (size)) / (2))) + (x)) y: (y)\nelse\n    go to x: (x) y: (y)\nend\nset size to (size) %\nset [i2 v] to [1]\nrepeat (length of (text))\n    switch costume to (letter (i2) of (text))\n    set [cloneid2 v] to (id)\n    create clone of (_myself_ v)\n    change x by ((spacing) * (size))\n    change [i2 v] by (1)\nend\n\nwhen flag clicked\nset [dirt2 v] to [0]\nwait () seconds\ngo to [front v] layer\nset [value2 v] to [0]\nset [update counter 2 v] to ((value2) + (1))\nforever\n    if <not <(update counter 2) = (value2)>> then\n        broadcast (deleteclones2 v)\n        text: (value2) size: [25] x: [-70] y: [132] spacing: [0.30] centered: [false] textID: [1]\n        set [update counter 2 v] to (value2)\n    end\nend\n\nwhen I start as a clone\nshow\nclear graphic effects\nset [brightness v] effect to (100)\nset [clonex2 v] to (x position)\nset [cloney2 v] to (y position)\nif <(cloneid2) = [1]> then\n    change y by (9)\nend\nforever\n    change x by (((clonex2) - (x position)) / (5))\n    change y by (((cloney2) - (y position)) / (5))\nend\n\nwhen I receive [deleteclones2 v]\ndelete this clone\n\nwhen flag clicked\nforever\n    set [value2 v] to (round (dirt2))\nend\n\n@counter3\n\ndefine text: (text) size: (size) x: (x) y: (y) spacing: (spacing) centered: (centered) textID: (id)\nif <(centered) = [true]> then\n    go to x: (((((length of (text)) * ((spacing) * (size))) * (-0.5)) + (((spacing) * (size)) / (2))) + (x)) y: (y)\nelse\n    go to x: (x) y: (y)\nend\nset size to (size) %\nset [i4 v] to [1]\nrepeat (length of (text))\n    switch costume to (letter (i4) of (text))\n    set [cloneid4 v] to (id)\n    create clone of (_myself_ v)\n    change x by ((spacing) * (size))\n    change [i4 v] by (1)\nend\n\nwhen flag clicked\nwait () seconds\ngo to [front v] layer\nset [value4 v] to [0]\nset [updatecounter4 v] to ((value4) + (1))\nforever\n    if <not <(updatecounter4) = (value4)>> then\n        broadcast (delete clones 4 v)\n        text: (value4) size: [25] x: [-28] y: [132] spacing: [0.30] centered: [false] textID: [1]\n        set [updatecounter4 v] to (value4)\n    end\nend\n\nwhen I start as a clone\nshow\nclear graphic effects\nset [brightness v] effect to (100)\nset [clonex4 v] to (x position)\nset [cloney4.5 v] to (y position)\nif <(cloney4.5) = [1]> then\nelse\n    change y by (9)\nend\nforever\n    change x by (((clonex4) - (x position)) / (5))\n    change y by (((cloney4.5) - (y position)) / (5))\nend\n\nwhen I receive [delete clones 4 v]\ndelete this clone\n\nwhen flag clicked\nforever\n    set [value4 v] to (round (stone))\nend\n\n@speech\n\nwhen flag clicked\nset [speech v] to [0]\nhide\ngo to x: (0) y: (83)\nforever\n    if <(speech) = [1]> then\n        go to [front v] layer\n        switch costume to (pick random (1) to (24))\n        show\n        set [pause v] to [1]\n        wait until <(speech) = [0]>\n        set [pause v] to [0]\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<<<(mouse x) > [-50]> and <(mouse x) < [-4]>> and <<(mouse y) < [69]> and <(mouse y) > [47]>>> and <mouse down?>> and <(speech) = [1]>> then\n        go to [front v] layer\n        switch costume to (costume15 v)\n        set [shop v] to [1]\n    end\n    if <<<<(mouse x) > [-4]> and <(mouse x) < [60]>> and <<(mouse y) < [69]> and <(mouse y) > [47]>>> and <mouse down?>> then\n        go to [front v] layer\n        switch costume to (costume2 v)\n        set [shop v] to [0]\n    end\n    if <<<<(mouse x) > [60]> and <(mouse x) < [101]>> and <<(mouse y) < [69]> and <(mouse y) > [47]>>> and <mouse down?>> then\n        go to [front v] layer\n        switch costume to (pick random (1) to (24))\n        set [shop v] to [0]\n        wait (0.2) seconds\n    end\n    if <<<<(mouse x) > [129]> and <(mouse x) < [154]>> and <<(mouse y) < [150]> and <(mouse y) > [129]>>> and <mouse down?>> then\n        set [speech v] to [0]\n        set [shop v] to [0]\n    end\nend\n\nclear graphic effects\n\nchange [color v] effect by (25)\n\n\n\nwhen flag clicked\nset [metal? v] to [iron]\nforever\n    if <<<<(mouse x) > [-123]> and <(mouse x) < [-41]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> and <mouse down?>> then\n        if <<<<(money) > [50]> or <(money) = [50]>> and <(metal?) = [iron]>> and <(speech) = [1]>> then\n            start sound [item-equip-6904 v]\n            change [money v] by (-50)\n            broadcast (gold v)\n            set [metal? v] to [gold]\n            wait (0.2) seconds\n        end\n    end\n    if <<<<(mouse x) > [-41]> and <(mouse x) < [-1]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> and <mouse down?>> then\n        if <<<<(money) > [20]> or <(money) = [20]>> and <(red) = [0]>> and <(speech) = [1]>> then\n            start sound [item-equip-6904 v]\n            change [money v] by (-20)\n            broadcast (red v)\n            wait (0.2) seconds\n        end\n    end\n    if <<<<(mouse x) > [-1]> and <(mouse x) < [39]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> and <mouse down?>> then\n        if <<<<(money) > [20]> or <(money) = [20]>> and <(blue) = [0]>> and <(speech) = [1]>> then\n            start sound [item-equip-6904 v]\n            change [money v] by (-20)\n            broadcast (blue v)\n            wait (0.2) seconds\n        end\n    end\n    if <<<<(mouse x) > [39]> and <(mouse x) < [81]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> and <mouse down?>> then\n        if <<<<(money) > [20]> or <(money) = [20]>> and <(green) = [0]>> and <(speech) = [1]>> then\n            start sound [item-equip-6904 v]\n            change [money v] by (-20)\n            broadcast (green v)\n            wait (0.2) seconds\n        end\n    end\n    if <<<<(mouse x) > [81]> and <(mouse x) < [123]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> and <mouse down?>> then\n        if <<<<(money) > [20]> or <(money) = [20]>> and <(yellow) = [0]>> and <(speech) = [1]>> then\n            start sound [item-equip-6904 v]\n            change [money v] by (-20)\n            broadcast (yellow v)\n            wait (0.2) seconds\n        end\n    end\nend\n\nif <<<<(mouse x) > [-83]> and <(mouse x) < [-41]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> and <mouse down?>> then\n    if <<(money) > [40]> or <(money) = [40]>> then\n        change [money v] by (-40)\n        wait (0.5) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<(mouse x) > [-123]> and <(mouse x) < [-41]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> then\n        broadcast (gold hover v)\n    end\n    if <<<(mouse x) > [-41]> and <(mouse x) < [-1]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> then\n        broadcast (redhover v)\n    end\n    if <<<(mouse x) > [-1]> and <(mouse x) < [39]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> then\n        broadcast (blue hover v)\n    end\n    if <<<(mouse x) > [39]> and <(mouse x) < [81]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> then\n        broadcast (green hover v)\n    end\n    if <<<(mouse x) > [81]> and <(mouse x) < [123]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> then\n        broadcast (yellow hoover v)\n    end\n    if <not <<<<(mouse x) > [-123]> and <(mouse x) < [-41]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> or <<<<(mouse x) > [-41]> and <(mouse x) < [-1]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> or <<<<(mouse x) > [-1]> and <(mouse x) < [39]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> or <<<<(mouse x) > [39]> and <(mouse x) < [81]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>> or <<<(mouse x) > [81]> and <(mouse x) < [123]>> and <<(mouse y) < [127]> and <(mouse y) > [87]>>>>>>>> then\n        broadcast (hovernothing v)\n    end\nend\n\n@indicator\n\nwhen flag clicked\ngo to x: (17) y: (158)\nset [ghost v] effect to (25)\nforever\n    if <(holding) = [wood]> then\n        if <(blocktype) = [block]> then\n            switch costume to (costume1 v)\n        end\n        if <(blocktype) = [wall]> then\n            switch costume to (costume2 v)\n        end\n    end\n    if <(holding) = [dirt]> then\n        if <(blocktype) = [block]> then\n            switch costume to (costume3 v)\n        end\n        if <(blocktype) = [wall]> then\n            switch costume to (costume5 v)\n        end\n    end\n    if <(holding) = [stone]> then\n        if <(blocktype) = [block]> then\n            switch costume to (costume4 v)\n        end\n        if <(blocktype) = [wall]> then\n            switch costume to (costume6 v)\n        end\n    end\nend\n\nwhen flag clicked\nclear graphic effects\nswitch costume to (costume1 v)\nset [ghost v] effect to (25)\ngo to [front v] layer\npoint in direction (90)\nforever\n    if <key (left arrow v) pressed?> then\n        turn left (22.5) degrees\n        wait (0.1) seconds\n    end\n    if <key (right arrow v) pressed?> then\n        turn right (22.5) degrees\n        wait (0.1) seconds\n    end\nend\n\nswitch costume to (costume1 v)\n\nswitch costume to (costume3 v)\n\nswitch costume to (costume4 v)\n\nwhen I receive [player dead oh nooo v]\nset [color v] effect to ((1) / (0))\nset [brightness v] effect to (50)\n\nwhen I receive [respawn v]\nclear graphic effects\nset [ghost v] effect to (25)\n\n@bad\n\nwhen flag clicked\nswitch costume to (costume2 v)\nset [exv v] to [0]\nset [eyv v] to [0]\nset size to (50) %\nforever\n    if <<(ealive?) = [1]> and <(pause) = [0]>> then\n        change x by (exv)\n        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n            change y by (1)\n            if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                change y by (1)\n                if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                    change y by (1)\n                    if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                        change y by (1)\n                    end\n                    if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                        change y by (1)\n                        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                            change x by ((exv) * (-1))\n                            change y by (-5)\n                            if <(exv) > [0]> then\n                                set [exv v] to [0]\n                            else\n                                set [exv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change [eyv v] by (-1)\n        change y by (eyv)\n        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n            change y by ((eyv) * (-1))\n            set [eyv v] to [0]\n        end\n        change y by (-1)\n        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n            if <(player y) > (eey)> then\n                set [eyv v] to [14]\n                if <(underground) = [1]> then\n                    set [pitch v] effect to (pick random (-50) to (100))\n                    start sound (pick random (4) to (8))\n                end\n            end\n        end\n        change y by (1)\n        set [eex v] to (round (x position))\n        set [eey v] to (round (y position))\n        set [ex v] to (round (x position))\n        set [ey v] to (round (y position))\n    end\nend\n\nwhen flag clicked\nset [ealive? v] to [0]\nforever\n    if <(pause) = [0]> then\n        if <(x position) > (player x)> then\n            change [exv v] by (-0.5)\n            point in direction (-90)\n            if <<(eex) = (player x)> and <not <(eey) = (player y)>>> then\n                change [exv v] by (0.5)\n                wait (pick random (0.9) to (1.3)) seconds\n            end\n        end\n        if <(x position) < (player x)> then\n            change [exv v] by (0.5)\n            point in direction (90)\n            if <<(eex) = (player x)> and <not <(eey) = (player y)>>> then\n                change [exv v] by (-0.5)\n                wait (pick random (0.7) to (1.3)) seconds\n            end\n        end\n        set [exv v] to ((exv) * (0.8))\n    end\nend\n\nwhen flag clicked\nclear graphic effects\nset [ealive? v] to [0]\nhide\nswitch costume to (costume2 v)\nforever\n    if on edge, bounce\n    if <touching (attack v)?> then\n        set [ehurt v] to [1]\n        set [pitch v] effect to (pick random (-50) to (100))\n        start sound [hit-swing-sword-small-2-95566 v]\n    else\n        set [ehurt v] to [0]\n    end\nend\n\nwhen I receive [tick v]\nif <<touching (attack v)?> or <touching (player v)?>> then\n    set [knockback v] to [1]\nelse\n    set [knockback v] to [0]\nend\n\nwhen I receive [tick v]\nif <(knockback) = [1]> then\n    if <(direction) = [-90]> then\n        set [exv v] to [5]\n        set [eyv v] to [2]\n    end\n    if <(direction) = [90]> then\n        set [exv v] to [-5]\n        set [eyv v] to [2]\n    end\nend\n\nwhen I start as a clone\nclear graphic effects\nshow\nswitch costume to (costume1 v)\nforever\n    go to x: (ex) y: ((ey) + (10))\n    if <(ehurt) = [1]> then\n        next costume\n        next costume\n        wait () seconds\n    end\n    if <(costume [number v]) = [14]> then\n        set [edead v] to [1]\n        wait () seconds\n        set [edead v] to [0]\n        broadcast (death1 v)\n        delete this clone\n    end\n    if <(player dead?) = [1]> then\n        delete this clone\n    end\n    if <(underground) = [0]> then\n        delete this clone\n    end\nend\n\nwhen I receive [death1 v]\nset [ealive? v] to [0]\nclear graphic effects\nhide\nset [pitch v] effect to (pick random (-50) to (100))\nplay sound [slimejump-6913 v] until done\nwait (pick random (3) to (5)) seconds\ngo to x: (-250) y: (-150)\nset [exv v] to [0]\nset [eyv v] to [0]\ncreate clone of (_myself_ v)\nset [color v] effect to (pick random (1) to (200))\nshow\nset [ealive? v] to [1]\n\nwhen I receive [underground v]\nclear graphic effects\nhide\nwait (pick random (3) to (5)) seconds\ngo to x: (-250) y: (-150)\nset [exv v] to [0]\nset [eyv v] to [0]\ncreate clone of (_myself_ v)\nset [color v] effect to (pick random (1) to (200))\nshow\nset [ealive? v] to [1]\n\nwhen I receive [ununderground v]\nhide\nset [ealive? v] to [0]\n\nset [pitch v] effect to (pick random (-50) to (100))\nplay sound [slimejump-6913 v] until done\n\nset [pitch v] effect to (pick random (-50) to (100))\nplay sound [slimejump-6913 v] until done\n\nstart sound (pick random (4) to (8))\n\nif <(underground) = [1]> then\n\nset [ealive? v] to [1]\n\nwhen I receive [player dead oh nooo v]\n\nswitch costume to (costume15 v)\nrepeat (100)\n    change [brightness v] effect by (-1)\nend\n\nwhen I receive [player dead oh nooo v]\nset [color v] effect to ((1) / (0))\nset [brightness v] effect to (25)\n\nbroadcast (player dead oh nooo v)\n\nwhen I receive [respawn v]\nclear graphic effects\n\nif <(player dead?) = [1]> then\n    delete this clone\nend\n\nif <(player dead?) = [1]> then\n    delete this clone\nend\n\nwhen I receive [tick v]\nif <(underground) = [0]> then\n    hide\nend\n\n@attack\n\ngo to (player v)\n\nwhen I receive [tick v]\ngo to (animation v)\npoint in direction ([direction v] of [animation v])\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    if <<<(swinging) = [1]> and <<(holding) = [sword]> or <(holding) = [goldsword]>>> and <(pause) = [0]>> then\n        hide\n        wait (0.3) seconds\n        show\n        wait () seconds\n    else\n        hide\n    end\nend\n\nset [ghost v] effect to (100)\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    if <(holding) = [sword]> then\n        switch costume to (costume1 v)\n    end\n    if <(holding) = [goldsword]> then\n        switch costume to (costume2 v)\n    end\nend\n\nclear graphic effects\n\n@health\n\nwhen flag clicked\nset [regen2 v] to [0]\ngo to x: (170) y: (162)\nswitch costume to (full v)\nforever\n    if <<(pknockback) = [1]> and <(pause) = [0]>> then\n        next costume\n        start sound [damage v]\n        broadcast (immune v)\n        set [immune v] to [1]\n        wait (0.3) seconds\n        set [immune v] to [0]\n    end\nend\n\nwhen I receive [immune v]\nbroadcast (overlay v)\nrepeat (5)\n    go to x: (pick random (169) to (171)) y: (pick random (161) to (163))\nend\ngo to x: (170) y: (162)\n\nwhen flag clicked\nwait until <(immune) = [1]>\nforever\n    if <<(immune) = [0]> and <(pause) = [0]>> then\n        wait (1) seconds\n        set [regen2 v] to [1]\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(regen2) = [1]> and <(pause) = [0]>> then\n        broadcast (overlay v)\n        wait until <not <(regen2) = [1]>>\n    end\nend\n\nwhen I receive [new health v]\nswitch costume to ((costume [number v]) - (1))\n\nwhen flag clicked\nforever\n    if <(immune) = [1]> then\n        set [regen2 v] to [0]\n    end\nend\n\nwhen flag clicked\nset [immune v] to [0]\nclear graphic effects\nset [player dead? v] to [0]\nforever\n    if <(costume [number v]) = [11]> then\n        broadcast (player dead oh nooo v)\n        set [player dead? v] to [1]\n        switch costume to (health11 v)\n    end\nend\n\nwhen I receive [player dead oh nooo v]\nset [color v] effect to ((1) / (0))\nset [brightness v] effect to (25)\n\nwhen I receive [respawn v]\nclear graphic effects\n\nwhen I receive [respawn v]\nswitch costume to (full v)\nset [player dead? v] to [0]\n\nset [immune v] to [1]\nwait (1) seconds\nset [immune v] to [0]\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [1]> then\n        set [regen2 v] to [0]\n    end\nend\n\n@overlay\n\nwhen flag clicked\nshow\nhide\nswitch costume to (full v)\ngo to x: (170) y: (162)\n\nwhen I start as a clone\n\nwhen I receive [new health v]\nswitch costume to (([costume # v] of [health v]) - (1))\n\nwhen I receive [tick v]\ngo to (health v)\n\nwhen I receive [overlay v]\nrepeat until <(regen2) = [0]>\n    clear graphic effects\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    repeat (50)\n        change [ghost v] effect by (-2)\n    end\n    broadcast (new health v)\n    hide\n    if <(costume [number v]) = [1]> then\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (([costume # v] of [health v]) - (1))\n    if <(regen2) = [0]> then\n        clear graphic effects\n        hide\n    end\nend\n\nwhen I receive [player dead oh nooo v]\nset [regen2 v] to [0]\nswitch costume to (costume1 v)\n\nwhen I receive [respawn v]\nset [regen2 v] to [0]\nswitch costume to (full v)\n\n@money\n\nwhen flag clicked\nclear graphic effects\nswitch costume to (costume1 v)\nforever\n    wait () seconds\n    next costume\nend\n\nset [pixelate v] effect to (25)\n\nwhen I receive [player dead oh nooo v]\nset [color v] effect to ((1) / (0))\nset [brightness v] effect to (50)\n\nbroadcast (player dead oh nooo v)\n\nwhen I receive [respawn v]\nclear graphic effects\n\n@counter4\n\ndefine text: (text) size: (size) x: (x) y: (y) spacing: (spacing) centered: (centered) textID: (id)\nif <(centered) = [true]> then\n    go to x: (((((length of (text)) * ((spacing) * (size))) * (-0.5)) + (((spacing) * (size)) / (2))) + (x)) y: (y)\nelse\n    go to x: (x) y: (y)\nend\nset size to (size) %\nset [i5 v] to [1]\nrepeat (length of (text))\n    switch costume to (letter (i5) of (text))\n    set [cloneid5 v] to (id)\n    create clone of (_myself_ v)\n    change x by ((spacing) * (size))\n    change [i5 v] by (1)\nend\n\nwhen flag clicked\nwait () seconds\ngo to [front v] layer\nset [value5 v] to [0]\nset [updatecounter5 v] to ((value5) + (1))\nforever\n    if <not <(updatecounter5) = (value5)>> then\n        broadcast (deleteclones5 v)\n        text: (value5) size: [25] x: [205] y: [135] spacing: [0.30] centered: [true] textID: [1]\n        set [updatecounter5 v] to (value5)\n    end\nend\n\nwhen I start as a clone\nshow\nclear graphic effects\nset [brightness v] effect to (100)\nset [clonex5 v] to (x position)\nset [cloney5 v] to (y position)\nif <(cloney5) = [1]> then\nelse\n    change y by (9)\nend\nforever\n    change x by (((clonex5) - (x position)) / (5))\n    change y by (((cloney5) - (y position)) / (5))\nend\n\nwhen I receive [deleteclones5 v]\ndelete this clone\n\nwhen flag clicked\nforever\n    set [value5 v] to (round (money))\nend\n\nchange [money v] by (1)\n\n@coins\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nshow\ngo to x: (([x position v] of [bad v]) + (pick random (-15) to (15))) y: (([y position v] of [bad v]) + (5))\nset [pixelate v] effect to (50)\nset size to (18) %\nforever\n    change [myv v] by (-0.5)\n    change y by (myv)\n    change y by (-0.5)\n    if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> then\n        change y by ((myv) * (-1))\n        set [myv v] to [0]\n        glide (0.2) secs to (player v)\n        change [money v] by (1)\n        start sound (pick random (3) to (5))\n        delete this clone\n    end\n    change y by (0.5)\nend\n\nif <touching (player v)?> then\n    change [money v] by (1)\n    delete this clone\nend\n\nforever\n    wait () seconds\n    next costume\nend\n\nwhen flag clicked\nset [money v] to [0]\nset [myv v] to [0]\nforever\n    if <(edead) = [1]> then\n        repeat (2)\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    wait () seconds\n    next costume\nend\n\n\n\n\n\n@bad2\n\nwhen flag clicked\nclear graphic effects\nswitch costume to (costume2 v)\nset [exv v] to [0]\nset [eyv v] to [0]\ngo to x: (30) y: (50)\nset size to (50) %\nforever\n    if <<(ealive?) = [1]> and <(pause) = [0]>> then\n        change x by (exv)\n        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n            change y by (1)\n            if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                change y by (1)\n                if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                    change y by (1)\n                    if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                        change y by (1)\n                    end\n                    if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                        change y by (1)\n                        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                            change x by ((exv) * (-1))\n                            change y by (-5)\n                            if <(exv) > [0]> then\n                                set [exv v] to [0]\n                            else\n                                set [exv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change [eyv v] by (-1)\n        change y by (eyv)\n        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n            change y by ((eyv) * (-1))\n            set [eyv v] to [0]\n        end\n        change y by (-1)\n        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n            if <(player y) > (eey)> then\n                set [eyv v] to [16]\n                if <(underground) = [1]> then\n                    set [pitch v] effect to (pick random (-50) to (100))\n                    start sound (pick random (4) to (8))\n                end\n            end\n        end\n        change y by (1)\n        set [eex v] to (round (x position))\n        set [eey v] to (round (y position))\n        set [ex2 v] to (round (x position))\n        set [ey2 v] to (round (y position))\n    end\nend\n\nwhen flag clicked\nforever\n    if <(pause) = [0]> then\n        if <(x position) > (player x)> then\n            change [exv v] by (-0.7)\n            point in direction (-90)\n            if <<(eex) = (player x)> and <not <(eey) = (player y)>>> then\n                change [exv v] by (0.7)\n                wait (pick random (0.8) to (1.4)) seconds\n            end\n        end\n        if <(x position) < (player x)> then\n            change [exv v] by (0.7)\n            point in direction (90)\n            if <<(eex) = (player x)> and <not <(eey) = (player y)>>> then\n                change [exv v] by (-0.7)\n                wait (pick random (0.8) to (1.4)) seconds\n            end\n        end\n        set [exv v] to ((exv) * (0.8))\n    end\nend\n\nwhen flag clicked\nset [ealive? v] to [0]\nhide\nswitch costume to (costume2 v)\nforever\n    if on edge, bounce\n    if <touching (attack v)?> then\n        set [ehurt2 v] to [1]\n        set [pitch v] effect to (pick random (-50) to (100))\n        start sound [hit-swing-sword-small-2-95566 v]\n    else\n        set [ehurt2 v] to [0]\n    end\nend\n\nshow\n\nwhen I receive [tick v]\nif <<touching (attack v)?> or <touching (player v)?>> then\n    set [knockback v] to [1]\nelse\n    set [knockback v] to [0]\nend\n\nwhen I receive [tick v]\nif <(knockback) = [1]> then\n    if <(direction) = [-90]> then\n        set [exv v] to [5]\n        set [eyv v] to [2]\n    end\n    if <(direction) = [90]> then\n        set [exv v] to [-5]\n        set [eyv v] to [2]\n    end\nend\n\nwhen I start as a clone\nclear graphic effects\nshow\nswitch costume to (costume1 v)\nforever\n    go to x: (ex2) y: ((ey2) + (10))\n    if <(ehurt2) = [1]> then\n        next costume\n        wait () seconds\n    end\n    if <(costume [number v]) = [10]> then\n        set [edead2 v] to [1]\n        wait () seconds\n        set [edead2 v] to [0]\n        broadcast (death2 v)\n        delete this clone\n    end\n    if <(player dead?) = [1]> then\n        delete this clone\n    end\n    if <(underground) = [0]> then\n        delete this clone\n    end\nend\n\nwhen I receive [death2 v]\nhide\nset [pitch v] effect to (pick random (-50) to (100))\nplay sound [slimejump-6913 v] until done\n\nwhen I receive [underground v]\nset [ealive? v] to [0]\nclear graphic effects\nhide\nwait (pick random (7) to (15)) seconds\ngo to x: (250) y: (-128)\nset [exv v] to [0]\nset [eyv v] to [0]\ncreate clone of (_myself_ v)\nset [color v] effect to (pick random (1) to (200))\nshow\nset [ealive? v] to [1]\n\nwhen I receive [death2 v]\nset [ealive? v] to [0]\nclear graphic effects\nhide\nwait (pick random (7) to (15)) seconds\ngo to x: (250) y: (-128)\nset [exv v] to [0]\nset [eyv v] to [0]\ncreate clone of (_myself_ v)\nset [color v] effect to (pick random (1) to (200))\nshow\nset [ealive? v] to [1]\n\nwhen I receive [ununderground v]\nhide\nset [ealive? v] to [0]\n\nset [ealive? v] to [1]\n\nwhen I receive [player dead oh nooo v]\n\nswitch costume to (costume5 v)\nrepeat (100)\n    change [brightness v] effect by (-1)\nend\n\nwhen I receive [player dead oh nooo v]\nset [color v] effect to ((1) / (0))\nset [brightness v] effect to (25)\n\nbroadcast (player dead oh nooo v)\n\nwhen I receive [respawn v]\nclear graphic effects\n\nwhen I receive [tick v]\nif <(underground) = [0]> then\n    hide\nend\n\n@coins2\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nshow\ngo to x: (([x position v] of [bad2 v]) + (pick random (-15) to (15))) y: (([y position v] of [bad2 v]) + (5))\nset [pixelate v] effect to (50)\nset size to (18) %\nforever\n    change [myv2 v] by (-0.5)\n    change y by (myv2)\n    if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> then\n        change y by ((myv2) * (-1))\n        set [myv2 v] to [0]\n        glide (0.2) secs to (player v)\n        change [money v] by (1)\n        start sound (pick random (3) to (5))\n        delete this clone\n    end\n    change y by (-0.5)\n    if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> then\n    change y by (0.5)\nend\n\nif <touching (player v)?> then\n    change [money v] by (1)\n    delete this clone\nend\n\nforever\n    wait () seconds\n    next costume\nend\n\nwhen flag clicked\nset [money v] to [0]\nset [myv2 v] to [0]\n\nwhen I start as a clone\nforever\n    wait () seconds\n    next costume\nend\n\nrepeat (pick random (2) to (5))\n\n\n\n\n\nwhen flag clicked\nset [money v] to [0]\nset [myv v] to [0]\nforever\n    if <(edead2) = [1]> then\n        repeat (4)\n            create clone of (_myself_ v)\n        end\n    end\nend\n\n@invsprite\n\nwhen flag clicked\nhide\nset [red v] to [0]\ngo to x: (0) y: (0)\nwait (0.5) seconds\ngo to [front v] layer\n\nwhen I receive [red v]\nset [red v] to [1]\nforever\n    if <(open?) = [1]> then\n        go to [front v] layer\n        show\n    else\n        hide\n    end\nend\n\nset [money v] to [100]\n\nforever\n    if <(open?) = [1]> then\n    else\n        hide\n    end\nend\n\nshow\n\ngo to [front v] layer\n\n@invsprite2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nset [blue v] to [0]\nwait (0.5) seconds\ngo to [front v] layer\n\nwhen I receive [blue v]\nset [blue v] to [1]\nshow\nforever\n    if <(open?) = [1]> then\n        go to [front v] layer\n        show\n    else\n        hide\n    end\nend\n\nset [money v] to [100]\n\n@invsprite3\n\nwhen flag clicked\nhide\nset [green v] to [0]\ngo to x: (0) y: (0)\nwait (0.5) seconds\ngo to [front v] layer\n\nwhen I receive [green v]\nset [green v] to [1]\nshow\nforever\n    if <(open?) = [1]> then\n        go to [front v] layer\n        show\n    else\n        hide\n    end\nend\n\n@invsprite4\n\nwhen flag clicked\nhide\nset [yellow v] to [0]\ngo to x: (0) y: (0)\nwait (0.5) seconds\ngo to [front v] layer\n\nwhen I receive [yellow v]\nset [yellow v] to [1]\nshow\nforever\n    if <(open?) = [1]> then\n        go to [front v] layer\n        show\n    else\n        hide\n    end\nend\n\nset [money v] to [100]\n\n@lighting\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nforever\n    go to [front v] layer\n    go to (player v)\n    set [ghost v] effect to (95)\n    set [pixelate v] effect to (0)\n    if <(underground) = [1]> then\n        show\n        set [ghost v] effect to (75)\n    else\n        hide\n    end\nend\n\nwhen I receive [underground v]\ngo to [front v] layer\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\n\nshow\nswitch costume to (costume2 v)\n\ngo [backward v] (2) layers\nforever\n\n@notifications\n\nwhen flag clicked\nhide\nwait (pick random (20) to (30)) seconds\nswitch costume to (costume11 v)\nshow\nstart sound [notifications-sound-127856 v]\nclear graphic effects\ngo to x: (146) y: (-169)\nset size to (80) %\nwait (3) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\n\nswitch costume to (costume9 v)\n\nwhen flag clicked\nforever\n    if <key (z v) pressed?> then\n        switch costume to (costume2 v)\n        clear graphic effects\n        go to x: (146) y: (-169)\n        set size to (80) %\n        start sound [notifications-sound-127856 v]\n        wait (1) seconds\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (x v) pressed?> then\n        switch costume to (costume1 v)\n        clear graphic effects\n        go to x: (146) y: (-169)\n        set size to (80) %\n        start sound [notifications-sound-127856 v]\n        wait (1) seconds\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<not <<(holding) = [sword]> or <(holding) = [goldsword]>>> and <(underground) = [1]>> and <(hotbar?) = [0]>> then\n        wait (0.1) seconds\n        if <mouse down?> then\n            switch costume to (costume10 v)\n            clear graphic effects\n            go to x: (146) y: (-169)\n            set size to (80) %\n            start sound [notifications-sound-127856 v]\n            wait (2) seconds\n            repeat (20)\n                change [ghost v] effect by (5)\n            end\n        end\n    end\nend\n\nwhen I receive [generated v]\ngo to [front v] layer\nshow\nstart sound [notifications-sound-127856 v]\nclear graphic effects\nswitch costume to (costume9 v)\ngo to x: (146) y: (-169)\nset size to (80) %\nwait (3) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\n\n@bad3\n\nwhen flag clicked\nswitch costume to (costume2 v)\nset [exv v] to [0]\nset [eyv v] to [0]\ngo to x: (30) y: (50)\nset size to (50) %\nforever\n    if <<(pause) = [0]> and <(ealive3?) = [1]>> then\n        change x by (exv)\n        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n            change y by (1)\n            if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                change y by (1)\n                if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                    change y by (1)\n                    if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                        change y by (1)\n                    end\n                    if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                        change y by (1)\n                        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n                            change x by ((exv) * (-1))\n                            change y by (-5)\n                            if <(exv) > [0]> then\n                                set [exv v] to [0]\n                            else\n                                set [exv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change [eyv v] by (-1)\n        change y by (eyv)\n        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n            change y by ((eyv) * (-1))\n            set [eyv v] to [0]\n        end\n        change y by (-1)\n        if <<<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <touching color (#9d7640)?>>>>> or <<touching (underground levelsprite1sprite1 v)?> or <touching (deep v)?>>> then\n            if <(player y) > (eey)> then\n                set [eyv v] to [17]\n                if <(underground) = [1]> then\n                    set [pitch v] effect to (pick random (-50) to (100))\n                    start sound (pick random (4) to (8))\n                end\n            end\n        end\n        change y by (1)\n        set [eex v] to (round (x position))\n        set [eey v] to (round (y position))\n        set [ex3 v] to (round (x position))\n        set [ey3 v] to (round (y position))\n    end\nend\n\nwhen flag clicked\nforever\n    if <(pause) = [0]> then\n        if <(x position) > (player x)> then\n            change [exv v] by (-0.4)\n            point in direction (-90)\n            if <<(eex) = (player x)> and <not <(eey) = (player y)>>> then\n                change [exv v] by (0.4)\n                wait (pick random (0.7) to (1.4)) seconds\n            end\n        end\n        if <(x position) < (player x)> then\n            change [exv v] by (0.4)\n            point in direction (90)\n            if <<(eex) = (player x)> and <not <(eey) = (player y)>>> then\n                change [exv v] by (-0.7)\n                wait (pick random (0.7) to (1.4)) seconds\n            end\n        end\n        set [exv v] to ((exv) * (0.8))\n    end\nend\n\nwhen flag clicked\nset [ealive3? v] to [0]\nclear graphic effects\nset size to (75) %\nhide\nswitch costume to (costume2 v)\nforever\n    if on edge, bounce\n    if <touching (attack v)?> then\n        set [ehurt3 v] to [1]\n        set [pitch v] effect to (pick random (-50) to (100))\n        start sound [hit-swing-sword-small-2-95566 v]\n    else\n        set [ehurt3 v] to [0]\n    end\nend\n\nshow\n\nwhen I receive [tick v]\nif <<touching (attack v)?> or <touching (player v)?>> then\n    set [knockback v] to [1]\nelse\n    set [knockback v] to [0]\nend\n\nwhen I receive [tick v]\nif <(knockback) = [1]> then\n    if <(direction) = [-90]> then\n        set [exv v] to [5]\n        set [eyv v] to [2]\n    end\n    if <(direction) = [90]> then\n        set [exv v] to [-5]\n        set [eyv v] to [2]\n    end\nend\n\nwhen I start as a clone\nclear graphic effects\nshow\nswitch costume to (costume1 v)\nforever\n    go to x: (ex3) y: ((ey3) + (20))\n    if <(ehurt3) = [1]> then\n        next costume\n        wait () seconds\n    end\n    if <(costume [number v]) = [14]> then\n        set [edead3 v] to [1]\n        wait () seconds\n        set [edead3 v] to [0]\n        broadcast (death3 v)\n        delete this clone\n    end\n    if <(player dead?) = [1]> then\n        delete this clone\n    end\n    if <(underground) = [0]> then\n        delete this clone\n    end\nend\n\nwhen I receive [death3 v]\nset [pitch v] effect to (pick random (-50) to (100))\nplay sound [slimejump-6913 v] until done\nhide\n\nwhen I receive [underground v]\nset [ealive3? v] to [0]\nclear graphic effects\nhide\nwait (pick random (25) to (40)) seconds\ngo to x: (250) y: (-128)\nset [exv v] to [0]\nset [eyv v] to [0]\ncreate clone of (_myself_ v)\nset [color v] effect to (pick random (1) to (200))\nshow\nset [ealive3? v] to [1]\n\nwhen I receive [death3 v]\nset [ealive3? v] to [0]\nclear graphic effects\nhide\nwait (pick random (25) to (40)) seconds\ngo to x: (250) y: (-128)\nset [exv v] to [0]\nset [eyv v] to [0]\ncreate clone of (_myself_ v)\nset [color v] effect to (pick random (1) to (200))\nshow\nset [ealive3? v] to [1]\n\nwhen I receive [ununderground v]\nhide\nset [ealive3? v] to [0]\n\nwhen I receive [player dead oh nooo v]\nset [color v] effect to ((1) / (0))\nset [brightness v] effect to (25)\n\nwhen I receive [respawn v]\nclear graphic effects\n\nwhen I receive [tick v]\nif <(underground) = [0]> then\n    hide\nend\n\n@coins3\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nshow\ngo to x: (([x position v] of [bad3 v]) + (pick random (-15) to (15))) y: (([y position v] of [bad3 v]) + (5))\nset [pixelate v] effect to (50)\nset size to (18) %\nforever\n    change [myv3 v] by (-0.5)\n    change y by (myv3)\n    if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> then\n        change y by ((myv3) * (-1))\n        set [myv3 v] to (myv3)\n        glide (0.2) secs to (player v)\n        change [money v] by (1)\n        start sound (pick random (3) to (5))\n        delete this clone\n    end\n    change y by (-0.5)\n    if <<touching color (#00c30a)?> or <<touching color (#915c33)?> or <<touching color (#c29250)?> or <<touching color (#545454)?> or <<touching color (#9d7640)?> or <touching (deep v)?>>>>>> then\n    change y by (0.5)\nend\n\nif <touching (player v)?> then\n    change [money v] by (1)\n    delete this clone\nend\n\nforever\n    wait () seconds\n    next costume\nend\n\nwhen flag clicked\nset [money v] to [0]\nset [myv3 v] to [0]\n\nwhen I start as a clone\nforever\n    wait () seconds\n    next costume\nend\n\nrepeat (pick random (2) to (5))\n\n\n\n\n\nwhen flag clicked\nset [money v] to [0]\nset [myv v] to [0]\nforever\n    if <(edead3) = [1]> then\n        repeat (8)\n            create clone of (_myself_ v)\n        end\n    end\nend\n\n@death screen\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\nset [ghost v] effect to (100)\n\nset [pause v] to [0]\n\nwhen I receive [player dead oh nooo v]\nset [ghost v] effect to (100)\nset [pause v] to [1]\nstart sound [video-game-game-over-3-SBA-300283551-preview v]\nshow\ngo to [front v] layer\ngo [backward v] (1) layers\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nwait (0.5) seconds\ncreate clone of (_myself_ v)\nwait (4) seconds\nbroadcast (respawn v)\nbroadcast (ununderground v)\nset [underground v] to [0]\nhide\nset [pause v] to [0]\n\nwait (1) seconds\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (costume2 v)\nshow\nset [ghost v] effect to (100)\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nforever\n    if <(underground) = [0]> then\n        delete this clone\n    end\nend\n\n@grave\n\nwhen I receive [player dead oh nooo v]\nset [stored money v] to ((stored money) + (money))\nwait (0.1) seconds\nset [money v] to [0]\nhide\n\nwhen flag clicked\nset [stored money v] to [0]\nset [pixelate v] effect to (0)\nhide\nset [player dead x v] to [240]\nset [player dead y v] to [-180]\n\nwhen I receive [respawn v]\ngo to x: (player dead x) y: (player dead y)\nforever\n    if <touching (player v)?> then\n        set [money v] to ((stored money) + (money))\n        wait (0.1) seconds\n        set [stored money v] to [0]\n        start sound [coins27-36030 v]\n        set [player dead x v] to [240]\n        set [player dead y v] to [-180]\n        hide\n    end\nend\n\nwhen I receive [underground v]\nwait (0.1) seconds\nshow\n\nwhen I receive [ununderground v]\nhide\n\nwhen flag clicked\nforever\nend\n\nwhen I receive [respawn v]\nif <(stored money) > [0]> then\n\nset [stored money v] to [0]\n\nwhen I receive [tick v]\nif <(player dead x) = [240]> then\n    hide\nend\nif <(player dead y) = [-180]> then\n    hide\nend\n\n@generating\n\nwhen flag clicked\nshow\nswitch costume to (costume4 v)\nrepeat (3)\n    wait (0.5) seconds\n    next costume\nend\n\nwhen I receive [generated v]\nhide\n\nwhen I receive [tick v]\ngo to [front v] layer\n\n@tooltips\n\nwhen I receive [redhover v]\nif <(shop) = [1]> then\n    go to (mouse-pointer v)\n    switch costume to (costume2 v)\n    go to [front v] layer\n    show\nend\n\nwhen I receive [blue hover v]\nif <(shop) = [1]> then\n    go to (mouse-pointer v)\n    switch costume to (costume3 v)\n    go to [front v] layer\n    show\nend\n\nwhen I receive [green hover v]\nif <(shop) = [1]> then\n    go to (mouse-pointer v)\n    switch costume to (costume4 v)\n    go to [front v] layer\n    show\nend\n\nwhen I receive [yellow hoover v]\nif <(shop) = [1]> then\n    go to (mouse-pointer v)\n    switch costume to (costume5 v)\n    go to [front v] layer\n    show\nend\n\nwhen I receive [gold hover v]\nif <(shop) = [1]> then\n    go to (mouse-pointer v)\n    switch costume to (costume1 v)\n    go to [front v] layer\n    show\nend\n\nwhen flag clicked\nset [shop v] to [0]\nhide\n\nwhen I receive [hovernothing v]\nhide\n\nwhen I receive [tick v]\ngo to (mouse-pointer v)\n\n@thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\nset [ghost v] effect to (0)\n\n
Check this out! https://scratch.mit.edu/projects/471763896/ Welcome to my new platformer!\n- Use the arrow keys or WASD\n- Avoid spikes and Lava\n- Complete all the 10 levels quickly to get a score\n- Tell your score in the comments.\nNew platformer is out!!!\nhttps://scratch.mit.edu/projects/470236659/\n\nNotes and credits \n- Thank you cooltext.com for thumbnail text\n- Thank you @aqury for the epic intro!\n- Thank you Youtube for some sounds\n- music by ParagonX9 - Chaoz Fantasy