【ᴇspᴇʀ】Platformer!


@Stage\n\n@ character\n\nwhen flag clicked\nforever\n    if <touching color (#00cccc)?> then\n        if <color (#ffae00) is touching (#00cccc)?> then\n            change [yv v] by (0.07)\n        else\n            set [yv v] to ((Yv) * (0.9))\n            set [yv v] to ((Yv) * (0.9))\n            set [yv v] to ((Yv) * (0.9))\n            set [yv v] to ((Yv) * (0.9))\n            if <key (up arrow v) pressed?> then\n                set [yv v] to [4]\n            end\n        end\n        if <key (up arrow v) pressed?> then\n            change [yv v] by (0.3)\n        end\n        if <key (down arrow v) pressed?> then\n            change [yv v] by (-0.3)\n        end\n        if <key (left arrow v) pressed?> then\n            point in direction (-90)\n            change [xv v] by (-0.3)\n        end\n        if <key (right arrow v) pressed?> then\n            point in direction (90)\n            change [xv v] by (0.3)\n        end\n    end\nend\n\ngo to x: (0) y: (200)\nshow\n\nset [ghost v] effect to (100)\ngo to [front v] layer\n\nset [yv v] to [5]\n\nset [yv v] to [-1]\n\nset [yv v] to [-5]\n\nwhen I receive [next level v]\nset [yv v] to [0]\nset [xv v] to [0]\ngo to x: (-200) y: (0)\nset [ghost v] effect to (0)\n\nwhen flag clicked\ngo [backward v] (1) layers\npoint in direction (90)\nset [xvel v] to [0]\nset [yvel v] to [0]\nforever\n    set size to (100) %\n    show\n    set rotation style [all around v]\n    if <<<mouse down?> and <(x position) > (mouse x)>> or <key (left arrow v) pressed?>> then\n        change [xv v] by (-1)\n    end\n    if <<<mouse down?> and <(x position) < (mouse x)>> or <key (right arrow v) pressed?>> then\n        change [xv v] by (1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<<mouse down?> and <(y position) < (mouse y)>> or <key (up arrow v) pressed?>> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-7]\n                                else\n                                    set [xv v] to [7]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [ 0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (-1)\n    if <touching (level v)?> then\n        if <<<mouse down?> and <(y position) < (mouse y)>> or <key (up arrow v) pressed?>> then\n            set [yv v] to [14]\n        end\n    end\n    change y by (1)\n    change [yv v] by (-1)\n    set [yv v] to ((Yv) * (0.99))\n    change y by (Yv)\n    if <touching (level v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    hide variable [xv v]\n    if <(x position) > [230]> then\n        broadcast (next level v)\n    end\n    if <(y position) < [-170]> then\n        go to x: (-200) y: (0)\n    end\n    if <<touching (spikes v)?> or <<touching (level3 v)?> or <<touching (sprite3 v)?> or <touching (level6 v)?>>>> then\n        repeat (10)\n            change size by (-10)\n            turn right (5) degrees\n        end\n        set [yv v] to [0]\n        set [xv v] to [0]\n        set size to (100) %\n        set [ghost v] effect to (0)\n        go to x: (-200) y: (0)\n        point in direction (90)\n    end\n    if <touching (are  v)?> then\n        set [yv v] to [20]\n    end\n    if <touching ( move fast v)?> then\n        set [xv v] to [21]\n    end\nend\n\ngo to [front v] layer\n\nwhen flag clicked\nwait (1) seconds\ngo to x: (-200) y: (0)\n\nwhen flag clicked\nforever\n    if <<touching ( crocodile v)?> or <touching (kid! v)?>> then\n        go to x: (-200) y: (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (spikes v)?> then\n        change [yv v] by (1.3)\n    end\nend\n\nrepeat (10)\n    change size by (-10)\n    turn right (5) degrees\nend\nset [yv v] to [0]\nset [xv v] to [0]\nset size to (100) %\nset [ghost v] effect to (0)\ngo to x: (-200) y: (0)\npoint in direction (90)\n\nwhen flag clicked\n\nwhen I receive [endgame v]\nhide\n\n@level\n\nwhen I receive [endgame v]\nhide\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\ngo [forward v] (6) layers\n\nwhen I receive [next level v]\nnext costume\nchange [level v] by (1)\n\ngo [forward v] (3) layers\n\nwhen flag clicked\n\ngo to [back v] layer\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [2]> then\n        broadcast (text 2 v)\n    end\nend\n\nwhen flag clicked\nset [level v] to [0]\n\n@Sprite2\n\nwhen I receive [endgame v]\nhide\n\nturn right (36) degrees\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nwait (0.01) seconds\ndelete this clone\n\nwhen flag clicked\nhide\nforever\n    if <key (space v) pressed?> then\n        set size to (100) %\n        show\n        point in direction ([direction v] of [spikes v])\n        go to ( character v)\n        turn left (180) degrees\n        repeat (10)\n            go to ( character v)\n            turn right (12) degrees\n            create clone of (_myself_ v)\n            turn right (12) degrees\n            create clone of (_myself_ v)\n            turn right (12) degrees\n            create clone of (_myself_ v)\n        end\n        hide\n        wait (0.5) seconds\n    end\nend\n\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@level2\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [back v] layer\n\nwhen I receive [next level v]\nnext costume\n\ngo [forward v] (3) layers\n\nwhen flag clicked\nforever\n    if <touching ( character v)?> then\n        set [ghost v] effect to (25)\n    end\n    if <not <touching ( character v)?>> then\n        set [ghost v] effect to (0)\n    end\nend\n\n@Engine\n\ndefine render (text) at size (size) at x (x) y (y) bright (bright)\nset [size v] to (size)\nclear graphic effects\nswitch costume to (a v)\nset size to (size) %\nset [brightness v] effect to (bright)\ngo to x: (x) y: (y)\nset [count v] to [0]\nhide\nrepeat (length of (text))\n    if <(x position) > ((240) - ((size) * (0.2)))> then\n        set x to (x)\n        change y by ((size) * (-0.3))\n    end\n    change [count v] by (1)\n    if <<(letter (count) of (text)) = [ ]> and <not <(x) = (x position)>>> then\n        change x by ((size) * (0.07))\n    else\n        switch costume to (cs v)\n        switch costume to (letter (count) of (text))\n        if <(costume [number v]) = [90]> then\n            switch costume to (join (letter (count) of (text)) [2])\n        end\n        set [x v] to (x position)\n        set [y v] to (y position)\n        if <(length of (text)) > [300]> then\n            stamp\n        else\n            create clone of (_myself_ v)\n        end\n        change x by ((((item (costume [number v]) of [width v]) * (size)) / (100)) + ((size) * (0.017)))\n    end\nend\nhide\n\ndefine type (text) at size (size) at x (x) y (y) bright (bright)\nset [size v] to (size)\nclear graphic effects\nswitch costume to (a v)\nset size to (size) %\nset [brightness v] effect to (bright)\ngo to x: (x) y: (y)\nset [count v] to [0]\nhide\nrepeat (length of (text))\n    if <(x position) > ((240) - ((size) * (0.2)))> then\n        set x to (x)\n        change y by ((size) * (-0.3))\n    end\n    change [count v] by (1)\n    if <<(letter (count) of (text)) = [ ]> and <not <(x) = (x position)>>> then\n        change x by ((size) * (0.07))\n    else\n        switch costume to (cs v)\n        switch costume to (letter (count) of (text))\n        if <(costume [number v]) = [90]> then\n            switch costume to (join (letter (count) of (text)) [2])\n        end\n        set [x v] to (x position)\n        set [y v] to (y position)\n        if <(length of (text)) > [300]> then\n            stamp\n        else\n            create clone of (_myself_ v)\n        end\n        change x by ((((item (costume [number v]) of [width v]) * (size)) / (100)) + ((size) * (0.017)))\n    end\nend\nhide\n\nwhen I start as a clone\nshow\nforever\n    set x to ((x) + (offset x))\n    set y to ((y) + (offset y))\n    set size to ((offset size) + (size)) %\nend\n\nwhen I receive [del_clones v]\nerase all\ndelete this clone\n\nwhen flag clicked\nbroadcast (del_clones v)\nswitch backdrop to (backdrop1 v)\ntype [We, Greece at war with the mighty romans, but with the famine striking we are  at the mercy, of the 3 fates...] at size (100) at x (-220) y (145) bright (100)\nwait (2) seconds\nbroadcast (del_clones v)\ntype [Our only option to drive them off, is to use the most terrifying of weapons, feared by Zeus  him-self..] at size (100) at x (-220) y (145) bright (100)\nwait (2) seconds\nbroadcast (del_clones v)\ntype [the planespheric disk.....] at size (100) at x (-220) y (145) bright (100)\nwait (2) seconds\nbroadcast (del_clones v)\ntype [It is hidden under temple of Athena, known  for  its ingenious traps. ] at size (100) at x (-220) y (145) bright (100)\nwait (2) seconds\nbroadcast (del_clones v)\ntype [You are on your own now... The fate of our nation is in your hands. Good luck soldier!] at size (100) at x (-220) y (145) bright (100)\nwait (2) seconds\nbroadcast (del_clones v)\n\nwhen I receive [text 2 v]\n\nhide\n\nerase all\n\n@spikes\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [back v] layer\n\ngo [forward v] (2) layers\n\nwhen flag clicked\ngo to x: (29) y: (-20)\nforever\n    if <(costume [number v]) = [3]> then\n        glide (0.8) secs to x: (29) y: (50)\n        wait (0.5) seconds\n        glide (0.8) secs to x: (29) y: (13)\n    end\nend\n\nchange y by (-30)\n\nchange y by (30)\n\nwhen flag clicked\nshow\n\ngo to x: (29) y: (-20)\n\ncreate clone of (pick random (1) to (5))\nset y to (pick random (-230) to (230))\n\nwait (0.5) seconds\nglide (0.8) secs to x: (29) y: (13)\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [12]> then\n        show\n        glide (0.7) secs to x: (29) y: (-200)\n        wait (1) seconds\n        glide (1) secs to x: (29) y: (13)\n    end\nend\n\nrepeat (10)\n    change y by (-10)\nend\nwait (1) seconds\nhide\nchange y by (100)\n\nforever\n\ngo to x: (29) y: (13)\n\n@Sprite1\n\n@Sprite3\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\nset size to (100) %\npoint in direction (90)\n\nwhen flag clicked\nshow\nforever\n    if <(costume [number v]) = [6]> then\n        glide (1) secs to x: (180) y: (28)\n        wait (0.2) seconds\n        glide (1) secs to x: (36) y: (28)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (sprite2 v)?> then\n        repeat (10)\n            change size by (-10)\n            turn right (5) degrees\n        end\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [7]> then\n        show\n        glide (1) secs to x: (180) y: (210)\n        wait (0.5) seconds\n        glide (1) secs to x: (120) y: (210)\n    end\nend\n\ngo to x: (112) y: (28)\n\nwhen I start as a clone\n\ncreate clone of (_myself_ v)\n\nchange y by (10)\n\nchange y by (-50)\n\nmove (-10) steps\nchange x by (-20)\n\nmove (10) steps\nchange x by (20)\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [8]> then\n        show\n        glide (1) secs to x: (120) y: (180)\n        wait (0.5) seconds\n        glide (1) secs to x: (190) y: (180)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [8]> then\n        if <touching (sprite2 v)?> then\n            broadcast (ninjA v)\n        end\n    end\nend\n\nshow\nglide (1) secs to x: (120) y: (180)\nwait (0.5) seconds\nglide (1) secs to x: (190) y: (180)\n\n@level3\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\ngo to [back v] layer\n\nwhen I receive [next level v]\nnext costume\n\ngo [forward v] (3) layers\n\nwhen flag clicked\nforever\n    go to (sprite3 v)\nend\n\nif <touching ( character v)?> then\n    set [ghost v] effect to (25)\nend\nif <not <touching ( character v)?>> then\n    set [ghost v] effect to (0)\nend\n\nwhen flag clicked\n\nwhen I receive [ninja v]\nhide\n\n@level4\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [back v] layer\n\nwhen I receive [next level v]\nnext costume\n\ngo [forward v] (3) layers\n\nwhen flag clicked\n\nforever\n    go to (sprite3 v)\nend\n\nif <touching ( character v)?> then\n    set [ghost v] effect to (25)\nend\nif <not <touching ( character v)?>> then\n    set [ghost v] effect to (0)\nend\n\nwhen flag clicked\n\n@level5\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [back v] layer\n\nwhen I receive [next level v]\nnext costume\n\ngo [forward v] (3) layers\n\nwhen flag clicked\nforever\n    if <touching ( character v)?> then\n        change [ghost v] effect by (100)\n    end\n    if <not <touching ( character v)?>> then\n        set [ghost v] effect to (0)\n    end\nend\n\nset [ghost v] effect to (100)\n\nforever\n    go to (sprite3 v)\nend\n\nwhen flag clicked\n\n@level6\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [back v] layer\n\nwhen I receive [next level v]\nnext costume\n\ngo [forward v] (3) layers\n\nwhen flag clicked\nforever\n    if <touching ( character v)?> then\n        repeat (4)\n            change [ghost v] effect by (-25)\n        end\n    end\n    if <not <touching ( character v)?>> then\n        set [ghost v] effect to (100)\n    end\nend\n\nset [ghost v] effect to (25)\n\nforever\n    go to (sprite3 v)\nend\n\nwhen flag clicked\n\n@Sprite4\n\nwhen flag clicked\nset [i v] to [0]\nforever\n    set y to ((28) + (([sin v] of ((i) * (7.5)) ) * (7.5)))\n    change [i v] by (1)\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nforever\n    if <touching ( character v)?> then\n        broadcast (endgame v)\n    end\nend\n\n@Sprite5\n\nwhen flag clicked\nhide\n\nwhen I receive [endgame v]\ngo to [front v] layer\nshow\n\n@Sprite6\n\nwhen flag clicked\nforever\n    if <<(Level) = [15]> and <(timer) < (☁ cloud timer)>> then\n        set [☁ cloud timer v] to (timer)\n    end\nend\n\n@thumbnail\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n