The Bunny - A Platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (1 v)\nset [bunny health v] to [100]\n\nwhen I receive [next level v]\nwait (0.1) seconds\nnext backdrop\nset [carrots v] to [0]\n\nwhen I receive [next background v]\nwait (0.1) seconds\nnext backdrop\n\n@Bunny\n\nwhen flag clicked\nshow variable [weapon v]\nshow variable [carrots v]\nset [bunny health v] to [100]\nset [weapon v] to [Carrot]\nset [sword v] to [0]\nswitch costume to (bunny v)\ngo to x: (-218) y: (-85)\nset [y vel v] to [0]\nset [x vel v] to [0]\nforever\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        if <(Potion) = [Speed]> then\n            change [x vel v] by (1.4)\n        else\n            change [x vel v] by (0.9)\n        end\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        if <(Potion) = [Speed]> then\n            change [x vel v] by (-1.2)\n        else\n            change [x vel v] by (-0.9)\n        end\n    end\n    set [x vel v] to ((x vel) * (0.9))\n    change x by (x vel)\n    if <touching color (#666666)?> then\n        change y by (1)\n        if <touching color (#666666)?> then\n            change y by (1)\n            if <touching color (#666666)?> then\n                change y by (1)\n                if <touching color (#666666)?> then\n                    change y by (1)\n                    if <touching color (#666666)?> then\n                        change y by (1)\n                        if <touching color (#666666)?> then\n                            change x by ((x vel) * (-1))\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                if <(x vel) > [0]> then\n                                    set [x vel v] to [-5]\n                                else\n                                    set [x vel v] to [5]\n                                end\n                                set [y vel v] to [10]\n                                start sound [jump v]\n                            else\n                                set [x vel v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y vel v] by (-0.8)\n    change y by (y vel)\n    if <touching color (#666666)?> then\n        change y by ((y vel) * (-1))\n        set [y vel v] to [1]\n    end\n    change y by (-0.8)\n    if <touching color (#666666)?> then\n        if <key (up arrow v) pressed?> then\n            if <(Potion) = [Jump]> then\n                set [y vel v] to [15]\n            else\n                set [y vel v] to [12]\n            end\n            start sound [jump v]\n        end\n    end\n    change y by (0.8)\n    if <touching color (#ff9400)?> then\n        start sound [fairydust v]\n        broadcast (next level v)\n        go to x: (-218) y: (-85)\n    end\n    if <touching color (#f69588)?> then\n        start sound [bxsb v]\n        change [bunny health v] by (-20)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to x: (-218) y: (-85)\n        set [y vel v] to [0]\n        set [x vel v] to [0]\n        set [ghost v] effect to (0)\n    end\n    if <touching (zombie v)?> then\n        set [y vel v] to [5]\n        start sound [Hit v]\n        if <(Direction) = [90]> then\n            set [x vel v] to [-10]\n            change [bunny health v] by (-10)\n        end\n        if <(Direction) = [-90]> then\n            set [x vel v] to [10]\n            change [bunny health v] by (-10)\n        end\n    end\n    if <touching (boss carrot v)?> then\n        set [y vel v] to [5]\n        start sound [Hit v]\n        if <(Direction) = [90]> then\n            set [x vel v] to [-10]\n            change [bunny health v] by (-5)\n        end\n        if <(Direction) = [-90]> then\n            set [x vel v] to [10]\n            change [bunny health v] by (-5)\n        end\n    end\n    if <touching (fire v)?> then\n        set [y vel v] to [4]\n        start sound [Hit v]\n        if <(Direction) = [90]> then\n            set [x vel v] to [-7]\n            change [bunny health v] by (-5)\n        end\n        if <(Direction) = [-90]> then\n            set [x vel v] to [7]\n            change [bunny health v] by (-5)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [direction v] to (direction)\nend\n\nwhen flag clicked\nforever\n    if <touching (carrot \(display\) v)?> then\n        change [carrots v] by (1)\n        wait (0.1) seconds\n    end\nend\n\nwait (0.2) seconds\n\nwhen flag clicked\nforever\n    if <<key (2 v) pressed?> and <(Sword) = [yes]>> then\n        set [weapon v] to [Sword]\n    end\n    if <key (1 v) pressed?> then\n        set [weapon v] to [Carrot]\n    end\nend\n\nwhen I receive [restart v]\ngo to x: (-218) y: (-85)\nset [bunny health v] to [100]\n\n@Carrot (Attack)\n\nwhen I start as a clone\nshow\ngo to (bunny v)\ngo [backward v] (1) layers\npoint in direction (Direction)\nmove (30) steps\nstart sound [laser1 v]\nrepeat until <<touching color (#666666)?> or <<touching (target v)?> or <touching (zombie v)?>>>\n    move (10) steps\n    go to [front v] layer\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen flag clicked\nset [carrots v] to [0]\nhide\nforever\n    if <key (space v) pressed?> then\n        if <<(Weapon) = [Carrot]> and <(Carrots) > [0]>> then\n            create clone of (_myself_ v)\n            change [carrots v] by (-1)\n            wait (0.2) seconds\n        end\n    end\nend\n\n@Carrot (Display)\n\nwhen I start as a clone\nshow\nforever\n    repeat (30)\n        change y by (0.5)\n    end\n    repeat (30)\n        change y by (-0.5)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [4 v]\ngo to x: (0) y: (-156)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    if <touching (bunny v)?> then\n        wait (0.01) seconds\n        start sound [Collect v]\n        delete this clone\n    end\nend\n\nwhen backdrop switches to [5 v]\ngo to x: (50) y: (-156)\ncreate clone of (_myself_ v)\ngo to x: (0) y: (-156)\ncreate clone of (_myself_ v)\ngo to x: (-50) y: (-156)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [6 v]\ngo to x: (-50) y: (-156)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [8 v]\ngo to x: (-150) y: (-156)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [9 v]\ngo to x: (-150) y: (-156)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [9 v]\ngo to x: (-100) y: (-156)\ncreate clone of (_myself_ v)\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [restart v]\ndelete this clone\n\n@Zombie\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [8 v]\ngo to x: (50) y: (-161)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nforever\n    point in direction (90)\n    repeat (35)\n        change x by (2.5)\n    end\n    point in direction (-90)\n    repeat (35)\n        change x by (-2.5)\n    end\nend\n\nwhen backdrop switches to [9 v]\ngo to x: (20) y: (-51)\ncreate clone of (_myself_ v)\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <<touching (carrot \(attack\) v)?> or <touching (sword \(attack\) v)?>> then\n        wait (0.1) seconds\n        delete this clone\n    end\nend\n\n@Sprite1\n\n@Target\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [6 v]\ngo to x: (79) y: (-155)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nshow\nforever\n    if <touching (carrot \(attack\) v)?> then\n        start sound [recording1 v]\n        repeat (3)\n            next costume\n            wait (0.02) seconds\n        end\n        broadcast (next background v)\n        delete this clone\n    end\nend\n\nwhen backdrop switches to [9 v]\ngo to x: (127) y: (-51)\ncreate clone of (_myself_ v)\n\nwhen I receive [restart v]\ndelete this clone\n\n@Health Bar\n\nwhen flag clicked\nforever\n    broadcast (health v)\nend\n\nwhen I receive [health v]\nPlayer Health Bar\n\ndefine Player Health Bar\nerase all\ngo to [front v] layer\npen up\nset pen color to (#ffffff)\nset pen size to (8)\ngo to x: (([x position v] of [bunny v]) - (20)) y: (([y position v] of [bunny v]) + (32))\npen down\ngo to x: (([x position v] of [bunny v]) + (20)) y: (([y position v] of [bunny v]) + (32))\nif <not <(Bunny Health) < [1]>> then\n    go to x: (([x position v] of [bunny v]) - (20)) y: (([y position v] of [bunny v]) + (32))\n    set pen color to (#55ffff)\n    pen up\n    set pen size to (4)\n    pen down\n    change x by ((Bunny Health) / (2.5))\n    pen up\nend\n\n@Levels\n\nwhen flag clicked\nset [level v] to [1]\ngo to x: (0) y: (0)\nstart sound [Lost Sky - Dreams \[NCS Release\].mp3 v]\nswitch costume to (1 v)\nforever\n    go [backward v] (10000) layers\nend\n\nwhen I receive [next background v]\nnext costume\n\nwhen I receive [next level v]\nchange [level v] by (1)\nnext costume\n\nwhen flag clicked\nforever\n    if <key (r v) pressed?> then\n        broadcast (Restart v)\n        switch costume to (1 v)\n        switch backdrop to (1 v)\n        set [level v] to [1]\n    end\nend\n\n@Sword (Attack)\n\nwhen flag clicked\nforever\n    go to (bunny v)\n    point in direction (Direction)\nend\n\nwhen flag clicked\nhide\nforever\n    if <(Weapon) = [Sword]> then\n        if <key (space v) pressed?> then\n            show\n        else\n            hide\n        end\n    end\nend\n\n@Sword (Display)\n\nwhen I start as a clone\nshow\nforever\n    repeat (30)\n        change y by (0.5)\n    end\n    repeat (30)\n        change y by (-0.5)\n    end\nend\n\nwhen backdrop switches to [11 v]\ngo to x: (0) y: (-154)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    if <touching (bunny v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n            set [sword v] to [yes]\n        end\n        delete this clone\n    end\nend\n\nwhen flag clicked\nhide\nset [ghost v] effect to (0)\n\n@Sprite2\n\n@Boss\n\nwhen flag clicked\nhide\nset [boss health v] to [1000]\nhide variable [boss health v]\n\nwhen backdrop switches to [12 v]\nshow variable [boss health v]\nshow\nforever\n    go to x: (0) y: (-105)\n    point towards (bunny v)\n    if <touching (sword \(attack\) v)?> then\n        change [boss health v] by (-2)\n    end\n    if <(Boss Health) < [1]> then\n        start sound [eyeyee - Zombie Death Minecraft v]\n        broadcast (next level v)\n        hide variable [boss health v]\n        hide\n        stop [this script v]\n    end\nend\n\n@Jump Potion\n\nwhen I receive [restart v]\ndelete this clone\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I start as a clone\nshow\nforever\n    repeat (30)\n        change y by (0.5)\n    end\n    repeat (30)\n        change y by (-0.5)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (bunny v)?> then\n        wait (0.01) seconds\n        broadcast (Jump Boost v)\n        start sound [Coin v]\n        delete this clone\n    end\nend\n\nwhen flag clicked\nhide\nset [potion v] to [None]\nset size to (17) %\n\nwhen I receive [jump boost v]\nset [potion v] to [Jump]\n\nwhen backdrop switches to [14 v]\ngo to x: (-90) y: (-163)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [15 v]\ngo to x: (-96) y: (-163)\ncreate clone of (_myself_ v)\n\n@Speed Potion\n\nwhen I receive [restart v]\ndelete this clone\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I start as a clone\nshow\nforever\n    repeat (30)\n        change y by (0.5)\n    end\n    repeat (30)\n        change y by (-0.5)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (bunny v)?> then\n        wait (0.01) seconds\n        broadcast (Speed Up v)\n        delete this clone\n    end\nend\n\nwhen flag clicked\nset size to (17) %\nhide\n\nwhen I receive [speed up v]\nset [potion v] to [Speed]\nstart sound [Coin v]\n\nwhen I receive [next level v]\nset [potion v] to [None]\n\nwhen I receive [restart v]\nset [potion v] to [None]\n\nwhen backdrop switches to [14 v]\ngo to x: (-5) y: (-163)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [16 v]\ngo to x: (-135) y: (-163)\ncreate clone of (_myself_ v)\n\n@Health Potion\n\nwhen I receive [restart v]\ndelete this clone\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I start as a clone\nshow\nforever\n    repeat (30)\n        change y by (0.5)\n    end\n    repeat (30)\n        change y by (-0.5)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (bunny v)?> then\n        wait (0.01) seconds\n        set [bunny health v] to [100]\n        start sound [Magical Healing Spells Sound Effects v]\n        delete this clone\n    end\nend\n\nwhen flag clicked\nset size to (17) %\nhide\n\nwhen backdrop switches to [14 v]\ngo to x: (80) y: (-163)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [15 v]\ngo to x: (90) y: (-163)\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [16 v]\ngo to x: (120) y: (-163)\ncreate clone of (_myself_ v)\n\n@Jump Particle\n\nwhen flag clicked\nhide\nset [ghost v] effect to (130)\nforever\n    repeat until <not <(Potion) = [Jump]>>\n        go to (bunny v)\n        instantly create (1) clones\n    end\nend\n\ndefine instantly create (clones) clones\nrepeat (clones)\n    create clone of (_myself_ v)\nend\n\ndefine render\nchange size by (20)\nswitch costume to (glow v)\nstamp\nswitch costume to (particle v)\nchange size by (-20)\n\nwhen I start as a clone\nhide\ngo to (bunny v)\nset [main-x v] to (x position)\nset [life v] to (pick random (125) to (150))\nset [vel v] to (pick random (-10) to (10))\nchange y by (pick random (-5) to (5))\nswitch costume to (particle v)\nset size to ((life) / (1.25)) %\nset [ghost v] effect to ((life) / (1.75))\nset [ghost v] to ((life) / (1.75))\nshow\nrepeat until <(life) < [1]>\n    change [life v] by (-3)\n    if <(vel) < [0]> then\n        change [vel v] by (0.5)\n    end\n    if <(vel) > [0]> then\n        change [vel v] by (-0.5)\n    end\n    if <(x position) < (main-x)> then\n        change x by (0.5)\n    end\n    if <(x position) > (main-x)> then\n        change x by (-0.5)\n    end\n    change x by (vel)\n    change y by ((life) / (30))\n    change [ghost v] effect by (2)\n    change [ghost v] by (2)\n    set size to ((life) / (1.25)) %\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\nend\ndelete this clone\n\nwhen I receive [tick v]\nrender\n\n@Speed Particle\n\nwhen flag clicked\nhide\nset [ghost v] effect to (130)\nforever\n    repeat until <not <(Potion) = [Speed]>>\n        go to (bunny v)\n        instantly create (1) clones\n    end\nend\n\ndefine instantly create (clones) clones\nrepeat (clones)\n    create clone of (_myself_ v)\nend\n\ndefine render\nchange size by (20)\nswitch costume to (glow v)\nstamp\nswitch costume to (particle v)\nchange size by (-20)\n\nwhen I start as a clone\nhide\ngo to (bunny v)\nset [main-x v] to (x position)\nset [life v] to (pick random (125) to (150))\nset [vel v] to (pick random (-10) to (10))\nchange y by (pick random (-5) to (5))\nswitch costume to (particle v)\nset size to ((life) / (1.25)) %\nset [ghost v] effect to ((life) / (1.75))\nset [ghost v] to ((life) / (1.75))\nshow\nrepeat until <(life) < [1]>\n    change [life v] by (-3)\n    if <(vel) < [0]> then\n        change [vel v] by (0.5)\n    end\n    if <(vel) > [0]> then\n        change [vel v] by (-0.5)\n    end\n    if <(x position) < (main-x)> then\n        change x by (0.5)\n    end\n    if <(x position) > (main-x)> then\n        change x by (-0.5)\n    end\n    change x by (vel)\n    change y by ((life) / (30))\n    change [ghost v] effect by (2)\n    change [ghost v] by (2)\n    set size to ((life) / (1.25)) %\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\nend\ndelete this clone\n\nwhen I receive [tick v]\nrender\n\n@Boss Carrot\n\nwhen I start as a clone\nshow\ngo to (boss v)\nchange y by (40)\ngo [backward v] (1) layers\npoint towards (bunny v)\nmove (10) steps\nstart sound [laser1 v]\nrepeat until <<touching color (#666666)?> or <<touching (bunny v)?> or <touching (target v)?>>>\n    move (10) steps\n    go to [front v] layer\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [12 v]\nforever\n    if <(Boss Health) > [0]> then\n        create clone of (_myself_ v)\n        wait (1.5) seconds\n    end\nend\n\n@Fire\n\nwhen flag clicked\nhide\nset size to (15) %\nforever\n    if <(backdrop [number v]) = [16]> then\n        create clone of (_myself_ v)\n        wait (0.2) seconds\n    end\nend\n\nwhen I start as a clone\nif <not <(backdrop [number v]) = [16]>> then\n    delete this clone\nend\n\nwhen I start as a clone\nshow\ngo to x: (pick random (-90) to (70)) y: (163)\nrepeat until <<touching (bunny v)?> or <touching color (#666666)?>>\n    point in direction (180)\n    move (20) steps\nend\nrepeat (2)\n    change [ghost v] effect by (50)\nend\ndelete this clone\n\n@Game Over\n\nwhen flag clicked\nset [bunny health v] to [100]\ngo to x: (0) y: (0)\nhide\nforever\n    if <(Bunny Health) < [1]> then\n        show\n        go to [front v] layer\n        hide variable [weapon v]\n        hide variable [carrots v]\n        stop [all v]\n    end\nend\n\n@Thumbnail\n\ngo to x: (0) y: (0)\n\nwhen flag clicked\nhide\n\nshow\ngo to [front v] layer\n\nhide variable [carrots v]\nhide variable [weapon v]\n\n
=================Instuctions===============\n-Arrow Keys to move\n-Go to the orange to get to the next level\n-R to restart\n-Space to attack\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nIf you see this, comment "bunny" :D