Le Monke // A Platformer #games
@Stage\n\nwhen flag clicked\nforever\n    play sound [Upside down curious george instrumental v] until done\nend\n\n@Player\n\nwhen flag clicked\nshow\ngo to x: (-191) y: (121)\nset rotation style [left-right v]\nset [y vel v] to [0]\nset [frame v] to [0]\nset [frames per costume v] to [2]\nhide variable [level v]\nset [level v] to [1]\nbroadcast (_INIT sword v)\nforever\n    broadcast (delete objects v) and wait\n    broadcast (next level v) and wait\n    repeat until <(x position) > [230]>\n        switch costume to (hitbox v)\n        if <key (right arrow v) pressed?> then\n            point in direction (90)\n            walk [6]\n        end\n        if <key (left arrow v) pressed?> then\n            point in direction (-90)\n            walk [-6]\n        end\n        if <<not <key (left arrow v) pressed?>> and <not <key (right arrow v) pressed?>>> then\n            set [frame v] to [0]\n        end\n        if <<key (up arrow v) pressed?> and <(In air) < [8]>> then\n            set [y vel v] to [12]\n        end\n        change [y vel v] by (-2)\n        change y by (Y vel)\n        change [in air v] by (1)\n        Handle Ground <(Y vel) > [0]>\n        if <(y position) < [-170]> then\n            go to x: (-186) y: (137)\n            set [y vel v] to [-1]\n        end\n        if <<touching (spikes v)?> or <touching (enemy v)?>> then\n            go to x: (-186) y: (137)\n            set [y vel v] to [-1]\n        end\n        Set correct costume\n        if <touching (banana v)?> then\n            broadcast (Collect v)\n        end\n    end\n    set x to (-230)\n    change [level v] by (1)\nend\n\ndefine Handle Ground <moving up>\nrepeat until <not <touching (ground v)?>>\n    if <moving up> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [in air v] to [0]\n    end\n    set [y vel v] to [0]\nend\n\ndefine walk (steps)\nchange x by (steps)\nset [ground lift v] to [0]\nrepeat until <<not <touching (ground v)?>> or <(Ground lift) = [8]>>\n    change y by (1)\n    change [ground lift v] by (1)\nend\nif <(Ground lift) = [8]> then\n    change x by ((-1) * (steps))\n    change y by (-8)\nend\nchange [frame v] by ((1) / (Frames per costume))\n\ndefine Set correct costume\nif <(In air) < [3]> then\n    if <(Frame) = [0]> then\n        switch costume to (stand v)\n    else\n        switch costume to ([floor v] of ((2) + ((Frame) mod (8))) )\n    end\nelse\n    if <(Y vel) > [0]> then\n        switch costume to (jump v)\n    else\n        switch costume to (fall v)\n    end\nend\n\n@Ground\n\nwhen I receive [next level v]\nswitch costume to (LEVEL)\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nif <(costume [number v]) = [3]> then\n    broadcast (Bananas v)\nend\n\n@Banana\n\nwhen I receive [next level v]\nset size to (80) %\nif <(LEVEL) = [1]> then\n    Banana at X [-180] Y [36]\n    Banana at X [-139] Y [36]\n    Banana at X [-94] Y [36]\n    Banana at X [-57] Y [36]\n    Banana at X [-22] Y [36]\n    Banana at X [-180] Y [-75]\n    Banana at X [-139] Y [-75]\n    Banana at X [-94] Y [-75]\n    Banana at X [-57] Y [-75]\n    Banana at X [-22] Y [-75]\nend\nif <(LEVEL) = [2]> then\n    Banana at X [51] Y [50]\n    Banana at X [181] Y [50]\nend\nif <(LEVEL) = [3]> then\n    Banana at X [-49] Y [12]\nend\nif <(LEVEL) = [10]> then\n    Banana at X [50] Y [65]\nend\nif <(LEVEL) = [12]> then\n    Banana at X [-15] Y [23]\n    Banana at X [50] Y [23]\nend\nif <(LEVEL) = [13]> then\n    Banana at X [71] Y [83]\n    Banana at X [154] Y [83]\nend\n\nwhen I start as a clone\nset [y v] to (y position)\nshow\nrepeat until <touching (player v)?>\n    set y to ((y) + (([sin v] of (((timer) + (x position)) * (140)) ) * (7)))\nend\ndelete this clone\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\n\nwhen I receive [delete objects v]\ndelete this clone\n\ndefine Banana at X (x) Y (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nbroadcast (next level v) and wait\n\n@Enemy\n\ndefine Enemy X and Y (x) (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [next level v]\nset size to (54) %\nif <(LEVEL) = [3]> then\n    Enemy X and Y [71] [49]\nend\nif <(LEVEL) = [5]> then\n    Enemy X and Y [-108] [-89]\n    Enemy X and Y [-59] [-89]\n    Enemy X and Y [-13] [-89]\n    Enemy X and Y [0] [-89]\nend\nif <(LEVEL) = [7]> then\n    Enemy X and Y [-32] [-117]\nend\nif <(LEVEL) = [8]> then\n    Enemy X and Y [66] [15]\nend\nif <(LEVEL) = [11]> then\n    Enemy X and Y [-164] [-120]\n    Enemy X and Y [121] [-120]\n    Enemy X and Y [158] [-120]\n    Enemy X and Y [-111] [-120]\n    Enemy X and Y [130] [-14]\nend\nif <(LEVEL) = [13]> then\n    Enemy X and Y [-60] [-64]\n    Enemy X and Y [121] [-64]\nend\n\nwhen flag clicked\nhide\ngo to [front v] layer\nswitch costume to (costume1 v)\n\nwhen I start as a clone\nshow\nforever\n    repeat (14)\n        change x by (4)\n    end\n    repeat (14)\n        change x by (-4)\n    end\nend\n\nwhen I receive [delete objects v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <<touching (sword v)?> and <(STAB) > [0]>> then\n        delete this clone\n    end\nend\n\n@Spikes\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nswitch costume to (LEVEL)\n\n@Tiles\n\n@Sword\n\nwhen I receive [_init sword v]\nswitch costume to (held v)\nset rotation style [left-right v]\nhide\nset [status v] to [0]\nset [stab v] to [0]\nwait until <(LEVEL) = [4]>\nrepeat until <touching (player v)?>\n    show\n    go to x: (23) y: (36)\n    set y to ((y) + (([sin v] of (((timer) + (x position)) * (140)) ) * (7)))\n    if <(LEVEL) > [4]> then\n        hide\n        stop [this script v]\n    end\nend\nforever\n    switch costume to (held v)\n    set [direction v] to (([direction v] of [player v]) / ([abs v] of ([direction v] of [player v]) ))\n    set [stab v] to [0]\n    Position\n    if <key (space v) pressed?> then\n        switch costume to (stab v)\n        repeat (5)\n            change [stab v] by (6)\n            Position\n        end\n        repeat (5)\n            change [stab v] by (-6)\n            Position\n        end\n    end\nend\n\ndefine Position\ngo to x: ((([x position v] of [player v]) + ((12) * (direction))) + ((STAB) * (direction))) y: ([y position v] of [player v])\npoint in direction ([direction v] of [player v])\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n