The Badlands - Scrolling Platformer

Instructions: Arrow keys/WASD/Mobile to move\nSpace or punch button to punch\nAvoid spikes, saws, lava, and enemies\nBounce on bouncies\nAvoid the boss' attacks to defeat him\nGo to the portal to complete the levels\nThat's it :P\nIf you can't read then click to close the banner thingy before each level

@Stage\n\nwhen I receive [start v]\nplay sound [TheFatRat - Xenogenesis v] until done\n\n@banner\n\nwhen flag clicked\nset [done reset v] to [0]\ngo to x: (0) y: (0)\nhide\nclear graphic effects\nforever\n    go to [front v] layer\n    if <(LEVEL) = [1]> then\n        switch costume to (costume1 v)\n    end\n    if <(LEVEL) = [2]> then\n        switch costume to (costume2 v)\n    end\n    if <(LEVEL) = [3]> then\n        switch costume to (costume3 v)\n    end\n    if <(LEVEL) = [4]> then\n        switch costume to (costume4 v)\n    end\nend\n\nwhen I receive [reset v]\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait until <mouse down?>\nset [done reset v] to [1]\n\nwhen I receive [setup v]\nset [done reset v] to [0]\nhide\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@bounce\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\ngo to [back v] layer\n\nwhen I receive [green flag v]\nhide\ngo to [back v] layer\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [482] y: [0]\n            Clone at x: [482] y: [0]\n            Clone at x: [0] y: [400]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n            end\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\nhide\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [start fr v]\nforever\n    if <(Level) = [4]> then\n        switch costume to (level 4 1 v)\n        hide\n        delete this clone\n    end\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@deco\n\nwhen I receive [tick v]\nif <(costume [number v]) = [3]> then\n    position ((x) - (SCROLL X)) (((([sin v] of ((timer) * (100)) ) * (100)) + (y)) - (SCROLL Y))\nelse\n    if <<(costume [number v]) = [7]> or <(costume [number v]) = [10]>> then\n        position (((([sin v] of ((timer) * (80)) ) * (175)) + (x)) - (SCROLL X)) ((y) - (SCROLL Y))\n    else\n        position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\ngo to [back v] layer\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\ngo to [back v] layer\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [482] y: [0]\n    Clone at x: [-482] y: [130]\n    Clone at x: [0] y: [70]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [482] y: [0]\n            Clone at x: [482] y: [0]\n            Clone at x: [482] y: [0]\n            Clone at x: [-482] y: [400]\n        else\n            if <(LEVEL) = [4]> then\n                go to x: (0) y: (0)\n                switch costume to (level 4 1 v)\n                show\n            end\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\nhide\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [start fr v]\nforever\n    if <(LEVEL) = [4]> then\n        go to x: (0) y: (0)\n        switch costume to (level 4 1 v)\n        show\n    end\nend\n\nset [level v] to [4]\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@Intro\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    point in direction (90)\n    set size to (0) %\n    show\n    set [ghost v] effect to (100)\n    repeat (35)\n        change size by (((100) - (size)) / (5))\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    point in direction (90)\n    set size to (0) %\n    show\n    set [brightness v] effect to (0)\n    repeat (35)\n        change size by (((100) - (size)) / (5))\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [3]> then\n    point in direction (90)\n    set size to (100) %\n    show\n    set [brightness v] effect to (0)\n    set y to (1000)\n    show\n    repeat (30)\n        change y by (((0) - (y position)) / (5))\n    end\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [Logo\(pt 1\)]> then\n    point in direction (90)\n    set size to (0) %\n    show\n    set [brightness v] effect to (0)\n    set y to (0)\n    go to x: (0) y: (0)\n    show\n    repeat (30)\n        change size by (((100) - (size)) / (5))\n    end\n    wait until <(___Intro) = [3]>\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [Logo pt 3]> then\n    point in direction (90)\n    set size to (0) %\n    show\n    set [brightness v] effect to (0)\n    set y to (0)\n    go to x: (-100) y: (0)\n    show\n    repeat (30)\n        change x by (((0) - (x position)) / (5))\n        set y to (0)\n        change size by (((100) - (size)) / (5))\n    end\n    wait (1) seconds\n    set [___intro v] to [3]\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [Logo\(pt 2\)]> then\n    point in direction (90)\n    set size to (0) %\n    show\n    set [brightness v] effect to (0)\n    set y to (0)\n    go to x: (100) y: (0)\n    show\n    repeat (30)\n        change x by (((0) - (x position)) / (5))\n        change size by (((100) - (size)) / (5))\n    end\n    wait (1) seconds\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [Logo]> then\n    point in direction (90)\n    set size to (100) %\n    show\n    set [brightness v] effect to (0)\n    set y to (0)\n    go to x: (0) y: (0)\n    show\n    wait (0.2) seconds\n    repeat (30)\n        change y by (((50) - (y position)) / (5))\n        point in direction ((90) + ((6) * ([tan v] of ((timer) * (100)) )))\n        change size by (((80) - (size)) / (5))\n    end\n    repeat until <(___Intro) = [5]>\n        point in direction ((90) + ((6) * ([tan v] of ((timer) * (100)) )))\n    end\n    repeat (10)\n        change y by (((-180) - (y position)) / (4))\n        change size by (((20) - (size)) / (5))\n        change [ghost v] effect by (10)\n        turn right ((join [-] ((direction) / (3))) / (10)) degrees\n    end\nend\n\nwhen I start as a clone\nif <<(costume [number v]) > [7]> and <[19] > (costume [number v])>> then\n    show\n    set size to (0) %\n    point in direction (90)\n    repeat (30)\n        turn right (((90) - (direction)) / (5)) degrees\n        change y by (((-120) - (y position)) / (5))\n        change size by (((130) - (size)) / (5))\n        change x by (((x) - (x position)) / (5))\n    end\n    wait (2) seconds\n    repeat (30)\n        turn right (((90) - (direction)) / (5)) degrees\n        change y by (((180) - (y position)) / (5))\n        change size by (((100) - (size)) / (5))\n        change [ghost v] effect by (10)\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [19]> then\n    go to [front v] layer\n    point in direction (pick random (-180) to (180))\n    set size to (pick random (75) to (150)) %\n    go to x: (0) y: (0)\n    set [brightness v] effect to (pick random (-30) to (50))\n    set [ghost v] effect to (pick random (0) to (40))\n    set [i v] to (pick random (5) to (9))\n    set [v v] to (pick random (10) to (12))\n    show\n    repeat until <touching (_edge_ v)?>\n        change y by (i)\n        move (v) steps\n        set [v v] to ((v) * (0.95))\n        change [i v] by (-0.4)\n    end\n    delete this clone\nend\n\ndefine Particles\nhide\nswitch costume to (particle  v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(costume [name v]) = [Background]> then\n    point in direction (90)\n    show\n    set [ghost v] effect to (100)\n    set y to (0)\n    go to x: (0) y: (0)\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I start as a clone\nif <<(costume [number v]) > [7]> and <[19] > (costume [number v])>> then\n    wait (4) seconds\n    set [___intro v] to [5]\nend\n\nwhen I start as a clone\nif <<(costume [name v]) = [end3]> or <<(costume [name v]) = [end1]> or <(costume [name v]) = [end2]>>> then\n    point in direction (90)\n    set size to (100) %\n    show\n    set [brightness v] effect to (0)\n    set y to (0)\n    go to x: (-5000) y: (0)\n    repeat until <(x position) = [0]>\n        change x by (((0) - (x position)) / (5))\n    end\nend\n\nwhen I start as a clone\nif <<(costume [name v]) = [end3]> or <<(costume [name v]) = [end1]> or <(costume [name v]) = [end2]>>> then\n    point in direction (90)\n    set size to (100) %\n    show\n    set [brightness v] effect to (0)\n    set y to (0)\n    go to x: (-5000) y: (0)\n    repeat until <(x position) = [0]>\n        change x by (((0) - (x position)) / (5))\n    end\nend\n\nwhen flag clicked\nstart sound [Ping! v]\n\nwhen I receive [start v]\nstop all sounds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nset size to (100) %\ngo to x: (0) y: (0)\nswitch costume to (costume2 v)\npoint in direction (90)\nclear graphic effects\nset size to (100) %\nhide\nset [___intro v] to [1]\ngo to x: (200) y: (0)\nrepeat (6)\n    switch costume to (filter back v)\n    create clone of (_myself_ v)\n    change x by (-80)\n    wait (0.05) seconds\nend\ngo to x: (-200) y: (0)\nrepeat (6)\n    switch costume to (filter blue v)\n    create clone of (_myself_ v)\n    change x by (80)\n    wait (0.05) seconds\nend\ngo to x: (200) y: (0)\nrepeat (6)\n    switch costume to (filter white v)\n    create clone of (_myself_ v)\n    change x by (-80)\n    wait (0.05) seconds\nend\nset [___intro v] to [2]\nswitch costume to (background v)\ncreate clone of (_myself_ v)\nParticles\nswitch costume to (logo\(pt 1\) v)\ncreate clone of (_myself_ v)\nswitch costume to (logo pt 3 v)\ncreate clone of (_myself_ v)\nswitch costume to (logo\(pt 2\) v)\ncreate clone of (_myself_ v)\nwait (2) seconds\nswitch costume to (logo v)\ncreate clone of (_myself_ v)\nswitch costume to (letter s v)\nset [___intro v] to [4]\nset [x v] to [-140]\nrepeat (11)\n    create clone of (_myself_ v)\n    next costume\n    change [x v] by (35)\n    wait (0.05) seconds\nend\nwait (3) seconds\nswitch costume to (end2 v)\nrepeat (3)\n    create clone of (_myself_ v)\n    next costume\nend\nwait (1) seconds\nbroadcast (start v)\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@Player\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nDie?\nrepeat until <not <<touching (platforms v)?> or <touching (danger v)?>>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nDie?\nif <<touching (platforms v)?> or <touching (danger v)?>> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <<touching (platforms v)?> or <touching (danger v)?>>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <<touching (platforms v)?> or <touching (danger v)?>>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Tick\nif <key (space v) pressed?> then\n    broadcast (punch v)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    if <(direction) = [90]> then\n        broadcast (direction change v)\n    end\n    point in direction (-90)\n    change [sx v] by (-2)\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    if <(direction) = [-90]> then\n        broadcast (direction change v)\n    end\n    point in direction (90)\n    change [sx v] by (2)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n    if <[4] > (in air)> then\n        set [sy v] to [16]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-1.5)\nend\nChange Player y by (sy)\nset [scroll x v] to (x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\nif <touching (bounce v)?> then\n    start sound [Big Boing v]\n    set [sy v] to [30]\nend\n\nwhen flag clicked\nset [skip? v] to [0]\nset rotation style [left-right v]\nbroadcast (green flag v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\ngo [backward v] (10) layers\n\nwhen I receive [playgame v]\nset [level v] to [1]\nforever\n    broadcast (reset v)\n    if <(dead?) = [1]> then\n        set [dead? v] to [0]\n        set [done reset v] to [1]\n    end\n    wait until <(done reset) = [1]>\n    broadcast (setup v) and wait\n    Game on\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (tick v) and wait\n    end\n    if <(EXIT) = [win]> then\n        win\n    else\n        die\n    end\nend\n\ndefine Game on\nset [sx v] to [0]\nset [sy v] to [0]\nset [x v] to [-150]\nset [y v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [scroll y v] to [0]\nset [scroll x v] to [0]\npoint in direction (90)\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\ndefine win\nif <(Skip?) = [1]> then\n    hide\n    change [level v] by (1)\nelse\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    hide\n    change [level v] by (1)\nend\n\ndefine die\nset [dead? v] to [1]\nset [exit v] to []\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nwait (.5) seconds\nset [exit v] to []\n\ndefine Die?\nif <<touching (danger v)?> or <touching (spike 4 boss fite v)?>> then\n    start sound [Crunch v]\n    set [exit v] to [die]\nend\n\nwhen I receive [start fr v]\nbroadcast (playgame v) and wait\n\nwhen I receive [reset v]\nhide\nwait (.5) seconds\n\nwhen I receive [start fr v]\nforever\n    if <(LEVEL) = [4]> then\n        broadcast (boss fight v)\n        forever\n            stop [other scripts in sprite v]\n            hide\n        end\n    end\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@portal\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\nif <touching (player v)?> then\n    set [exit v] to [win]\nend\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [0] y: [482]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [500] y: [0]\n            Clone at x: [500] y: [0]\n            Clone at x: [80] y: [300]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n            end\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [start fr v]\nforever\n    if <(Level) = [4]> then\n        hide\n    end\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@Platforms\n\nwhen I receive [tick v]\nif <(costume [number v]) = [3]> then\n    position ((x) - (SCROLL X)) (((([sin v] of ((timer) * (100)) ) * (100)) + (y)) - (SCROLL Y))\nelse\n    if <<(costume [number v]) = [7]> or <(costume [number v]) = [10]>> then\n        position (((([sin v] of ((timer) * (80)) ) * (175)) + (x)) - (SCROLL X)) ((y) - (SCROLL Y))\n    else\n        position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [482] y: [0]\n    Clone at x: [-482] y: [130]\n    Clone at x: [0] y: [70]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [482] y: [0]\n            Clone at x: [482] y: [0]\n            Clone at x: [0] y: [400]\n        else\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\nhide\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [start fr v]\nforever\n    if <(LEVEL) = [4]> then\n        go to x: (0) y: (0)\n        switch costume to (level 4 1 v)\n        show\n    end\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@danger\n\nwhen I receive [tick v]\nif <<<(costume [number v]) = [1]> or <(costume [number v]) = [3]>> or <<(costume [number v]) = [4]> or <<(costume [number v]) = [6]> or <<<(costume [number v]) = [8]> or <(costume [number v]) = [9]>> or <<(costume [number v]) = [10]> or <(costume [number v]) = [11]>>>>>> then\n    point in direction (90)\n    position ((x) - (SCROLL X)) (((([sin v] of ((timer) * (100)) ) * (10)) + (y)) - (SCROLL Y))\nelse\n    if <<(costume [number v]) = [5]> or <(costume [number v]) = [12]>> then\n        turn right (8) degrees\n        position (((([sin v] of ((timer) * (150)) ) * (150)) + (x)) - (SCROLL X)) ((y) - (SCROLL Y))\n    else\n        if <<(costume [number v]) = [7]> or <(costume [number v]) = [14]>> then\n            point in direction (90)\n            position (((([sin v] of ((timer) * (120)) ) * (120)) + (x)) - (SCROLL X)) ((y) - (SCROLL Y))\n            if <touching (fist v)?> then\n                delete this clone\n            end\n        else\n            point in direction (90)\n            position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\ngo to [back v] layer\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [482] y: [0]\n    Clone at x: [482] y: [0]\n    Clone at x: [482] y: [0]\n    Clone at x: [-1475] y: [425]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [500] y: [-5]\n        Clone at x: [482] y: [5]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [482] y: [0]\n        Clone at x: [330] y: [-70]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [690] y: [-45]\n            Clone at x: [274] y: [45]\n            Clone at x: [0] y: [400]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n            end\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\nhide\npoint in direction (90)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [start fr v]\nforever\n    if <(Level) = [4]> then\n        hide\n    end\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@blank\n\n@boss fight\n\nwhen flag clicked\nset [level v] to [1]\nset [boss defeated? v] to [0]\nhide\n\nwhen I receive [setup v]\nif <(LEVEL) = [4]> then\n    repeat until <(boss defeated?) = [1]>\n        wait (pick random (1) to (2)) seconds\n        set [attack v] to (pick random (1) to (2))\n        if <(attack) = [1]> then\n            broadcast (spike v)\n        end\n        if <(attack) = [2]> then\n            broadcast (GIVE BIRTH v)\n        end\n    end\n    broadcast (win v)\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\n    repeat (25)\n        change [ghost v] effect by (-4)\n        go to x: (pick random (-10) to (10)) y: (pick random (-10) to (10))\n    end\n    go to x: (0) y: (0)\n    forever\n        set y to (([sin v] of ((timer) * (100)) ) * (10))\n    end\nend\n\nwhen I receive [reset v]\nset [boss defeated? v] to [0]\n\n@spike 4 boss fite\n\nwhen flag clicked\nhide\n\nwhen I receive [spike v]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset y to (90)\nset x to (([x position v] of [player2 v]) + (pick random (-30) to (30)))\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nrepeat until <<touching (player2 v)?> or <touching (platforms v)?>>\n    change y by (-8)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@GIVE BIRTH\n\nwhen flag clicked\nhide\n\nwhen I receive [give birth v]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to x: (0) y: (7)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nglide (1) secs to x: (0) y: (-64)\nif <([x position v] of [player2 v]) > [0]> then\n    repeat until <<touching (player2 v)?> or <touching (_edge_ v)?>>\n        change x by (6)\n    end\nelse\n    repeat until <<touching (player2 v)?> or <touching (_edge_ v)?>>\n        change x by (-6)\n    end\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@boss fight timer\n\nwhen flag clicked\nhide\nhide variable [timer v]\n\nwhen I receive [setup v]\nif <(LEVEL) = [4]> then\n    repeat until <(timer) = [0]>\n        wait (1) seconds\n        change [timer v] by (-1)\n    end\n    set [boss defeated? v] to [1]\nend\n\nwhen I receive [reset v]\nset [timer v] to [15]\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@tumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (100)\nswitch costume to (costume3 v)\nforever\n    go to [front v] layer\nend\n\n@menu\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nshow\nswitch costume to (costume1 v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (costume2 v)\ngo to x: (0) y: (-250)\nshow\ngo to [front v] layer\nset [ghost v] effect to (100)\nset [velocity v] to [11]\nrepeat until <(velocity) < [.1]>\n    change y by (velocity)\n    change [ghost v] effect by (-10)\n    set [velocity v] to ((velocity) * (.9))\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) = [120]>\n            change size by (5)\n        end\n        if <mouse down?> then\n            broadcast (start fr v)\n            delete this clone\n        end\n    else\n        repeat until <(size) = [100]>\n            change size by (-5)\n        end\n    end\nend\n\nwhen I receive [start fr v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen flag clicked\nhide\ndelete this clone\n\n@Player2\n\nwhen I receive [start fr v]\ngo to x: (-180) y: (0)\nclear graphic effects\nset rotation style [left-right v]\npoint in direction (90)\nforever\n    if <(LEVEL) = [4]> then\n        show\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 (platforms v)?> then\n            change x by ((Xv) * (-1))\n            change y by (-5)\n        end\n        change [yv v] by (-1)\n        change y by (Yv)\n        if <touching (platforms v)?> then\n            change y by ((Yv) * (-1))\n            set [yv v] to [0]\n        end\n        change y by (-1)\n        if <touching (platforms 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 (spike 4 boss fite v)?> or <touching (give birth v)?>> then\n            broadcast (reset v)\n            broadcast (setup v)\n        end\n    end\nend\n\nwhen I receive [boss fight v]\nbroadcast (reset v)\nwait until <(done reset) = [1]>\nbroadcast (setup v)\n\nwhen flag clicked\nhide\n\nwhen I receive [reset v]\nbroadcast (red screen v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ngo to x: (-180) y: (0)\nclear graphic effects\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\n\n@red screen\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [red screen v]\nshow\nset [ghost v] effect to (100)\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@fist\n\nwhen flag clicked\nhide\n\nwhen I receive [punch v]\nshow\ngo to (player v)\nwait until <not <key (space v) pressed?>>\nif <([direction v] of [player v]) = [90]> then\n    repeat (5)\n        change x by (10)\n    end\nend\nif <([direction v] of [player v]) = [-90]> then\n    repeat (5)\n        change x by (-10)\n    end\nend\nwait (.5) seconds\nhide\n\nwhen I receive [boss fight v]\nhide\nstop [other scripts in sprite v]\n\n@punch button\n\nwhen flag clicked\nhide\n\nwhen I receive [start fr v]\nshow\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        broadcast (punch v)\n    end\nend\n\nwhen I receive [boss fight v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [direction change v]\nif <([direction v] of [player v]) = [90]> then\n    switch costume to (costume1 v)\nelse\n    switch costume to (costume2 v)\nend\n\nwhen I receive [reset v]\nswitch costume to (costume1 v)\n\n