Ester in Battle - A Platformer

Instructions: Ester is now in BATTLE. Use Arrow Keys to move. Reach the end to get to the next level. Collect coins to get a bonus level at the end!\n\n\n#All#Art#Animations#Games#Stories#Platformer#Play

@Stage\n\nwhen flag clicked\nswitch backdrop to (horizon v)\n\n@Player\n\ndefine Up/Down Movement (jump height) (fall speed)\nchange y by (y/Velocity)\nif <<touching (levelsprite1 v)?> or <<touching (levelsprite2 v)?> or <touching (levelsprite3 v)?>>> then\n    TouchingLava\n    repeat ([ceiling v] of ([abs v] of (y/Velocity) ) )\n        if <<touching (levelsprite1 v)?> or <<touching (levelsprite2 v)?> or <touching (levelsprite3 v)?>>> then\n            change y by (((y/Velocity) / ([abs v] of (y/Velocity) )) * (-1))\n        end\n    end\n    if <<not <(y/Velocity) > [0]>> and <key (up arrow v) pressed?>> then\n        set [y/velocity v] to (jump height)\n    else\n        set [y/velocity v] to [0]\n    end\nelse\n    change [y/velocity v] by (fall speed)\nend\n\ndefine Right/Left Movement (move speed) (drag)\nchange x by (x/Velocity)\nif <touching (levelsprite1 v)?> then\n    TouchingLava\n    repeat ([ceiling v] of ([abs v] of (x/Velocity) ) )\n        if <touching (levelsprite1 v)?> then\n            change x by (((x/Velocity) / ([abs v] of (x/Velocity) )) * (-1))\n        end\n    end\n    set [x/velocity v] to [0]\nend\nif <key (right arrow v) pressed?> then\n    point in direction (90)\n    set [x/velocity v] to (move speed)\nelse\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        set [x/velocity v] to ((move speed) * (-1))\n    end\nend\nset [x/velocity v] to ((x/Velocity) * (drag))\n\ndefine NextLevel\nif <(x position) > [235]> then\n    broadcast (Next Level v)\n    go to x: (Spawn X) y: (Spawn Y)\nend\n\ndefine TouchingLava\nif <touching color (#ff0000)?> then\n    go to x: (Spawn X) y: (Spawn Y)\n    broadcast (Reset v)\nend\n\ndefine FallOffScreen\nif <(y position) < [-170]> then\n    go to x: (Spawn X) y: (Spawn Y)\n    broadcast (Reset v)\nend\n\nwhen I receive [start v]\nshow\nset size to (50) %\nset [spawn x v] to [-198]\nset [spawn y v] to [-92]\ngo to x: (Spawn X) y: (Spawn Y)\nset rotation style [left-right v]\nset [y/velocity v] to [0]\nset [x/velocity v] to [0]\nforever\n    switch costume to (hitbox v)\n    Up/Down Movement [12] [-1]\n    Right/Left Movement [10] [0.6]\n    switch costume to (person v)\n    NextLevel\n    FallOffScreen\nend\n\n@LevelSprite1\n\nwhen I receive [next level v]\nchange [level v] by (1)\nnext costume\n\nset [level v] to [20]\nswitch costume to (bonus level v)\nset [coins v] to [20]\nbroadcast (Bonus Addition v)\n\nchange [level v] by (0)\n\nwhen I receive [bonus addition v]\nforever\n    if <[] = [0]> then\n        broadcast (LoseXWin v)\n        switch costume to (you win v)\n        go to [front v] layer\n    end\nend\n\nswitch costume to (costume20 v)\n\nwhen flag clicked\nhide\nhide variable [coins v]\nhide variable [level v]\nforever\n    set [color v] effect to (0)\nend\n\nwhen I receive [start v]\nshow\nshow variable [coins v]\nshow variable [level v]\nset [level v] to [1]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nforever\n    if <[] = [0]> then\n        broadcast (Lose v)\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <(Level) = [21]> then\n        if <(Coins) = [20]> then\n            switch costume to (bonus level v)\n            broadcast (Bonus Level v)\n            hide variable [coins v]\n            set [level v] to [Bonus]\n            broadcast (Bonus Addition v)\n        end\n        if <not <(Coins) = [20]>> then\n            switch costume to (you win v)\n            broadcast (Bonus Level v)\n            hide variable [coins v]\n            hide variable [level v]\n        end\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <<(costume [number v]) = [22]> or <(costume [number v]) = [23]>> then\n        hide variable [coins v]\n        hide variable [level v]\n        broadcast (Win v)\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <(costume [number v]) = [22]> then\n        broadcast (Bonus Complete v)\n    end\nend\n\n@LevelSprite2\n\nwhen flag clicked\nhide\n\nwhen I receive [bonus addition v]\ngo to x: (26) y: (-20)\nshow\nforever\n    repeat (40)\n        move (6) steps\n    end\n    repeat (40)\n        move (-6) steps\n    end\nend\n\nswitch costume to (bonus level v)\n\nwhen I receive [win v]\nhide\n\n@LevelSprite3\n\nwhen flag clicked\nhide\n\nwhen I receive [bonus addition v]\ngo to x: (215) y: (-75)\nshow\nforever\n    turn right (15) degrees\nend\n\nrepeat (40)\n    move (6) steps\nend\nrepeat (40)\n    move (-6) steps\nend\n\nwhen I receive [win v]\nhide\n\n@Coin\n\nwhen I receive [next level v]\nshow\n\nwhen I receive [reset v]\n\nshow\nif <(Coins) = (Level)> then\n    change [coins v] by (-1)\nend\n\nwhen I receive [bonus level v]\nhide\n\nset [lives v] to [100]\n\nset [coins v] to [20]\n\nset [level v] to [20]\n\nwhen I receive [win v]\nhide\n\nwhen I receive [start v]\nset [coins v] to [0]\nshow\nforever\n    if <(Level) = [1]> then\n        go to x: (-5) y: (57)\n    end\n    if <(Level) = [2]> then\n        go to x: (-6) y: (47)\n    end\n    if <(Level) = [3]> then\n        go to x: (-24) y: (67)\n    end\n    if <(Level) = [4]> then\n        go to x: (-6) y: (85)\n    end\n    if <(Level) = [5]> then\n        go to x: (197) y: (155)\n    end\n    if <(Level) = [6]> then\n        go to x: (53) y: (90)\n    end\n    if <(Level) = [7]> then\n        go to x: (-210) y: (95)\n    end\n    if <(Level) = [8]> then\n        go to x: (211) y: (163)\n    end\n    if <(Level) = [9]> then\n        go to x: (156) y: (135)\n    end\n    if <(Level) = [10]> then\n        go to x: (-151) y: (63)\n    end\n    if <(Level) = [11]> then\n        go to x: (10) y: (-100)\n    end\n    if <(Level) = [12]> then\n        go to x: (-5) y: (57)\n    end\n    if <(Level) = [13]> then\n        go to x: (-66) y: (-57)\n    end\n    if <(Level) = [14]> then\n        go to x: (-114) y: (-113)\n    end\n    if <(Level) = [15]> then\n        go to x: (-203) y: (151)\n    end\n    if <(Level) = [16]> then\n        go to x: (210) y: (-12)\n    end\n    if <(Level) = [17]> then\n        go to x: (45) y: (41)\n    end\n    if <(Level) = [18]> then\n        go to x: (50) y: (15)\n    end\n    if <(Level) = [19]> then\n        go to x: (11) y: (-102)\n    end\n    if <(Level) = [20]> then\n        go to x: (-106) y: (17)\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <touching (player v)?> then\n        change [coins v] by (1)\n        hide\n    end\nend\n\n@lose\n\nwhen flag clicked\nhide\nswitch costume to (click here v)\nswitch costume to (click here v)\nswitch costume to (click here v)\nswitch costume to (click here v)\n\nwhen I receive [bonus complete v]\nshow\n\nwhen this sprite clicked\nsay [Little Birdling]\n\nswitch costume to (click here v)\n\nwhen I receive [clicked v]\nsay [His name is Hatchling]\n\n@lose2\n\nwhen flag clicked\nhide\nswitch costume to (click here v)\nswitch costume to (click here v)\nswitch costume to (click here v)\nswitch costume to (click here v)\n\nwhen I receive [bonus complete v]\nshow\n\nwhen this sprite clicked\nsay [The Code is QRFT]\n\nswitch costume to (click here v)\n\nwhen I receive [clicked v]\nsay [The Code is 3872]\n\n@Cover Page\n\nwhen flag clicked\nset [ghost v] effect to (0)\ngo to [front v] layer\nshow\n\nwhen I receive [start v]\nset [ghost v] effect to (100)\n\n@Start\n\nwhen flag clicked\ngo to x: (0) y: (-75)\nwait (0.1) seconds\ngo to [front v] layer\nshow\n\nwhen this sprite clicked\nbroadcast (Start v)\nhide\n\n