Powers -A Platformer-

Instructions: #24 on trending\nArrow keys/wad/mobile to move\nAvoid spikes, lava, and enemies.\nSpace/Attack button to attack.\n-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-\nPOWER STATS:\nFIRE:\nType: Shoots a fireball that moves in a straight line\nSpeed: Fast\nRange: Short\nWATER:\nType: Uses a big wave that moves in a straight line\nSpeed: Medium\nRange: Far\nPLANT:\nType: Throws a plant-themed boomerang thingy that moves in a zigzag\nSpeed: Medium\nRange: short\nTHUNDER:\nType: Shoots a lightning bolt that moves in a straight line\nSpeed: Really fast\nRange: Very short

@Stage\n\nwhen I receive [start the game v]\nforever\n    play sound [Sunlight v] until done\nend\n\n@Sprite\n\nwhen flag clicked\nforever\n    if <(x position) > [220]> then\n        broadcast (NEXT LEVEL v)\n        set [xv v] to [0]\n        set [yv v] to [0]\n        go to x: (-193) y: (-60)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [lvl start v]\ngo to x: (-193) y: (-60)\n\nwhen I receive [next level v]\ngo to x: (-193) y: (-60)\nchange [level v] by (1)\n\nif <(change?) = [0]> then\n\nset [change? v] to [1]\n\nwait (.1) seconds\nset [change? v] to [0]\n\nset [change? v] to [0]\n\nwhen I receive [start v]\nset [yv v] to [0]\nset [xv v] to [0]\nset [level v] to [1]\nset [change? v] to [0]\nshow\nset rotation style [left-right v]\npoint in direction (90)\ngo to x: (-193) y: (-60)\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        point in direction (90)\n        change [xv v] by (1)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        point in direction (-90)\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching (sprite1 v)?> then\n        change y by (1)\n        if <touching (sprite1 v)?> then\n            change y by (1)\n            if <touching (sprite1 v)?> then\n                change y by (1)\n                if <touching (sprite1 v)?> then\n                    change y by (1)\n                    if <touching (sprite1 v)?> then\n                        change y by (1)\n                        if <touching (sprite1 v)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-8]\n                                else\n                                    set [xv v] to [8]\n                                end\n                                set [yv v] to [13]\n                            else\n                                set [xv v] to [0]\n                            end\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 (sprite1 v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching (sprite1 v)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    if <touching (sprite9 v)?> then\n        set [yv v] to [20]\n    end\n    if <<touching (sprite10 v)?> or <touching (enemies v)?>> then\n        start sound [Crunch v]\n        Die\n        go to x: (-193) y: (-60)\n        set [ghost v] effect to (0)\n        show\n        set size to (100) %\n    end\n    if <(direction) = [90]> then\n        broadcast (90 v)\n    end\n    if <(direction) = [-90]> then\n        broadcast (-90 v)\n    end\nend\n\nwhen I receive [fire v]\nswitch costume to (fire v)\n\nwhen I receive [plant baby v]\nswitch costume to (grass v)\n\nwhen I receive [thunder boiz v]\nswitch costume to (thunder v)\n\nwhen I receive [water v]\nswitch costume to (water v)\n\nswitch costume to (fire v)\n\ndefine Die\nclear graphic effects\nset rotation style [all around v]\nrepeat (20)\n    turn right (15) degrees\n    change y by (10)\n    change [ghost v] effect by (5)\nend\nbroadcast (lvl start v)\nset rotation style [left-right v]\npoint in direction (90)\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nshow\n\n@skip\n\nwhen flag clicked\nhide\n\nwhen this sprite clicked\nbroadcast (NEXT LEVEL v)\nbroadcast (lvl start v)\nwait (.2) seconds\n\nwhen I receive [start v]\ngo to x: (-183) y: (159)\nshow\npoint in direction (90)\ngo to [front v] layer\nforever\n    set size to (100) %\n    point in direction (90)\n    if <(Level) = [15]> then\n        hide\n    end\n    if <not <(Level) = [15]>> then\n        show\n    end\n    if <touching (mouse-pointer v)?> then\n        set size to (120) %\n        point in direction (75)\n    end\nend\n\n@Sprite7\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\ngo to [back v] layer\nset x to (-200)\nset size to (pick random (50) to (100)) %\nshow\nset [ghost v] effect to (pick random (10) to (70))\nset y to (pick random (60) to (120))\nrepeat until <(x position) > [220]>\n    change x by (1.5)\nend\ndelete this clone\n\nwhen I receive [start v]\nforever\n    wait (pick random (1.5) to (5)) seconds\n    create clone of (_myself_ v)\nend\n\n@Sprite2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start the game v]\nshow\n\nwhen I receive [hide v]\nhide\n\n@Sprite3\n\nwhen I receive [start the game v]\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            broadcast (fire v)\n            broadcast (hide v)\n            broadcast (start v)\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [hide v]\nhide\nstop [other scripts in sprite v]\n\n@Sprite4\n\nwhen I receive [start the game v]\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            broadcast (water v)\n            broadcast (hide v)\n            broadcast (start v)\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [hide v]\nhide\nstop [other scripts in sprite v]\n\n@Sprite5\n\nwhen I receive [start the game v]\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            broadcast (plant baby v)\n            broadcast (hide v)\n            broadcast (start v)\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [hide v]\nhide\nstop [other scripts in sprite v]\n\n@Sprite6\n\nwhen I receive [start the game v]\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            broadcast (thunder boiz v)\n            broadcast (hide v)\n            broadcast (start v)\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [hide v]\nhide\nstop [other scripts in sprite v]\n\n@Sprite8\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nshow\n\n@Sprite9\n\nwhen flag clicked\nset [level v] to [1]\nhide\nforever\n    if <(Level) = [1]> then\n        hide\n    end\n    if <(Level) = [2]> then\n        hide\n    end\n    if <(Level) = [3]> then\n        show\n        go to x: (-80) y: (-35)\n    end\n    if <(Level) = [4]> then\n        hide\n    end\n    if <(Level) = [5]> then\n        hide\n    end\n    if <(Level) = [6]> then\n        show\n        go to x: (55) y: (-35)\n    end\n    if <(Level) = [7]> then\n        show\n        go to x: (30) y: (-35)\n    end\n    if <(Level) = [8]> then\n        show\n        go to x: (0) y: (-35)\n    end\n    if <(Level) = [9]> then\n        show\n        go to x: (200) y: (-35)\n    end\n    if <(Level) = [10]> then\n        show\n        go to x: (-120) y: (-35)\n    end\n    if <(Level) = [11]> then\n        hide\n    end\n    if <(Level) = [12]> then\n        hide\n    end\n    if <(Level) = [13]> then\n        show\n        go to x: (75) y: (-35)\n    end\n    if <(Level) = [14]> then\n        hide\n    end\n    if <(Level) = [15]> then\n        hide\n    end\n    if <(Level) = [16]> then\n        hide\n        set [level v] to [1]\n    end\nend\n\nwhen I receive [start v]\nswitch costume to (costume1 v)\nshow\nforever\n    if <<touching (sprite v)?> or <touching (enemies v)?>> then\n        start sound [Big Boing v]\n        repeat (6)\n            next costume\n            wait (.05) seconds\n        end\n    end\nend\n\n@Sprite10\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nshow\n\n@Sprite11\n\nwhen flag clicked\ngo to [front v] layer\nset rotation style [left-right v]\npoint in direction (90)\nset [attack v] to [0]\nhide\nforever\n    if <(attack) = [0]> then\n        go to (sprite v)\n        if <(direction) = [90]> then\n            change x by (25)\n        end\n        if <(direction) = [-90]> then\n            change x by (-25)\n        end\n        if <key (space v) pressed?> then\n            broadcast (attack v)\n        end\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n            point in direction (90)\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n            point in direction (-90)\n        end\n        if <not <key (space v) pressed?>> then\n            hide\n        end\n    end\nend\n\nwhen I receive [fire v]\nswitch costume to (costume1 v)\ngo to (sprite v)\n\nwhen I receive [attack v]\nset [attack v] to [1]\nshow\nstart sound [Low Whoosh v]\nif <(direction) = [90]> then\n    if <(costume [number v]) = [1]> then\n        repeat (10)\n            change x by (15)\n        end\n    end\n    if <(costume [number v]) = [2]> then\n        repeat (25)\n            change x by (10)\n        end\n    end\n    if <(costume [number v]) = [3]> then\n        set rotation style [all around v]\n        repeat (10)\n            change x by (8)\n            turn right (36) degrees\n            change y by (5)\n        end\n        repeat (10)\n            change x by (8)\n            turn right (36) degrees\n            change y by (-5)\n        end\n        repeat (10)\n            change x by (-8)\n            turn right (36) degrees\n            change y by (5)\n        end\n        repeat (10)\n            change x by (-8)\n            turn right (36) degrees\n            change y by (-5)\n        end\n        set rotation style [left-right v]\n    end\n    if <(costume [number v]) = [4]> then\n        repeat (2)\n            change x by (40)\n        end\n        wait (.2) seconds\n    end\nend\nif <(direction) = [-90]> then\n    if <(costume [number v]) = [1]> then\n        repeat (10)\n            change x by (-15)\n        end\n    end\n    if <(costume [number v]) = [2]> then\n        repeat (20)\n            change x by (-10)\n        end\n    end\n    if <(costume [number v]) = [3]> then\n        set rotation style [all around v]\n        repeat (10)\n            change x by (-8)\n            turn right (36) degrees\n            change y by (5)\n        end\n        repeat (10)\n            change x by (-8)\n            turn right (36) degrees\n            change y by (-5)\n        end\n        repeat (10)\n            change x by (8)\n            turn right (36) degrees\n            change y by (5)\n        end\n        repeat (10)\n            change x by (8)\n            turn right (36) degrees\n            change y by (-5)\n        end\n        set rotation style [left-right v]\n    end\n    if <(costume [number v]) = [4]> then\n        repeat (2)\n            change x by (-40)\n        end\n        wait (.2) seconds\n    end\nend\nhide\nset [attack v] to [0]\n\nwhen I receive [water v]\nswitch costume to (costume2 v)\ngo to (sprite v)\n\nwhen I receive [plant baby v]\nswitch costume to (costume3 v)\ngo to (sprite v)\n\nwhen I receive [thunder boiz v]\nswitch costume to (costume4 v)\ngo to (sprite v)\n\n@Sprite12\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\ngo to [front v] layer\nswitch costume to (costume1 v)\n\nwhen I receive [start v]\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            if <(attack) = [0]> then\n                broadcast (attack v)\n            end\n        end\n    end\nend\n\nwhen I receive [-90 v]\nswitch costume to (costume1 v)\n\nwhen I receive [90 v]\nswitch costume to (costume2 v)\n\n@Enemies\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I start as a clone\nclear graphic effects\nset size to (100) %\nshow\nset [enemyx v] to [0]\nset [enemyy v] to [0]\ngo to [front v] layer\nforever\n    if <touching (sprite11 v)?> then\n        start sound [Crunch v]\n        clear graphic effects\n        set rotation style [all around v]\n        repeat (20)\n            turn right (15) degrees\n            change y by (10)\n            change [ghost v] effect by (5)\n        end\n        delete this clone\n    end\n    change [enemyy v] by (-1)\n    if <([x position v] of [sprite v]) < ((x position) - (10))> then\n        change [enemyx v] by (-.5)\n        point in direction (-90)\n    end\n    if <((x position) - (-10)) < ([x position v] of [sprite v])> then\n        change [enemyx v] by (.5)\n        point in direction (90)\n    end\n    set [enemyx v] to ((Enemyx) * (0.9))\n    change x by (Enemyx)\n    if <touching (sprite1 v)?> then\n        change y by (1)\n        if <touching (sprite1 v)?> then\n            change y by (1)\n            if <touching (sprite1 v)?> then\n                change y by (1)\n                if <touching (sprite1 v)?> then\n                    change y by (1)\n                    if <touching (sprite1 v)?> then\n                        change y by (-4)\n                        change x by ((Enemyx) * (-1))\n                        if <(y position) < ([y position v] of [sprite v])> then\n                            if <(Enemyx) > [0]> then\n                                set [enemyx v] to [-8]\n                            else\n                                set [enemyx v] to [8]\n                            end\n                            set [enemyy v] to [15]\n                        else\n                            set [enemyx v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (Enemyy)\n    if <touching (sprite1 v)?> then\n        change y by ((Enemyy) - ((Enemyy) * (2)))\n        set [enemyy v] to [0]\n    end\n    change y by (-1)\n    if <<((y position) - (-50)) < ([x position v] of [sprite v])> and <touching (level v)?>> then\n        set [enemyy v] to [15]\n    end\n    if <<key (space v) pressed?> and <touching (sprite1 v)?>> then\n        set [enemyy v] to [15]\n    end\n    change y by (1)\n    if <touching (sprite9 v)?> then\n        set [enemyy v] to [20]\n    end\nend\n\nwhen flag clicked\nhide\nset [speed2 v] to [3]\n\ndefine insert clone at x: (x) y: (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [start v]\nbroadcast (start2 v)\n\nwhen I receive [lvl start v]\nbroadcast (start2 v)\ndelete this clone\n\nwhen I receive [start2 v]\nforever\n    if <(Level) = [1]> then\n        delete this clone\n    end\n    if <(Level) = [2]> then\n        delete this clone\n    end\n    if <(Level) = [3]> then\n        delete this clone\n    end\n    if <(Level) = [4]> then\n        insert clone at x: [194] y: [-60]\n        wait until <(Level) = [5]>\n    end\n    if <(Level) = [5]> then\n        delete this clone\n    end\n    if <(Level) = [6]> then\n        insert clone at x: [194] y: [-60]\n        insert clone at x: [114] y: [124]\n        insert clone at x: [53] y: [0]\n        wait until <(Level) = [7]>\n    end\n    if <(Level) = [7]> then\n        insert clone at x: [194] y: [-60]\n        insert clone at x: [30] y: [148]\n        insert clone at x: [145] y: [117]\n        wait until <(Level) = [8]>\n    end\n    if <(Level) = [8]> then\n        insert clone at x: [194] y: [-60]\n        insert clone at x: [170] y: [-60]\n        wait until <(Level) = [9]>\n    end\n    if <(Level) = [9]> then\n        insert clone at x: [194] y: [-60]\n        insert clone at x: [133] y: [151]\n        wait until <(Level) = [10]>\n    end\n    if <(Level) = [10]> then\n        insert clone at x: [194] y: [-60]\n        wait until <(Level) = [11]>\n    end\n    if <(Level) = [11]> then\n        insert clone at x: [26] y: [157]\n        wait until <(Level) = [12]>\n    end\n    if <(Level) = [12]> then\n        insert clone at x: [204] y: [128]\n        insert clone at x: [156] y: [-24]\n        insert clone at x: [-2] y: [-54]\n        wait until <(Level) = [13]>\n    end\n    if <(Level) = [13]> then\n        insert clone at x: [-2] y: [-54]\n        insert clone at x: [158] y: [-52]\n        wait until <(Level) = [14]>\n    end\n    if <(Level) = [14]> then\n        insert clone at x: [-2] y: [-54]\n        insert clone at x: [158] y: [-52]\n        insert clone at x: [52] y: [132]\n        insert clone at x: [-186] y: [121]\n        insert clone at x: [0] y: [0]\n        wait until <(Level) = [13]>\n    end\n    if <(Level) = [15]> then\n        delete this clone\n    end\nend\n\n@Sprite13\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [start the game v]\nrepeat (10)\n    erase all\nend\n\n@intro\n\nwhen flag clicked\nset volume to (100) %\nstart sound [Super intro v]\nswitch costume to (screen shot 2020-06-03 at 11 v)\nset size to (100) %\nerase all\nhide\nset [ghost v] effect to (0)\npen up\ngo to x: (-231) y: (-240)\nset pen size to (100)\nset pen color to (#00f307)\npen down\nrepeat (3)\n    point in direction (0)\n    repeat (20)\n        move (20) steps\n    end\n    point in direction (90)\n    repeat (5)\n        move (20) steps\n    end\n    point in direction (180)\n    repeat (20)\n        move (20) steps\n    end\n    point in direction (90)\n    repeat (5)\n        move (20) steps\n    end\nend\npen up\nshow\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset size to (200) %\npoint in direction (90)\nshow\nrepeat (20)\n    change size by (-10)\n    turn right (10) degrees\nend\nrepeat (10)\n    change size by (20)\n    turn right (10) degrees\nend\npoint in direction (90)\nrepeat (10)\n    change size by (-10)\nend\nwait (.5) seconds\nrepeat (20)\n    turn right (18) degrees\n    create clone of (_myself_ v)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nerase all\nbroadcast (start the game v)\nerase all\ndelete this clone\n\nwhen flag clicked\nforever\n    set pen color to (#00f307)\n    wait (.5) seconds\n    repeat (17)\n        change pen (color v) by (-1)\n    end\n    set pen color to (#ffe900)\n    wait (.5) seconds\n    repeat (14)\n        change pen (color v) by (-1)\n    end\n    set pen color to (#ff0000)\n    wait (.5) seconds\n    repeat (32)\n        change pen (color v) by (1)\n    end\nend\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nset pen size to (100)\nset pen color to (#ffffff)\npen down\nrepeat until <touching (_edge_ v)?>\n    move (15) steps\nend\ndelete this clone\n\n