The Avengers, A Platformer.
@Stage\n\nwhen I receive [load save code v]\nask [Uploading or saving? type u to upload and s to save \(type something else to exit\)] and wait\nif <<(answer) = [u]> or <(answer) = [s]>> then\n    if <(answer) = [u]> then\n        ask [Please paste code in:] and wait\n        reset letters\n        cleared to pass (answer)\n        Analyze (answer) <not <(item (1) of [illegal save letters v]) = [bad save]>>\n    else\n        create save code\n        wait until <key (space v) pressed?>\n        show list [your save code, triple click it and press ctrl+c to copy it. \(press space to hide\) v]\n    end\nend\n\ndefine Analyze (code) <code?>\nif <code?> then\n    delete all of [save components v]\n    repeat (12)\n        add [0] to [save components v]\n    end\n    set [analyze1 v] to [1]\n    repeat until <not <(letter (analyze1) of (code)) = [1]>>\n        replace item (1) of [save components v] with ((item (1) of [save components v]) + (1))\n        change [analyze1 v] by (1)\n    end\n    change [analyze1 v] by (1)\n    repeat until <not <(letter (analyze1) of (code)) = [1]>>\n        replace item (2) of [save components v] with ((item (2) of [save components v]) + (1))\n        change [analyze1 v] by (1)\n    end\n    change [analyze1 v] by (1)\n    set [analyze2 v] to [3]\n    repeat (10)\n        if <(letter (analyze1) of (code)) = [1]> then\n            replace item (analyze2) of [save components v] with [1]\n        else\n            replace item (analyze2) of [save components v] with [0]\n        end\n        change [analyze1 v] by (1)\n        change [analyze2 v] by (1)\n    end\n    set [chapters unlocked v] to (item (1) of [save components v])\n    delete all of [levels unlocked per chapter v]\n    repeat ((item (1) of [save components v]) - (1))\n        add [5] to [levels unlocked per chapter v]\n    end\n    add (item (2) of [save components v]) to [levels unlocked per chapter v]\n    repeat (10)\n        add [0] to [levels unlocked per chapter v]\n    end\n    set [analyze1 v] to [1]\n    repeat (10)\n        replace item (analyze1) of [achievements v] with (letter ((((item (1) of [save components v]) + (item (2) of [save components v])) + (2)) + (analyze1)) of (code))\n        change [analyze1 v] by (1)\n    end\n    set [boss unlocked? v] to (letter (length of (code)) of (code))\nend\n\nwhen flag clicked\nset [3 v] to [1]\nreset letters\n\ndefine reset letters\nset [letters v] to [ ◻abcdefghijklmnopqrstuvwxyz23456789!@#$%^&*\(\)-+=_\[\]"'./?:,ABCDEFGHIJKLMNOPQRSTUVWXYZ<>¬\;]\ndelete all of [illegal save letters v]\nset [analyze1 v] to [1]\nrepeat (length of (letters))\n    add (letter (analyze1) of (letters)) to [illegal save letters v]\n    change [analyze1 v] by (1)\nend\n\ndefine cleared to pass (hmm)\nset [analyze1 v] to [1]\nrepeat (length of (hmm))\n    if <[illegal save letters v] contains (letter (analyze1) of (hmm))?> then\n        replace item (1) of [illegal save letters v] with [bad save]\n    end\n    change [analyze1 v] by (1)\nend\n\ndefine create save code\nhide variable [save code v]\nset [save code v] to []\nrepeat (chapters unlocked)\n    set [save code v] to (join (save code) [1])\nend\nset [save code v] to (join (save code) [0])\nrepeat (item (chapters unlocked) of [levels unlocked per chapter v])\n    set [save code v] to (join (save code) [1])\nend\nset [save code v] to (join (save code) [0])\nset [analyze1 v] to [1]\nrepeat (10)\n    set [save code v] to (join (save code) (item (analyze1) of [achievements v]))\n    change [analyze1 v] by (1)\nend\nif <(boss unlocked?) = [1]> then\n    set [save code v] to (join (save code) [1])\nelse\n    set [save code v] to (join (save code) [0])\nend\ndelete all of [your save code, triple click it and press ctrl+c to copy it. \(press space to hide\) v]\nadd (save code) to [your save code, triple click it and press ctrl+c to copy it. \(press space to hide\) v]\nhide list [your save code, triple click it and press ctrl+c to copy it. \(press space to hide\) v]\n\nwhen I receive [start v]\nif <(3) = [1]> then\n    set [3 v] to [0]\n    broadcast (3 v)\nend\n\nwhen I receive [3 v]\nforever\n    play sound [The Avengers Theme Song v] until done\n    play sound [Alan Silvestri - Portals \(From Avengers Endgame Audio Only\) v] until done\nend\n\nwhen I receive [start v]\nshow list [your save code, triple click it and press ctrl+c to copy it. \(press space to hide\) v]\n\nwhen I receive [menu v]\nshow list [your save code, triple click it and press ctrl+c to copy it. \(press space to hide\) v]\n\nwhen flag clicked\nshow list [your save code, triple click it and press ctrl+c to copy it. \(press space to hide\) v]\n\n@Intro1\n\nwhen flag clicked\npoint in direction (90)\nrepeat (12)\n    turn left (30) degrees\nend\n\nwhen flag clicked\ngo to x: (223) y: (0)\nrepeat (12)\n    glide (.3) secs to x: (0) y: (0)\nend\n\nwhen flag clicked\nset [times dead v] to [0]\nset [levels passed without death v] to [0]\nshow\nreset timer\nset [button color v] to [0]\nset size to (100) %\nwait (.45) seconds\nbroadcast (1 v)\nrepeat (10)\n    change [button color v] by (1)\n    change size by (button color)\nend\nrepeat until <(timer) > [4]>\n    repeat (20)\n        change [button color v] by (-1)\n        change size by (button color)\n    end\n    repeat (20)\n        change [button color v] by (1)\n        change size by (button color)\n    end\nend\nbroadcast (2 v)\n\nwhen I start as a clone\nrepeat (50)\n    change size by (5)\n    change [ghost v] effect by (2)\nend\ndelete this clone\n\nwhen flag clicked\nset size to (100) %\nwait (.45) seconds\nrepeat until <(timer) > [4]>\n    create clone of (_myself_ v)\n    wait (0.6) seconds\nend\n\nwhen flag clicked\nset volume to (100) %\nreset timer\nset [button color v] to [0]\nset size to (100) %\nwait (.45) seconds\nstart sound [Jackpot! The fat rat2 v]\nwait until <(timer) > [9.5]>\nrepeat (16)\n    change volume by (-5)\nend\nrepeat (20)\n    change volume by (-1)\nend\nstop all sounds\nbroadcast (Start v)\n\nwhen flag clicked\nerase all\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\ndelete this clone\n\nset [everything unlocked code: v] to [1111111111011111011111111111]\n\nwhen I receive [start v]\nset [#playing v] to [0]\n\nwhen I receive [level setup v]\nset [#playing v] to [1]\n\nwhen I receive [start2 v]\nset [#playing v] to [0]\n\n@Intro2\n\nwhen flag clicked\npoint in direction (90)\nrepeat (12)\n    turn left (30) degrees\nend\n\nwhen flag clicked\nset size to (0) %\ngo to x: (0) y: (0)\nrepeat (12)\n    change size by (8.333)\nend\n\nwhen flag clicked\nshow\nwait (.45) seconds\nrepeat until <(timer) > [4]>\n    repeat (10)\n        change size by (3)\n    end\n    repeat (10)\n        change size by (-3)\n    end\nend\nset size to (150) %\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\ndelete this clone\n\n@Intro3\n\nwhen flag clicked\nset size to (300) %\ngo to x: (0) y: (0)\npoint in direction (75)\nhide\nrepeat (10)\n    create clone of (_myself_ v)\n    turn left (15) degrees\nend\n\nwhen I receive [2 v]\nset [momentum v] to (pick random (10) to (15))\nset [yv v] to (pick random (2) to (3))\nchange size by (pick random (-150) to (0))\nchange [brightness v] effect by (pick random (-20) to (20))\nturn right (pick random (-10) to (10)) degrees\nshow\nrepeat until <touching (_edge_ v)?>\n    go to [back v] layer\n    move (Momentum) steps\n    change y by (Yv)\n    change [yv v] by (-0.4)\n    set [momentum v] to ((Momentum) * (0.95))\nend\nhide\ndelete this clone\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\ndelete this clone\n\n@Intro4\n\nwhen flag clicked\npoint in direction (90)\nrepeat (12)\n    turn left (30) degrees\nend\n\nwhen flag clicked\nshow\ngo to x: (0) y: (-300)\nglide (.3) secs to x: (0) y: (0)\n\nwhen flag clicked\nset size to (100) %\nwait (.45) seconds\nrepeat (10)\n    change size by (6)\nend\nrepeat until <(timer) > [4]>\n    repeat (10)\n        change size by (-6)\n    end\n    repeat (10)\n        change size by (6)\n    end\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\ndelete this clone\n\n@Main Logo\n\nwhen I receive [start v]\npoint in direction (90)\nswitch costume to (the-avengers-icons-emblem-png-logo-14 v)\ngo to x: (0) y: (-273)\nset size to (1) %\nshow\nset [ghost v] effect to (0)\nset [logo rotation v] to [0]\nset [logo yv v] to [25]\nrepeat (35)\n    change y by (logo yv)\n    change [logo yv v] by (-1)\nend\nreset timer\nrepeat (10)\n    change size by (logo rotation)\n    change x by (logo rotation)\n    change [logo rotation v] by (0.125)\n    point in direction ((([sin v] of ((timer) * (100)) ) * (25)) + (90))\nend\nforever\n    repeat (20)\n        change size by (logo rotation)\n        change x by ((logo rotation) * (2))\n        change [logo rotation v] by (-0.125)\n        point in direction ((([sin v] of ((timer) * (100)) ) * (25)) + (90))\n    end\n    repeat (20)\n        change size by (logo rotation)\n        change x by ((logo rotation) * (2))\n        change [logo rotation v] by (0.125)\n        point in direction ((([sin v] of ((timer) * (100)) ) * (25)) + (90))\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nrepeat (35)\n    change size by (1.5)\nend\nforever\n    set [ghost v] effect to (50)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nrepeat ((size) / (2))\n    change size by (-2)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\npoint in direction ((([sin v] of ((timer) * (100)) ) * (25)) + (90))\n\nwhen I receive [clean-up v]\nstop [other scripts in sprite v]\nhide\nrepeat (50)\n    delete this clone\nend\n\nwhen I receive [start v]\nrepeat (10)\n    show\nend\n\n@secondary logo\n\nwhen I receive [start2 v]\nrepeat (35)\n    change size by (7)\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nbroadcast (Start2 v)\nclone\nswitch costume to (play v)\npoint in direction (90)\ngo to x: (0) y: (-273)\nset size to (1) %\nshow\nset [logo 2 yv v] to [15]\nrepeat (35)\n    change y by (logo 2 yv)\n    change [logo 2 yv v] by (-0.72)\nend\nforever\n    point in direction ((([sin v] of ((timer) * (100)) ) * (5)) + (90))\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        broadcast (clean-up v)\n        broadcast (menu v)\n    end\n    if <touching (mouse-pointer v)?> then\n        set size to (300) %\n        set [ghost v] effect to (10)\n    else\n        set [ghost v] effect to (0)\n        set size to (269) %\n    end\nend\n\nwhen flag clicked\nAchievement setup\nhide\n\ndefine clone\nswitch costume to (save v)\npoint in direction (90)\ngo to x: (-100) y: (-273)\nset size to (1) %\nshow\nset [logo 2 yv v] to [15]\ncreate clone of (_myself_ v)\nswitch costume to (achieve v)\npoint in direction (90)\ngo to x: (100) y: (-273)\nset size to (1) %\nshow\nset [logo 2 yv v] to [15]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset y to (-90)\nwait (1.25) seconds\nforever\n    point in direction ((([sin v] of ((timer) * (100)) ) * (-5)) + (90))\n    if <touching (mouse-pointer v)?> then\n        set size to (230) %\n        set [ghost v] effect to (10)\n    else\n        set [ghost v] effect to (0)\n        set size to (200) %\n    end\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        if <(costume [name v]) = [save]> then\n            broadcast (load save code v)\n        else\n            broadcast (clean-up v)\n            broadcast (Achievements v)\n        end\n        wait until <not <mouse down?>>\n    end\nend\n\nwhen I start as a clone\nrepeat (35)\n    change size by (5)\nend\nset [size v] to (size)\n\nwhen I receive [clean-up v]\nhide\nrepeat (50)\n    delete this clone\nend\nstop [other scripts in sprite v]\nstop [this script v]\n\ndefine Achievement setup\ndelete all of [achievements v]\nrepeat (10)\n    add [0] to [achievements v]\nend\n\n@level selector\n\nwhen I start as a clone\nif <(menu selection) = [ch]> then\n    switch costume to (id)\n    set size to (400) %\n    show\n    repeat until <[-5] > (button yv)>\n        if <<(chapters unlocked) = (id)> or <(id) < (chapters unlocked)>> then\n            set [color v] effect to ((button color) + (id))\n        else\n            set [color v] effect to ((1) / (0))\n        end\n        change [button yv v] by (-1)\n        change y by (button yv)\n    end\n    set [button yv v] to [-0.8]\n    forever\n        repeat (8)\n            if <<(chapters unlocked) = (id)> or <(id) < (chapters unlocked)>> then\n                set [color v] effect to ((button color) + (id))\n            else\n                set [color v] effect to ((1) / (0))\n            end\n            change [button yv v] by (0.2)\n            change y by (button yv)\n        end\n        repeat (8)\n            if <<(chapters unlocked) = (id)> or <(id) < (chapters unlocked)>> then\n                set [color v] effect to ((button color) + (id))\n            else\n                set [color v] effect to ((1) / (0))\n            end\n            change [button yv v] by (-0.2)\n            change y by (button yv)\n        end\n    end\nelse\n    switch costume to (id)\n    set size to (400) %\n    show\n    repeat until <[-5] > (button yv)>\n        if <<(item (selected ch) of [levels unlocked per chapter v]) = (id)> or <(id) < (item (selected ch) of [levels unlocked per chapter v])>> then\n            set [color v] effect to ((button color) + (id))\n        else\n            set [color v] effect to ((1) / (0))\n        end\n        change [button yv v] by (-1)\n        change y by (button yv)\n    end\n    set [button yv v] to [-0.8]\n    forever\n        repeat (8)\n            if <<(item (selected ch) of [levels unlocked per chapter v]) = (id)> or <(id) < (item (selected ch) of [levels unlocked per chapter v])>> then\n                set [color v] effect to ((button color) + (id))\n            else\n                set [color v] effect to ((1) / (0))\n            end\n            change [button yv v] by (0.2)\n            change y by (button yv)\n        end\n        repeat (8)\n            if <<(item (selected ch) of [levels unlocked per chapter v]) = (id)> or <(id) < (item (selected ch) of [levels unlocked per chapter v])>> then\n                set [color v] effect to ((button color) + (id))\n            else\n                set [color v] effect to ((1) / (0))\n            end\n            change [button yv v] by (-0.2)\n            change y by (button yv)\n        end\n    end\nend\n\nwhen this sprite clicked\nif <[21] = (costume [number v])> then\n    broadcast (setup from menu v)\n    set [selected ch v] to [7]\n    set [selected lvl v] to [1]\n    broadcast (level setup v)\n    broadcast (final battle v)\nelse\n    if <(menu selection) = [ch]> then\n        if <<(chapters unlocked) = (id)> or <(id) < (chapters unlocked)>> then\n            set [selected ch v] to (id)\n            broadcast (menu 2 v)\n        end\n    else\n        if <<(item (selected ch) of [levels unlocked per chapter v]) = (id)> or <(id) < (item (selected ch) of [levels unlocked per chapter v])>> then\n            set [selected lvl v] to (id)\n            broadcast (setup from menu v)\n            if <<(selected lvl) = [5]> and <<(selected ch) = [2]> or <<(selected ch) = [4]> or <<(selected ch) = [6]> or <<(selected ch) = [8]> or <(selected ch) = [10]>>>>>> then\n                set [entrance v] to [1]\n                wait (2.5) seconds\n                broadcast (boss enter v)\n                wait until <(entrance) = [0]>\n            end\n            broadcast (level setup v)\n        end\n    end\nend\n\nwhen I receive [menu v]\nset [menu selection v] to [ch]\nhide\nset [button color v] to [0]\ngo to x: (-205) y: (-180)\nset [button yv v] to [23]\nset [id v] to [1]\nset [m1 v] to [-5]\nhide\nset [button color v] to [165]\nswitch costume to (costume12 v)\nrepeat (5)\n    create clone of (_myself_ v)\n    change [id v] by (1)\n    change x by (79)\nend\ncreate clone of (_myself_ v)\nchange [id v] by (1)\nset [id v] to [99]\nchange [button yv v] by (m1)\nset x to (-197)\nchange [m1 v] by (-0.5)\nclear graphic effects\nif <(boss unlocked?) = [1]> then\n    set [color v] effect to (165)\n    broadcast (level select boss v)\n    go to x: (0) y: (-130)\n    show\n    set [ghost v] effect to (100)\n    wait (2) seconds\n    repeat (4)\n        change [ghost v] effect by (-25)\n    end\n    forever\n        point in direction (([sin v] of ((timer) * (250)) ) + (90))\n        if <touching (mouse-pointer v)?> then\n            set size to (260) %\n            set [ghost v] effect to (10)\n        else\n            set [ghost v] effect to (0)\n            set size to (250) %\n        end\n        set [color v] effect to (button color)\n    end\nend\nforever\n    repeat (20)\n        change [button color v] by (1)\n    end\n    repeat (20)\n        change [button color v] by (-1)\n    end\nend\n\nwhen I receive [menu 2 v]\nhide\nstop [other scripts in sprite v]\nif <(id) = [99]> then\n    hide\n    set [menu selection v] to [lvl]\n    set [button color v] to [0]\n    level setup\n    set [button color v] to [165]\n    forever\n        clear graphic effects\n        repeat (20)\n            change [button color v] by (1)\n        end\n        repeat (20)\n            change [button color v] by (-1)\n        end\n    end\nelse\n    delete this clone\nend\n\ndefine level setup\ngo to x: (-188) y: (150)\nswitch costume to ((selected ch) + (10))\nset size to (300) %\ngo to [front v] layer\nstamp\ngo to x: (-188) y: (-180)\nset [button yv v] to [21.5]\nset [id v] to [1]\nrepeat (4)\n    create clone of (_myself_ v)\n    change [id v] by (1)\n    change x by (90)\nend\ncreate clone of (_myself_ v)\nchange [id v] by (1)\npoint in direction (90)\ngo to x: (-188) y: (150)\nswitch costume to ((selected ch) + (10))\nset size to (250) %\ngo to [front v] layer\nshow\n\nwhen flag clicked\nhide\nset [boss unlocked? v] to [0]\nset [chapters unlocked v] to [1]\ndelete all of [levels unlocked per chapter v]\nadd [1] to [levels unlocked per chapter v]\nrepeat (9)\n    add [0] to [levels unlocked per chapter v]\nend\n\nwhen I receive [menu v]\nerase all\nforever\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    point in direction (([sin v] of ((timer) * (250)) ) + (90))\n    if <touching (mouse-pointer v)?> then\n        set size to (450) %\n        set [ghost v] effect to (10)\n    else\n        set [ghost v] effect to (0)\n        set size to (400) %\n    end\nend\n\nwhen I receive [start v]\nhide\nerase all\nrepeat (4)\n    delete this clone\nend\nstop [other scripts in sprite v]\n\nwhen I receive [level select boss v]\nif <(id) = [99]> then\n    forever\n        repeat (20)\n            change [button color v] by (1)\n        end\n        repeat (20)\n            change [button color v] by (-1)\n        end\n    end\nend\n\nwhen I receive [level setup v]\nset [level # v] to ((((selected ch) - (1)) * (5)) + (selected lvl))\nwait (0.2) seconds\nwait until <(loading y) = [0]>\nhide\nerase all\nrepeat (4)\n    delete this clone\nend\nstop [other scripts in sprite v]\n\n@acheivements\n\nwhen I start as a clone\nswitch costume to (id)\nset size to (300) %\nshow\nrepeat until <[-5] > (button yv)>\n    if <(item (id) of [achievements v]) = [1]> then\n        set [color v] effect to ((button color) + (id))\n        set [brightness v] effect to (0)\n    else\n        set [color v] effect to ((button color) + (id))\n        set [brightness v] effect to (-60)\n    end\n    change [button yv v] by (-1)\n    change y by (button yv)\nend\nset [button yv v] to [-0.8]\nforever\n    if <(item (id) of [achievements v]) = [1]> then\n        set [color v] effect to ((button color) + (id))\n        set [brightness v] effect to (0)\n    else\n        set [color v] effect to ((button color) + (id))\n        set [brightness v] effect to (-60)\n    end\nend\n\nwhen I receive [achievements v]\nset [acheive v] to [1]\ngo to x: (-150) y: (-180)\nset [button yv v] to [26]\nset [id v] to [1]\nset [m1 v] to [-2]\nhide\nrepeat (5)\n    create clone of (_myself_ v)\n    change [id v] by (1)\n    change x by (300)\n    create clone of (_myself_ v)\n    change [id v] by (1)\n    change [button yv v] by (m1)\n    change [m1 v] by (-0.4)\n    set x to (-150)\nend\nset [button color v] to [175]\nforever\n    repeat (20)\n        change [button color v] by (1)\n    end\n    repeat (20)\n        change [button color v] by (-1)\n    end\nend\n\nwhen I receive [start v]\nhide\nrepeat (2)\n    delete this clone\nend\nstop [other scripts in sprite v]\n\ndefine State Farms\nif <(acheive) = [1]> then\n    go to [front v] layer\n    set [flashcard id v] to (id)\n    set [x v] to (x position)\n    set [y v] to (y position)\n    broadcast (flashcard grow v)\n    glide (1) secs to x: (8) y: (0)\n    wait until <not <mouse down?>>\n    wait until <mouse down?>\n    glide (1) secs to x: (x) y: (y)\nend\n\nset size to (1400) %\n\nwhen I receive [flashcard grow v]\nif <(id) = (flashcard id)> then\n    set [acheive v] to [0]\n    repeat (15)\n        change size by (((1950) - (size)) / (30))\n        change [pixelate v] effect by (3)\n    end\n    switch costume to ((id) + (10))\n    repeat (15)\n        change size by (((1950) - (size)) / (30))\n        change [pixelate v] effect by (-3)\n    end\n    wait until <not <mouse down?>>\n    wait until <mouse down?>\n    repeat (15)\n        change size by (((size) - (1950)) / (30))\n        change [pixelate v] effect by (3)\n    end\n    switch costume to (id)\n    repeat (15)\n        change size by (((size) - (1950)) / (30))\n        change [pixelate v] effect by (-3)\n    end\n    set [acheive v] to [1]\nend\n\nwhen I start as a clone\nwait until <not <mouse down?>>\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            State Farms\n        end\n        set [pixelate v] effect to (0)\n        set size to (350) %\n    else\n        set [ghost v] effect to (0)\n        set size to (300) %\n        set [pixelate v] effect to (0)\n    end\nend\n\nwhen I receive [level start v]\nhide\nstop [other scripts in sprite v]\nif <(chapters unlocked) = [2]> then\n    unlock [1]\n    unlock [5]\nend\nif <(chapters unlocked) = [4]> then\n    unlock [2]\nend\nif <(chapters unlocked) = [7]> then\n    unlock [3]\nend\nif <(chapters unlocked) = [3]> then\n    unlock [4]\nend\nif <(chapters unlocked) = [4]> then\n    unlock [6]\nend\nif <(levels passed without death) = [5]> then\n    unlock [9]\nend\nif <(Achievements) = [1111111110]> then\n    unlock [10]\nend\n\ndefine unlock (#)\ngo to [front v] layer\nif <(item (#) of [achievements v]) = [0]> then\n    clear graphic effects\n    set size to (600) %\n    show\n    replace item (#) of [achievements v] with [1]\n    switch costume to (costume21 v)\n    go to x: (0) y: (200)\n    switch costume to (#)\n    glide (1) secs to x: (0) y: (120)\n    wait (3) seconds\n    repeat (10)\n        change [pixelate v] effect by (4)\n        go to [front v] layer\n    end\n    switch costume to ((#) + (10))\n    repeat (10)\n        go to [front v] layer\n        change [pixelate v] effect by (-4)\n        go to [front v] layer\n    end\n    wait (3) seconds\n    repeat (25)\n        change [ghost v] effect by (4)\n        go to [front v] layer\n    end\n    hide\n    clear graphic effects\nend\n\nwhen I receive [ahhh you win! v]\nunlock [8]\n\nwhen I receive [menu v]\n\nwhen I receive [level start v]\nforever\n    if <(times dead) = [20]> then\n        unlock [7]\n    end\nend\n\nhide\nstop [other scripts in sprite v]\n\n@Home button\n\nwhen flag clicked\nhide\ngo to x: (-214) y: (-154)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [achievements v]\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (40)\n    change [ghost v] effect by (-2.5)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (140) %\n    else\n        set size to (120) %\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Start v)\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [menu v]\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (40)\n    change [ghost v] effect by (-2.5)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (140) %\n    else\n        set size to (120) %\n    end\nend\n\nwhen I receive [level setup v]\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (40)\n    change [ghost v] effect by (-2.5)\nend\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        set size to (140) %\n    else\n        set size to (120) %\n    end\nend\n\n@load from menu\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [menu v]\ngo to x: (0) y: (0)\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [setup from menu v]\nclear graphic effects\nshow\nswitch costume to (costume6 v)\ngo to [front v] layer\ngo to x: (0) y: (0)\nset [loading y v] to [150]\ncreate clone of (_myself_ v)\nrepeat until <(loading y) = [0]>\n    go to [front v] layer\n    change [loading y v] by (-5)\n    set y to (loading y)\nend\nset y to (loading y)\nswitch costume to (costume1 v)\nshow\nrepeat (pick random (1) to (2))\n    wait (0.5) seconds\n    switch costume to (costume1 v)\n    repeat (2)\n        wait (0.5) seconds\n        next costume\n    end\nend\nbroadcast (level start v)\nhide\n\nwait (0.5) seconds\n\nwhen I start as a clone\nshow\nswitch costume to (costume4 v)\nrepeat until <(loading y) = [0]>\n    go to [front v] layer\n    set y to ((loading y) * (-1))\nend\nset y to ((loading y) * (-1))\nwait (0.1) seconds\ndelete this clone\n\nwhen I receive [level setup v]\nwait (3) seconds\n\n@decor/ speech\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [level setup v]\nwait (0.2) seconds\nwait until <(loading y) = [0]>\ngo to [back v] layer\ngo to x: (0) y: (0)\nswitch costume to (level #)\nshow\n\nwhen I receive [menu v]\ngo to x: (0) y: (0)\nhide\n\n@ground\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\nclear graphic effects\ngo to x: (0) y: (0)\nhide\ndelete this clone\n\nwhen I receive [level setup v]\nclear graphic effects\ngo to [back v] layer\nwait (0.2) seconds\nwait until <(loading y) = [0]>\ngo to x: (0) y: (0)\nswitch costume to (level #)\nshow\n\nwhen I receive [menu v]\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [stone v]\nif <(Selected Stone) = [4]> then\n    set [#mind!!!!! v] to [1]\n    set [reality v] to [1]\n    clone at [-200] [-132]\n    clone at [-100] [-66]\n    clone at [0] [0]\n    clone at [100] [66]\n    wait (25) seconds\n    set [reality v] to [0]\n    set [#mind!!!!! v] to [0]\n    wait (4) seconds\n    set [next stone? v] to [0]\nelse\n    if <(Selected Stone) = [6]> then\n        switch costume to (costume31 v)\n        set [reality v] to [1]\n        clear graphic effects\n        repeat (100)\n            change [fisheye v] effect by (-1)\n            change [whirl v] effect by (5)\n        end\n        wait (17) seconds\n        repeat (100)\n            change [whirl v] effect by (-5)\n            change [fisheye v] effect by (1)\n        end\n        clear graphic effects\n        set [reality v] to [0]\n        wait (4) seconds\n        set [next stone? v] to [0]\n    end\nend\nswitch costume to (costume32 v)\n\nset [selected stone v] to [4]\nbroadcast (Stone v)\n\nwhen I start as a clone\nset [# v] to [1]\nrepeat until <(#) = [0]>\n    set x to ((x) + (pick random (-2) to (2)))\nend\nset x to (x)\n\nwhen I start as a clone\nswitch costume to (costume33 v)\ngo to x: (x) y: (-999999)\nshow\nglide (((180) + (y)) / (100)) secs to x: (x) y: (y)\nset [# v] to [0]\nwait until <(#MIND!!!!!) = [0]>\ndelete this clone\n\ndefine clone at (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nbroadcast (Start v)\n\nwhen I receive [stone v]\ndelete this clone\n\nwhen I receive [boss beat v]\nif <(selected ch) = [7]> then\n    switch costume to (costume32 v)\nend\n\n@spikes/lava/whatever\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [menu v]\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [level setup v]\nwait (0.2) seconds\nwait until <(loading y) = [0]>\ngo to x: (0) y: (0)\nswitch costume to (level #)\nshow\n\n@goal\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [menu v]\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [level setup v]\ngo to [back v] layer\nwait (0.2) seconds\ngo [forward v] (1) layers\nhide\nwait until <(loading y) = [0]>\ngo to x: (item (level #) of [x's v]) y: (item (level #) of [y's v])\nif <<(selected lvl) < [5]> or <not <<(selected ch) = [2]> or <<(selected ch) = [4]> or <<(selected ch) = [6]> or <<(selected ch) = [7]> or <(selected ch) = [10]>>>>>>> then\n    show\nend\nif <(selected ch) = [7]> then\n    hide\nend\n\nadd (x position) to [x's v]\nadd (y position) to [y's v]\n\nwhen I receive [boss beat v]\nshow\n\nwhen I receive [restart v]\nif <(level #) = [24]> then\n    hide\n    wait (1) seconds\n    repeat (20)\n        go [backward v] (1) layers\n    end\n    show\nend\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nreplace item (18) of [x's v] with (x position)\nreplace item (18) of [y's v] with (y position)\n\n@hero\n\nwhen flag clicked\nhide variable [fuel v]\nhide\n\ndefine Iron man\nbroadcast (Iron Man v)\npen up\nswitch costume to (costume2 v)\ngo to x: (-178) y: (-140)\nshow\nset rotation style [left-right v]\nset [fuel v] to [100]\nset [yv v] to [0]\nshow variable [fuel v]\nset [xv v] to [0]\nforever\n    if <(level #) = [20]> then\n        set [fuel v] to [100]\n        hide variable [fuel v]\n    end\n    change [yv v] by (-0.5)\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (0.7)\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-0.7)\n        point in direction (-90)\n    end\n    set [xv v] to ((xv) * (0.9))\n    change x by (xv)\n    if <<touching (ground v)?> or <touching (box v)?>> then\n        change y by (1)\n        if <<touching (ground v)?> or <touching (box v)?>> then\n            change y by (1)\n            if <<touching (ground v)?> or <touching (box v)?>> then\n                change y by (1)\n                if <<touching (ground v)?> or <touching (box v)?>> then\n                    change y by (1)\n                    if <<touching (ground v)?> or <touching (box v)?>> then\n                        change y by (1)\n                        if <<touching (ground v)?> or <touching (box v)?>> then\n                            change x by ((xv) * (-1))\n                            change x by (0)\n                            change y by (-5)\n                            if <touching (null v)?> then\n                                change x by (10)\n                            end\n                            change x by (0)\n                            if <key (up arrow v) pressed?> 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 [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 (yv)\n    if <<touching (ground v)?> or <touching (box v)?>> then\n        change y by ((yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching (spikes/lava/whatever v)?> or <touching (turrets v)?>> then\n        set [levels passed without death v] to [0]\n        change [times dead v] by (1)\n        set [fuel v] to [100]\n        broadcast (restart v)\n        go to x: (-178) y: (-140)\n    end\n    if <touching (goal v)?> then\n        set [times dead v] to [0]\n        change [levels passed without death v] by (1)\n        set [fuel v] to [100]\n        broadcast (next level v)\n        stop [this script v]\n    end\n    if <<touching (ground v)?> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [yv v] to [10]\n    else\n        if <<(Fuel) > [0]> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n            change [fuel v] by (-1)\n            set [yv v] to [7]\n        end\n    end\n    if <touching color (#003fff)?> then\n        set [yv v] to [15]\n    end\n    change y by (1)\nend\n\nwhen I receive [level start v]\nset [#mind!!!!! v] to [0]\nset [time stop? v] to [0]\npick a hero\n\ndefine pick a hero\nswitch costume to (selected ch)\nif <(selected ch) = [1]> then\n    Captain America\nelse\n    if <(selected ch) = [2]> then\n        the hulk\n    else\n        if <(selected ch) = [3]> then\n            Scarlet Witch\n        else\n            if <(selected ch) = [4]> then\n                Iron man\n            else\n                if <(selected ch) = [5]> then\n                    vision\n                else\n                    if <(selected ch) = [6]> then\n                        Thor\n                    else\n                        if <(selected ch) = [7]> then\n                            Thor\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\nset [#playing v] to [0]\nhide variable [fuel v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [menu v]\nhide variable [fuel v]\nhide\nstop [other scripts in sprite v]\n\ndefine Captain America\nbroadcast (Captain America v)\nshow\ngo to x: (-178) y: (-140)\nset rotation style [left-right v]\nset [yv v] to [0]\nset [xv v] to [0]\nforever\n    change [yv v] by (-0.5)\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (0.7)\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-0.7)\n        point in direction (-90)\n    end\n    set [xv v] to ((xv) * (0.9))\n    change x by (xv)\n    if <<touching (ground v)?> or <touching (shield v)?>> then\n        change y by (1)\n        if <<touching (ground v)?> or <touching (shield v)?>> then\n            change y by (1)\n            if <<touching (ground v)?> or <touching (shield v)?>> then\n                change y by (1)\n                if <<touching (ground v)?> or <touching (shield v)?>> then\n                    change y by (1)\n                    if <<touching (ground v)?> or <touching (shield v)?>> then\n                        change y by (1)\n                        if <<touching (ground v)?> or <touching (shield v)?>> then\n                            change x by ((xv) * (-1))\n                            change x by (-1)\n                            change y by (-5)\n                            if <touching (null v)?> then\n                                change x by (10)\n                            end\n                            change x by (1)\n                            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> 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 [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 (yv)\n    if <<touching (ground v)?> or <touching (shield v)?>> then\n        change y by ((yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching (spikes/lava/whatever v)?> or <touching (turrets v)?>> then\n        set [levels passed without death v] to [0]\n        change [times dead v] by (1)\n        go to x: (-178) y: (-140)\n    end\n    if <touching (goal v)?> then\n        set [times dead v] to [0]\n        change [levels passed without death v] by (1)\n        broadcast (next level v)\n        stop [this script v]\n    end\n    if <<<touching (ground v)?> or <touching (shield v)?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [yv v] to [10]\n    end\n    if <touching color (#003fff)?> then\n        set [yv v] to [15]\n    end\n    change y by (1)\nend\n\ndefine the hulk\nbroadcast (The Hulk v)\nshow\ngo to x: (-178) y: (-140)\nset rotation style [left-right v]\nset [yv v] to [0]\nset [xv v] to [0]\nforever\n    change [yv v] by (-0.7)\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (0.7)\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-0.7)\n        point in direction (-90)\n    end\n    set [xv v] to ((xv) * (0.9))\n    change x by (xv)\n    if <<touching (ground v)?> or <touching (box v)?>> then\n        change y by (1)\n        if <<touching (ground v)?> or <touching (box v)?>> then\n            change y by (1)\n            if <<touching (ground v)?> or <touching (box v)?>> then\n                change y by (1)\n                if <<touching (ground v)?> or <touching (box v)?>> then\n                    change y by (1)\n                    if <<touching (ground v)?> or <touching (box v)?>> then\n                        change y by (1)\n                        if <<touching (ground v)?> or <touching (box v)?>> then\n                            change x by ((xv) * (-1))\n                            change x by (0)\n                            change y by (-5)\n                            if <touching (null v)?> then\n                                change x by (10)\n                            end\n                            change x by (0)\n                            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> 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 [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 (yv)\n    if <<touching (ground v)?> or <touching (box v)?>> then\n        change y by ((yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching (spikes/lava/whatever v)?> or <touching (turrets v)?>> then\n        change [times dead v] by (1)\n        set [levels passed without death v] to [0]\n        broadcast (restart v)\n        go to x: (-178) y: (-140)\n    end\n    if <touching (goal v)?> then\n        set [times dead v] to [0]\n        change [levels passed without death v] by (1)\n        broadcast (next level v)\n        stop [this script v]\n    end\n    if <<<touching (ground v)?> or <touching (box v)?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [yv v] to [12]\n    end\n    if <touching color (#003fff)?> then\n        set [yv v] to [15]\n    end\n    change y by (1)\nend\n\nwhen I receive [boss enter v]\nhide\n\nwhen I receive [boss loss v]\nstop [other scripts in sprite v]\nrepeat (20)\n    change [ghost v] effect by (2)\n    change y by (0.5)\nend\nhide\nclear graphic effects\n\ndefine Scarlet Witch\nshow\ngo to x: (-178) y: (-140)\nset rotation style [left-right v]\nset [yv v] to [0]\nset [xv v] to [0]\nforever\n    change [yv v] by (-0.7)\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (0.7)\n        point in direction (90)\n    end\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-0.7)\n        point in direction (-90)\n    end\n    set [xv v] to ((xv) * (0.9))\n    change x by (xv)\n    if <<touching (ground v)?> or <touching (box v)?>> then\n        change y by (1)\n        if <<touching (ground v)?> or <touching (box v)?>> then\n            change y by (1)\n            if <<touching (ground v)?> or <touching (box v)?>> then\n                change y by (1)\n                if <<touching (ground v)?> or <touching (box v)?>> then\n                    change y by (1)\n                    if <<touching (ground v)?> or <touching (box v)?>> then\n                        change y by (1)\n                        if <<touching (ground v)?> or <touching (box v)?>> then\n                            change x by ((xv) * (-1))\n                            change x by (0)\n                            change y by (-5)\n                            if <touching (null v)?> then\n                                change x by (10)\n                            end\n                            change x by (0)\n                            if <key (up arrow v) pressed?> 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 [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 (yv)\n    if <<touching (ground v)?> or <touching (box v)?>> then\n        change y by ((yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching (spikes/lava/whatever v)?> or <touching (turrets v)?>> then\n        change [times dead v] by (1)\n        set [levels passed without death v] to [0]\n        broadcast (restart v)\n        go to x: (-178) y: (-140)\n    end\n    if <touching (goal v)?> then\n        change [levels passed without death v] by (1)\n        set [times dead v] to [0]\n        broadcast (next level v)\n        stop [this script v]\n    end\n    if <<<touching (ground v)?> or <touching (box v)?>> and <key (up arrow v) pressed?>> then\n        set [yv v] to [12]\n    end\n    if <touching color (#003fff)?> then\n        set [yv v] to [15]\n    end\n    change y by (1)\nend\n\nwhen [r v] key pressed\nset [fuel v] to [100]\ngo to x: (-178) y: (-140)\nbroadcast (restart v)\n\ndefine vision\nbroadcast (vision v)\nshow\ngo to x: (-178) y: (-140)\nset rotation style [left-right v]\nset [yv v] to [0]\nset [xv v] to [0]\nforever\n    change [yv v] by (-0.5)\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (0.7)\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-0.7)\n        point in direction (-90)\n    end\n    set [xv v] to ((xv) * (0.9))\n    change x by (xv)\n    if <touching (ground v)?> then\n        change y by (1)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change x by ((xv) * (-1))\n                            change x by (-1)\n                            change y by (-5)\n                            if <touching (null v)?> then\n                                change x by (10)\n                            end\n                            change x by (1)\n                            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> 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 [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 (yv)\n    if <touching (ground v)?> then\n        change y by ((yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching (spikes/lava/whatever v)?> or <<touching (turrets v)?> or <touching (enemies v)?>>> then\n        set [levels passed without death v] to [0]\n        change [times dead v] by (1)\n        set [yv v] to [0]\n        set [xv v] to [0]\n        broadcast (restart v)\n        go to x: (-178) y: (-150)\n        wait until <not <<key (up arrow v) pressed?> or <key (w v) pressed?>>>\n    end\n    if <touching (goal v)?> then\n        set [times dead v] to [0]\n        change [levels passed without death v] by (1)\n        broadcast (next level v)\n        stop [this script v]\n    end\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        set [yv v] to [10]\n    end\n    if <touching color (#003fff)?> then\n        set [yv v] to [15]\n    end\n    change y by (1)\nend\n\ndefine Thor\nswitch costume to (costume6 v)\nbroadcast (Thor v)\nshow\nset [time stop? v] to [0]\ngo to x: (-178) y: (-140)\nset rotation style [left-right v]\nset [yv v] to [0]\nset [xv v] to [0]\nforever\n    if <(time stop?) = [1]> then\n        change [yv v] by (-0.25)\n    else\n        if <(#MIND!!!!!) = [1]> then\n            change [yv v] by (pick random (-0.7) to (0.1))\n        else\n            change [yv v] by (-0.5)\n        end\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (0.7)\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-0.7)\n        point in direction (-90)\n    end\n    if <(time stop?) = [1]> then\n        set [xv v] to ((xv) * (0.95))\n    else\n        if <(#MIND!!!!!) = [1]> then\n            set [xv v] to ((xv) * (pick random (0.85) to (1.1)))\n        else\n            set [xv v] to ((xv) * (0.9))\n        end\n    end\n    if <(time stop?) = [1]> then\n        change x by ((xv) / (2))\n    else\n        change x by (xv)\n    end\n    if <<touching (ground v)?> or <touching (box v)?>> then\n        change y by (1)\n        if <<touching (ground v)?> or <touching (box v)?>> then\n            change y by (1)\n            if <<touching (ground v)?> or <touching (box v)?>> then\n                change y by (1)\n                if <<touching (ground v)?> or <touching (box v)?>> then\n                    change y by (1)\n                    if <<touching (ground v)?> or <touching (box v)?>> then\n                        change y by (1)\n                        if <<touching (ground v)?> or <touching (box v)?>> then\n                            change x by ((xv) * (-1))\n                            change x by (-1)\n                            change y by (-5)\n                            if <touching (null v)?> then\n                                change x by (10)\n                            end\n                            change x by (1)\n                            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> 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 [10]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <(time stop?) = [1]> then\n        change y by ((yv) / (2))\n    else\n        change y by (yv)\n    end\n    if <<touching (ground v)?> or <touching (box v)?>> then\n        change y by ((yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching (spikes/lava/whatever v)?> or <<touching (enemies v)?> or <touching (turrets v)?>>> then\n        if <(selected ch) = [7]> then\n    end\n    if <touching (goal v)?> then\n        set [times dead v] to [0]\n        change [levels passed without death v] by (1)\n        broadcast (next level v)\n        stop [this script v]\n    end\n    if <<<touching (ground v)?> or <touching (box v)?>> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [yv v] to [12]\n    end\n    if <touching color (#003fff)?> then\n        set [yv v] to [15]\n    end\n    change y by (1)\nend\n\nwhen [p v] key pressed\ngo to x: (-178) y: (-140)\nbroadcast (next level v)\n\nwhen I receive [restart v]\ngo to x: (-178) y: (-140)\n\nwhen I receive [start v]\n\n@Mini Bosses\n\nwhen flag clicked\nhide\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [start v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [level setup v]\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nswitch costume to ((selected ch) / (2))\nif <<<(selected ch) = [2]> or <<(selected ch) = [4]> or <<(selected ch) = [6]> or <<(selected ch) = [8]> or <(selected ch) = [10]>>>>> and <(selected lvl) = [5]>> then\n    show\n    go to [front v] layer\n    go to [back v] layer\n    clear graphic effects\n    set size to (100) %\n    sort\nend\n\nwhen I receive [boss enter v]\npoint in direction (90)\nwait (1) seconds\nwait until <(nothing) = [0]>\ngo to [front v] layer\nset [ghost v] effect to (100)\nset size to (250) %\nshow\nswitch costume to (((selected ch) / (2)) + (5))\ngo to x: (0) y: (-30)\nrepeat (25)\n    change [ghost v] effect by (-4)\nend\n\ndefine Abomination\nshow\ngo to [front v] layer\nclear graphic effects\ngo to x: (240) y: (0)\nset [xv v] to [-9.75]\nset [yv v] to [12]\nrepeat until <(x position) < [0]>\n    change x by (xv)\n    change y by (yv)\n    set [xv v] to ((xv) * (0.96))\n    change [yv v] by (-1)\n    rise\nend\nrepeat until <<(player hp) < [1]> or <(boss hp) < [1]>>\n    broadcast (Mini Boss Main Attack v)\n    if <<(player hp) < [1]> or <(boss hp) < [1]>> then\n        win\n    end\n    wait (pick random (3) to (5)) seconds\n    if <([x position v] of [hero v]) > (x position)> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    broadcast (Mini Boss Special Attack v)\n    wait (pick random (1) to (3)) seconds\n    set [yv v] to [10]\n    change y by (yv)\n    change [yv v] by (-1)\n    rise\n    repeat until <touching (ground v)?>\n        change y by (yv)\n        change [yv v] by (-1)\n        rise\n    end\nend\nwin\n\ndefine sort\nset rotation style [left-right v]\npoint in direction (-90)\nif <(selected ch) = [2]> then\n    Abomination\nelse\n    if <(selected ch) = [4]> then\n        Mandarin\n    else\n        if <(selected ch) = [6]> then\n            Loki\n        end\n    end\nend\n\ndefine rise\nrepeat until <not <touching (ground v)?>>\n    change y by (1)\nend\nchange y by (-1)\n\ndefine win\nif <(boss hp) < [1]> then\n    broadcast (Boss Beat v)\n    repeat (50)\n        change y by (2)\n        change [ghost v] effect by (2)\n    end\nelse\n    broadcast (boss loss v)\n    wait (2) seconds\n    broadcast (menu v)\nend\nstop [this script v]\n\ndefine Mandarin\nshow\ngo to [front v] layer\nclear graphic effects\npoint in direction (90)\nclear graphic effects\nshow\ngo to x: (240) y: (0)\nrepeat until <<(player hp) < [1]> or <(boss hp) < [1]>>\n    go to [front v] layer\n    glide (1) secs to x: (200) y: (150)\n    broadcast (heli attack v)\n    glide (3) secs to x: (200) y: (-120)\nend\nwin\n\nwhen I receive [heli attack v]\nwait until <<(player hp) < [1]> or <(boss hp) < [1]>>\nstop [other scripts in sprite v]\nwin\n\ndefine Loki\nbroadcast (restart v)\nshow\ngo to [front v] layer\nclear graphic effects\ngo to x: (240) y: (0)\nset [xv v] to [-9.75]\nset [yv v] to [12]\nrepeat until <(x position) < [0]>\n    change x by (xv)\n    change y by (yv)\n    set [xv v] to ((xv) * (0.96))\n    change [yv v] by (-1)\n    rise\nend\nrepeat until <<(player hp) < [1]> or <(boss hp) < [1]>>\n    clone\n    hide\n    wait until <(hammer hit?) = [1]>\n    glide (1) secs to x: (-200) y: (-20)\n    show\n    repeat (20)\n        clear graphic effects\n        glide (0.2) secs to x: ((x position) + (20)) y: (y position)\n        broadcast (loki mad v)\n        if <<(player hp) < [1]> or <(boss hp) < [1]>> then\n            if <(boss hp) < [1]> then\n                set [boss unlocked? v] to [1]\n            end\n            win\n            stop [this script v]\n        end\n    end\n    if <<(player hp) < [1]> or <(boss hp) < [1]>> then\n        if <(boss hp) < [1]> then\n            set [boss unlocked? v] to [1]\n        end\n        win\n        stop [this script v]\n    end\nend\nif <(boss hp) < [1]> then\n    set [boss unlocked? v] to [1]\nend\nwin\n\nwhen I start as a clone\nset [id2 v] to (id)\nif <not <(id2) = (id3)>> then\n    set [ghost v] effect to (30)\nend\nif <(id) = [5]> then\n    show\n    switch costume to (costume11 v)\n    repeat (50)\n        move (3) steps\n        change [ghost v] effect by (2)\n        change size by (-1)\n    end\n    delete this clone\nelse\n    if <(id) = [4]> then\n        clear graphic effects\n        show\n        switch costume to (costume11 v)\n        change x by (pick random (-4) to (4))\n        change y by (pick random (-4) to (4))\n        repeat (50)\n            change [ghost v] effect by (2)\n        end\n        delete this clone\n    else\n        if <(id) = [1]> then\n            hide\n            point in direction (90)\n            glide (2) secs to x: (-175) y: (-50)\n            stop [other scripts in sprite v]\n            show\n        else\n            if <(id) = [2]> then\n                hide\n                point in direction (-90)\n                glide (2) secs to x: (175) y: (-50)\n                stop [other scripts in sprite v]\n                show\n            else\n                hide\n                point in direction (90)\n                glide (2) secs to x: (0) y: (50)\n                stop [other scripts in sprite v]\n                show\n            end\n        end\n        wait until <<touching (stormbreaker v)?> or <(hammer hit?) = [1]>>\n        set [hammer hit? v] to [1]\n        if <touching (stormbreaker v)?> then\n            if <(id2) = (id3)> then\n                change [boss hp v] by (-1)\n                set [hammer hit? v] to [1]\n                broadcast (render lives v)\n                glide (1) secs to x: (-200) y: (-20)\n                delete this clone\n            else\n                h\n            end\n        else\n            h\n        end\n    end\nend\n\ndefine clone\nset [hammer hit? v] to [0]\nset [id v] to [1]\nset [id3 v] to (pick random (1) to (3))\nrepeat (3)\n    create clone of (_myself_ v)\n    change [id v] by (1)\nend\n\nwhen I start as a clone\nif <[4] > (id)> then\n    \n        set [id v] to [4]\n        create clone of (_myself_ v)\n        wait (0.025) seconds\n    end\nend\n\nwhen I receive [lolki v]\nif <(id) < [5]> then\n    set [id v] to [4]\n    forever\n        create clone of (_myself_ v)\n        wait (0.025) seconds\n    end\nelse\n    repeat (1)\n        delete this clone\n    end\nend\n\ndefine h\nset [id v] to [5]\npoint in direction (90)\nrepeat (24)\n    create clone of (_myself_ v)\n    turn right (pick random (30) to (40)) degrees\nend\npoint in direction (90)\nhide\ndelete this clone\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\n\n@Turrets\n\ndefine point towards x: (x) y: (y)\nif <not <(y) < (y position)>> then\n    point in direction ([atan v] of (((x) - (x position)) / ((y) - (y position))) )\nelse\n    point in direction ((180) + ([atan v] of (((x) - (x position)) / ((y) - (y position))) ))\nend\n\ndefine Turret at X: (x pos) Y: (y pos) tracking: <track> Direction: (direction) Reload: (reload) Arc? <arc> Xv (xv) Yv (yv) Speed (speed) Delay: (delay)\nhide\ngo to x: (x pos) y: (y pos)\nif <track> then\n    set [track v] to [1]\nelse\n    set [track v] to [0]\nend\npoint in direction (direction)\nset [reload v] to (reload)\nif <arc> then\n    set [arc v] to [1]\n    set [xv v] to (xv)\n    set [yv v] to (yv)\n    point towards x: ((x position) + (xv)) y: ((y position) + (yv))\nelse\n    set [arc v] to [0]\n    set [speed v] to (speed)\nend\nset [delay v] to (delay)\ncreate clone of (_myself_ v)\nset [building turrets v] to [1]\n\nwhen I start as a clone\nshow\nif <(building turrets) = [1]> then\n    be a turret\nelse\n    be a bullet\nend\n\ndefine be a turret\ngo to [back v] layer\nset size to (45) %\nswitch costume to (costume2 v)\nset [building turrets v] to [0]\nwait until <(turret build?) = [0]>\nwait (delay) seconds\nforever\n    wait (reload) seconds\n    if <<(arc) = [0]> and <(track) = [1]>> then\n        point towards (hero v)\n    end\n    create clone of (_myself_ v)\nend\n\ndefine be a bullet\ngo to [back v] layer\nset size to (10) %\nswitch costume to (costume1 v)\nif <(arc) = [1]> then\n    repeat until <<<touching (_edge_ v)?> or <touching (ground v)?>> or <<touching (hero v)?> or <<touching (shield v)?> or >>>\n        change x by (xv)\n        change y by (yv)\n        set [xv v] to ((xv) * (0.99))\n        change [yv v] by (-1)\n    end\n    delete this clone\nelse\n    repeat until <<<touching (_edge_ v)?> or <touching (ground v)?>> or <<touching (hero v)?> or <<touching (shield v)?> or >>>\n        move (speed) steps\n        if <touching (hulk smash v)?> then\n            point in direction ((180) - (direction))\n            move (speed) steps\n        end\n    end\n    delete this clone\nend\n\nwhen I receive [level setup v]\nwait (0.1) seconds\nwait until <(loading y) = [0]>\nset [turret build? v] to [1]\nplace towers\n\nwhen I receive [level start v]\nset [turret build? v] to [0]\n\ndefine place towers\nif <(level #) = [3]> then\n    Turret at X: [0] Y: [150] tracking: <[1] = [0]> Direction: [180] Reload: [0.1] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\nelse\n    if <(level #) = [4]> then\n        Turret at X: [10] Y: [-130] tracking: <[1] = [0]> Direction: [0] Reload: [1] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [10] Delay: [0.5]\n        Turret at X: [130] Y: [-130] tracking: <[1] = [0]> Direction: [0] Reload: [1] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [10] Delay: [0]\n    else\n        if <(level #) = [5]> then\n            Turret at X: [-79] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [0.33] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\n            Turret at X: [0] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [0.33] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\n            Turret at X: [79] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [0.33] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\n            Turret at X: [158] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [0.33] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\n        else\n            if <(level #) = [8]> then\n                Turret at X: [200] Y: [150] tracking: <[1] = [0]> Direction: [-135] Reload: [0.25] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\n            else\n                if <(level #) = [9]> then\n                    Turret at X: [-80] Y: [-150] tracking: <[1] = [0]> Direction: [0] Reload: [0.5] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\n                else\n                    if <(level #) = [14]> then\n                        Turret at X: [-100] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [0.33] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\n                        Turret at X: [-50] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [0.33] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\n                        Turret at X: [0] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [0.33] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\n                        Turret at X: [50] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [0.33] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\n                        Turret at X: [100] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [0.33] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\n                        Turret at X: [150] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [0.33] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0]\n                    else\n                        if <(level #) = [19]> then\n                            Turret at X: [-100] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [1] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [0.5]\n                            Turret at X: [-50] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [1] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [1]\n                            Turret at X: [0] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [1] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [1.5]\n                            Turret at X: [50] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [1] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [2]\n                            Turret at X: [100] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [1] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [2.5]\n                            Turret at X: [150] Y: [-132] tracking: <[1] = [0]> Direction: [0] Reload: [1] Arc? <[1] = [0]> Xv [15] Yv [7] Speed [7] Delay: [3]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\nhide\nrepeat (10)\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen I receive [menu v]\nhide\nrepeat (10)\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen flag clicked\nhide\nrepeat (10)\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen I receive [level setup v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [restart v]\nrepeat (1)\n    delete this clone\nend\nset [turret build? v] to [1]\nplace towers\nset [turret build? v] to [0]\n\nwhen I receive [restart v]\nrepeat (10)\n    delete this clone\nend\n\n@backdrop\n\nwhen I start as a clone\nif <(start) = [0]> then\n    go to x: (1555) y: (0)\nelse\n    set [start v] to [0]\nend\nshow\nrepeat until <(x position) < [-200]>\n    change x by (-3)\nend\ncreate clone of (_myself_ v)\nrepeat until <(x position) < [-676]>\n    change x by (-3)\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nforever\n    go to [back v] layer\n    set [ghost v] effect to (ghost bc effect)\nend\n\nwhen I receive [start v]\nset [ghost bc effect v] to [80]\nhide\nset [start v] to [1]\ngo to x: (-265) y: (0)\ncreate clone of (_myself_ v)\nrepeat (40)\n    change [ghost bc effect v] by (-2)\nend\n\nwhen I receive [start v]\nforever\n    delete this clone\nend\n\nwhen I receive [level setup v]\nwait (1) seconds\nstop [other scripts in sprite v]\ngo to x: (pick random (-200) to (1050)) y: (0)\nshow\nforever\n    go to [back v] layer\nend\n\nwhen I receive [level start v]\ndelete this clone\n\n@level load1\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (100)\nif <(#m) = [1]> then\n    wait (1) seconds\n    broadcast (ahhh you win! v)\n    set [#m v] to [0]\nend\n\nwhen I receive [next level v]\nshow\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    go to [front v] layer\nend\n\nwhen I receive [next level v]\nif <(selected lvl) = [5]> then\n    if <(selected ch) = (chapters unlocked)> then\n        change [chapters unlocked v] by (1)\n        replace item (chapters unlocked) of [levels unlocked per chapter v] with ((item (chapters unlocked) of [levels unlocked per chapter v]) + (1))\n    end\n    wait (2) seconds\n    broadcast (clean-up v)\n    wait (0.1) seconds\n    broadcast (menu v)\nelse\n    if <(selected ch) = [7]> then\n        wait (2) seconds\n        broadcast (clean-up v)\n        wait (0.1) seconds\n        set [#m v] to [1]\n        broadcast (Start v)\n    else\n        if <(selected lvl) = (item (chapters unlocked) of [levels unlocked per chapter v])> then\n            replace item (chapters unlocked) of [levels unlocked per chapter v] with ((item (chapters unlocked) of [levels unlocked per chapter v]) + (1))\n        end\n        change [selected lvl v] by (1)\n        if <<(selected lvl) = [5]> and <<(selected ch) = [2]> or <<(selected ch) = [4]> or <<(selected ch) = [6]> or <<(selected ch) = [8]> or <(selected ch) = [10]>>>>>> then\n            set [entrance v] to [1]\n            wait (2.5) seconds\n            broadcast (boss enter v)\n            wait until <(entrance) = [0]>\n        end\n        broadcast (level setup v)\n        wait (2.5) seconds\n        broadcast (level start v)\n    end\nend\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [level start v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [boss enter v]\nhide\n\nwhen flag clicked\nset [#m v] to [0]\n\nwhen I receive [start v]\n\nreplace item (8) of [achievements v] with [0]\n\n@level load2\n\nwhen I start as a clone\ngo to [front v] layer\ngo [backward v] (1) layers\nset [color v] effect to (color)\nswitch costume to (costume2 v)\npoint in direction (direction)\nshow\nrepeat (30)\n    change [ghost v] effect by (6)\nend\ndelete this clone\n\ndefine turn\nrepeat (5)\n    change [direction v] by (3)\n    change [color v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [next level v]\nset [direction v] to [90]\nset [color v] to [0]\ngo to x: (00) y: (0)\npoint in direction (90)\ngo to [front v] layer\ngo [backward v] (1) layers\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nswitch costume to (costume1 v)\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (100)\ndelete this clone\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [level start v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [next level v]\nforever\n    turn\nend\n\nwhen I receive [boss enter v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@shield\n\nwhen flag clicked\nhide\n\ndefine move/detect\nif <not <<touching (ground v)?> or <<touching (spikes/lava/whatever v)?> or <touching (_edge_ v)?>>>> then\n    repeat (7)\n        move (1) steps\n    end\nend\nif <(direction) > [0]> then\n    switch costume to (costume1 v)\nelse\n    switch costume to (costume2 v)\nend\n\nwhen I receive [captain america v]\nset size to (10) %\nforever\n    if <mouse down?> then\n        show\n        go to (hero v)\n        point towards (mouse-pointer v)\n        move (20) steps\n        repeat until <<touching (ground v)?> or <<touching (spikes/lava/whatever v)?> or <touching (_edge_ v)?>>>\n            move/detect\n            if <<touching (ground v)?> or <<touching (spikes/lava/whatever v)?> or <touching (_edge_ v)?>>> then\n                go to [back v] layer\n            end\n        end\n        move (10) steps\n        if <touching (hero v)?> then\n            hide\n        end\n    end\nend\n\nwhen I receive [next level v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [start v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [next hero v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Iron man pulse\n\nwhen I start as a clone\nshow\ngo to (hero v)\ngo to [back v] layer\nif <([direction v] of [hero v]) = [90]> then\n    point in direction (90)\n    repeat until <<touching (_edge_ v)?> or <<touching (ground v)?> or <touching (mini bosses v)?>>>\n        move (10) steps\n    end\nelse\n    point in direction (-90)\n    repeat until <<touching (_edge_ v)?> or <<touching (ground v)?> or <touching (mini bosses v)?>>>\n        move (10) steps\n    end\nend\nif <touching (mini bosses v)?> then\n    change [boss hp v] by (-1)\n    broadcast (render lives v)\nend\ndelete this clone\n\nwhen I receive [next level v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [start v]\nhide\nstop [other scripts in sprite v]\n\nwhen flag clicked\nhide\n\nwhen I receive [iron man v]\nhide\nforever\n    if <key (space v) pressed?> then\n        create clone of (_myself_ v)\n        wait (0.75) seconds\n    end\nend\n\nwhen I receive [next hero v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@hulk smash\n\nwhen I start as a clone\ngo to (hero v)\nshow\nrepeat (15)\n    change size by (20)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen I receive [the hulk v]\nhide\nforever\n    if <key (space v) pressed?> then\n        create clone of (_myself_ v)\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I receive [start v]\nhide\nrepeat (10)\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen I receive [level setup v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [menu v]\nhide\nrepeat (10)\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen flag clicked\nhide\nrepeat (10)\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen I receive [restart v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [next hero v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@box\n\nwhen I start as a clone\nif <(type) = [1]> then\n    if <(build) = [1]> then\n        set [build v] to [0]\n        show\n        set [byv v] to [0]\n        repeat until <<touching (hulk smash v)?> or <<touching (laser v)?> or <<touching (iron man pulse v)?> or >>>\n            change y by (byv)\n            if <<touching (ground v)?> or <<touching (hero v)?> or <<(y position) > [175]> or <touching (box v)?>>>> then\n                change y by ((byv) * (-1))\n                set [byv v] to [0]\n            end\n            change [byv v] by (-1)\n        end\n        smashed\n        delete this clone\n    else\n        delete this clone\n    end\nelse\n    show\n    set [byv v] to [0]\n    set rotation style [left-right v]\n    forever\n        if <<key (w v) pressed?> or <<key (d v) pressed?> or <key (a v) pressed?>>> then\n            switch costume to ((#c) + (4))\n            if <key (a v) pressed?> then\n                change x by (-5)\n                if <<touching (ground v)?> or <<touching (hero v)?> or <touching (box v)?>>> then\n                    change x by (5)\n                end\n            end\n            if <key (d v) pressed?> then\n                change x by (5)\n                if <<touching (ground v)?> or <<touching (hero v)?> or <touching (box v)?>>> then\n                    change x by (-5)\n                end\n            end\n            if <key (w v) pressed?> then\n                change [byv v] by (1)\n            end\n        else\n            switch costume to (#c)\n        end\n        if <not <key (w v) pressed?>> then\n            change [byv v] by (-1)\n        end\n        change y by (byv)\n        if <<touching (ground v)?> or <<touching (hero v)?> or <touching (box v)?>>> then\n            change y by ((byv) * (-1))\n            set [byv v] to [0]\n        end\n        if <<(y position) > [175]> or <touching (box v)?>> then\n            set [byv v] to [0]\n        end\n    end\nend\n\ndefine smashed\nset [#x v] to (x position)\nset [#y v] to (y position)\nbroadcast (# v)\n\ndefine block #: (costume) at X: (x) Y: (y) Type (type)\nset [build v] to [1]\ngo to x: (x) y: (y)\nset [#c v] to (costume)\nswitch costume to (costume)\nset [type v] to (type)\ncreate clone of (_myself_ v)\n\nwhen I receive [level setup v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [start v]\nhide\nrepeat (10)\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen flag clicked\nhide\nrepeat (10)\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen I receive [menu v]\nhide\nrepeat (10)\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen I receive [level start v]\nplace boxes\n\ndefine place boxes\nif <(level #) = [6]> then\n    block #: [4] at X: [10] Y: [-102] Type [1]\nelse\n    if <(level #) = [7]> then\n        block #: [4] at X: [10] Y: [-102] Type [1]\n        block #: [4] at X: [10] Y: [50] Type [1]\n    else\n        if <(level #) = [9]> then\n            block #: [3] at X: [30] Y: [-130] Type [1]\n            block #: [3] at X: [70] Y: [-130] Type [1]\n            block #: [3] at X: [30] Y: [-90] Type [1]\n            block #: [3] at X: [70] Y: [-90] Type [1]\n            block #: [3] at X: [30] Y: [-50] Type [1]\n            block #: [3] at X: [70] Y: [-50] Type [1]\n            block #: [3] at X: [30] Y: [-10] Type [1]\n            block #: [3] at X: [70] Y: [-10] Type [1]\n            block #: [3] at X: [30] Y: [30] Type [1]\n            block #: [3] at X: [70] Y: [30] Type [1]\n        else\n            if <(level #) = [11]> then\n                block #: [4] at X: [0] Y: [0] Type [2]\n            else\n                if <(level #) = [12]> then\n                    block #: [3] at X: [-220] Y: [0] Type [2]\n                else\n                    if <(level #) = [13]> then\n                        block #: [1] at X: [-60] Y: [0] Type [2]\n                        block #: [1] at X: [60] Y: [0] Type [2]\n                    else\n                        if <(level #) = [14]> then\n                            block #: [3] at X: [-150] Y: [75] Type [2]\n                        else\n                            if <(level #) = [15]> then\n                                block #: [3] at X: [0] Y: [-100] Type [2]\n                            else\n                                if <(level #) = [17]> then\n                                    block #: [3] at X: [0] Y: [-130] Type [1]\n                                    block #: [3] at X: [0] Y: [-90] Type [1]\n                                    block #: [3] at X: [0] Y: [-50] Type [1]\n                                    block #: [3] at X: [0] Y: [-10] Type [1]\n                                    block #: [3] at X: [0] Y: [30] Type [1]\n                                    block #: [3] at X: [0] Y: [70] Type [1]\n                                    block #: [3] at X: [0] Y: [110] Type [1]\n                                    block #: [3] at X: [0] Y: [150] Type [1]\n                                else\n                                    if <(level #) = [21]> then\n                                        block #: [4] at X: [120] Y: [-50] Type [1]\n                                        block #: [4] at X: [10] Y: [-50] Type [1]\n                                        block #: [4] at X: [-100] Y: [-50] Type [1]\n                                    else\n                                        if <(level #) = [23]> then\n                                            block #: [2] at X: [128] Y: [100] Type [1]\n                                            block #: [3] at X: [136] Y: [170] Type [1]\n                                        else\n                                            if <(level #) = [26]> then\n                                                block #: [4] at X: [60] Y: [-50] Type [1]\n                                                block #: [4] at X: [-50] Y: [-50] Type [1]\n                                            else\n                                                if <(level #) = [29]> then\n                                                    block #: [2] at X: [180] Y: [-120] Type [1]\n                                                    block #: [2] at X: [180] Y: [-40] Type [1]\n                                                    block #: [2] at X: [-205] Y: [150] Type [1]\n                                                    block #: [2] at X: [-205] Y: [65] Type [1]\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [restart v]\nhide\nrepeat (10)\n    delete this clone\nend\nplace boxes\n\nblock #: [3] at X: [136] Y: [170] Type [1]\n\n@boss entrance\n\nwhen I receive [start v]\nhide\nstop [other scripts in sprite v]\n\nwhen flag clicked\nhide\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [boss enter v]\nclear graphic effects\nshow\ngo to x: (0) y: (0)\nset [nothing v] to [1]\nswitch costume to (costume1 v)\ngo to [front v] layer\nset [1 v] to [15]\nrepeat (3)\n    create clone of (_myself_ v)\n    wait (0.1) seconds\n    change [1 v] by (-20)\nend\nwait until <(nothing) = [0]>\nset [brightness v] effect to (1)\nrepeat (25)\n    change [brightness v] effect by (1)\nend\nswitch costume to (costume4 v)\nrepeat (75)\n    change [color v] effect by (5)\nend\nset [entrance v] to [0]\nrepeat (35)\n    change [color v] effect by (5)\nend\nrepeat (50)\n    change [color v] effect by (5)\n    change [ghost v] effect by (2)\nend\nhide\n\nwhen I start as a clone\nswitch costume to (costume3 v)\nset size to (300) %\nset [brightness v] effect to (1)\ngo to [front v] layer\nshow\nswitch costume to (costume2 v)\ngo to x: (4000) y: (0)\nset [xv v] to [-28]\nrepeat (65)\n    change x by (xv)\n    set [xv v] to ((xv) * (0.97))\nend\nset [nothing v] to [0]\ndelete this clone\n\nchange [brightness v] effect by (-50)\n\n@boulders\n\ndefine spikes\nset [player hurt? v] to [0]\nhide\nset [type v] to [1]\ngo to x: (-230) y: (-180)\nset [id v] to [10]\nrepeat (11)\n    create clone of (_myself_ v)\n    change [id v] by (-1)\n    change x by (20)\nend\nchange x by (20)\nchange [id v] by (1)\nrepeat (13)\n    create clone of (_myself_ v)\n    change [id v] by (1)\n    change x by (20)\nend\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nif <(type) = [1]> then\n    point in direction (90)\n    switch costume to (costume1 v)\n    wait ((id) * (0.175)) seconds\n    repeat (7)\n        change y by (10)\n        if <touching (hero v)?> then\n            set [player hurt? v] to [1]\n        end\n    end\n    repeat (7)\n        change y by (-10)\n        if <touching (hero v)?> then\n            set [player hurt? v] to [1]\n        end\n    end\n    broadcast (render lives v)\n    delete this clone\nelse\n    if <(selected ch) = [2]> then\n        switch costume to (costume2 v)\n        go to (mini bosses v)\n        change y by (50)\n        set [boulder xv v] to ((([x position v] of [hero v]) - (x position)) / (15))\n        set [boulder yv v] to ((3) + ((distance to [hero v]) / (25)))\n        repeat until <<touching (ground v)?> or <<touching (hero v)?> or <touching (hulk smash v)?>>>\n            change y by (boulder yv)\n            change x by (boulder xv)\n            set [boulder xv v] to ((boulder xv) * (0.95))\n            change [boulder yv v] by (-1)\n        end\n        if <touching (hulk smash v)?> then\n            set [boulder xv v] to ((([x position v] of [mini bosses v]) - (x position)) / (15))\n            set [boulder yv v] to ((3) + ((distance to [mini bosses v]) / (25)))\n            repeat until <touching (mini bosses v)?>\n                change y by (boulder yv)\n                change x by (boulder xv)\n                set [boulder xv v] to ((boulder xv) * (0.95))\n                change [boulder yv v] by (-1)\n            end\n            change [boss hp v] by (-1)\n            broadcast (render lives v)\n            delete this clone\n        else\n            if <touching (hero v)?> then\n                change [player hp v] by (-1)\n                broadcast (render lives v)\n                delete this clone\n            else\n                delete this clone\n            end\n        end\n    else\n        set size to (80) %\n        switch costume to (costume3 v)\n        go to (thanos v)\n        change y by (50)\n        if <(#5) = [0]> then\n            glide (1) secs to x: (#2) y: (([y position v] of [thanos v]) + (180))\n            reset timer\n            repeat (((10) * (pick random (1) to (10))) + (100))\n                turn right (((#2) / (50)) + (1)) degrees\n                go to x: (#2) y: (([y position v] of [thanos v]) + (180))\n            end\n        else\n            glide (1) secs to x: (#2) y: (([y position v] of [thanos v]) + (80))\n            repeat ((pick random (1) to (10)) * (10))\n                turn right (((#2) / (50)) + (1)) degrees\n                go to x: (#2) y: (([y position v] of [thanos v]) + (80))\n            end\n        end\n        switch costume to (costume2 v)\n        set [#1 v] to [0]\n        repeat until <<touching (hero v)?> or <<touching (thanos v)?> or <touching (ground v)?>>>\n            change y by (#1)\n            change [#1 v] by (-0.25)\n        end\n        if <touching (hero v)?> then\n            change [player hp v] by (-1)\n            broadcast (render lives v)\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [mini boss main attack v]\nrepeat (1)\n    delete this clone\nend\nif <(selected ch) = [2]> then\n    spikes\nend\n\ndefine stone\nhide\nset [type v] to [0]\ncreate clone of (_myself_ v)\n\nwhen I receive [mini boss special attack v]\nrepeat (1)\n    delete this clone\nend\nif <(selected ch) = [2]> then\n    stone\nend\n\nwhen I receive [stone v]\nrepeat (1)\n    delete this clone\nend\nif <(Selected Stone) = [2]> then\n    power\nend\n\ndefine power\nset [next stone? v] to [1]\nset [#2 v] to [-180]\nset [#5 v] to [0]\nrepeat (6)\n    stone\n    change [#2 v] by (75)\nend\nset [#2 v] to [-180]\nset [#5 v] to [1]\nrepeat (6)\n    stone\n    change [#2 v] by (75)\nend\nwait (11) seconds\nset [next stone? v] to [0]\n\nwhen I receive [start v]\nrepeat (1)\n    delete this clone\nend\n\npower\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Lives\n\nwhen I receive [boss enter v]\nset [hurtable v] to [1]\nshow\nset [boss hp v] to [3]\nset [player hp v] to [3]\nrender lives\n\ndefine render lives\ngo to [front v] layer\nrepeat (1)\n    delete this clone\nend\nswitch costume to (costume1 v)\nset size to (15) %\ngo to x: (23) y: (-170)\nrepeat (player hp)\n    create clone of (_myself_ v)\n    change x by (25)\nend\ngo to x: (166) y: (-170)\nrepeat (boss hp)\n    create clone of (_myself_ v)\n    change x by (25)\nend\ngo to x: (71) y: (-170)\nshow\nswitch costume to (costume2 v)\nset size to (100) %\n\nwhen I receive [start v]\nhide\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [render lives v]\nif <(selected ch) = [7]> then\n    booooos\nelse\n    render lives\nend\n\nwhen I receive [boss beat v]\nhide\ndelete this clone\n\nwhen I receive [menu v]\nhide\ndelete this clone\n\nwhen I receive [render lives v]\nrepeat (1)\n    delete this clone\nend\nif <<<(player hurt?) = [1]> and <(hurtable) = [1]>> and <(selected ch) = [2]>> then\n    change [player hp v] by (-1)\n    set [hurtable v] to [0]\nend\n\nwhen I receive [mini boss main attack v]\nset [hurtable v] to [1]\n\nwhen I receive [final battle v]\nset [hurtable v] to [1]\nshow\nset [boss hp v] to [3]\nset [player hp v] to [6]\nbooooos\n\ndefine booooos\ngo to [front v] layer\ngo [backward v] (2) layers\nrepeat (1)\n    delete this clone\nend\nswitch costume to (costume1 v)\nset size to (15) %\ngo to x: (-60) y: (-170)\nrepeat (player hp)\n    create clone of (_myself_ v)\n    change x by (25)\nend\ngo to x: (166) y: (-170)\nrepeat (boss hp)\n    create clone of (_myself_ v)\n    change x by (25)\nend\ngo to x: (71) y: (-170)\nshow\nswitch costume to (costume3 v)\nset size to (100) %\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@missiles\n\nwhen I start as a clone\nset [# v] to [0]\ngo to [back v] layer\ngo [forward v] (3) layers\nset rotation style [all around v]\nshow\ngo to (mini bosses v)\npoint in direction (-90)\nrepeat until <<touching (hero v)?> or <<touching (iron man pulse v)?> or <<touching (ground v)?> or <(x position) < [-235]>>>>\n    point towards (hero v)\n    move (4) steps\nend\nif <touching (hero v)?> then\n    change [player hp v] by (-1)\n    broadcast (render lives v)\n    delete this clone\nend\ndelete this clone\n\nwhen I receive [heli attack v]\nif <(#) = [1]> then\n    hide\n    repeat (6)\n        create clone of (_myself_ v)\n        wait (0.5) seconds\n    end\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [boss beat v]\nstop [other scripts in sprite v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [menu v]\nstop [other scripts in sprite v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [level start v]\nset [# v] to [1]\n\n@Enemies\n\nwhen flag clicked\nhide\n\ndefine enemy move <move> speed (speed) shoot? <shoot?> bullet speed (bspeed) direction (direction) X and Y pos (x) (y) (x2) (wait)\nswitch costume to (costume1 v)\ngo to x: (x) y: (y)\nset rotation style [left-right v]\npoint in direction (direction)\nset [wait v] to (wait)\nif <move> then\n    set [x1 v] to (x)\n    set [y1 v] to (y)\n    set [x2 v] to (x2)\n    set [move? v] to [1]\n    set [speed v] to (speed)\nelse\n    set [move? v] to [0]\n    set [speed v] to [0]\nend\nif <shoot?> then\n    set [shoot v] to [1]\n    set [bullet speed v] to (bspeed)\nelse\n    set [shoot v] to [0]\n    set [bullet speed v] to [0]\nend\nset [enemy? v] to [1]\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\nshow\nif <(exclusive?) = [1]> then\n    go to [front v] layer\n    point in direction (90)\n    glide (3) secs to x: (200) y: (y position)\n    delete this clone\nelse\n    if <(enemy?) = [0]> then\n        bullet\n    else\n        set [enemy? v] to [0]\n        set [timer v] to [0]\n        forever\n            if <<(shoot) = [1]> and <(timer) = (wait)>> then\n                create clone of (_myself_ v)\n                set [timer v] to [0]\n            else\n                change [timer v] by (1)\n            end\n            if <(move?) = [1]> then\n                move (speed) steps\n                if <<(x position) > (x1)> and <(x position) > (x2)>> then\n                    point in direction (-90)\n                else\n                    if <<(x position) < (x1)> and <(x position) < (x2)>> then\n                        point in direction (90)\n                    end\n                end\n                if <<touching (box v)?> or <touching (ground v)?>> then\n                    point in direction ((direction) * (-1))\n                    move\n                end\n            end\n        end\n    end\nend\n\ndefine bullet\nswitch costume to (costume2 v)\nrepeat until <<touching (ground v)?> or <<touching (_edge_ v)?> or >>\n    move (bullet speed) steps\nend\ndelete this clone\n\ndefine place enemies\nset [exclusive? v] to [0]\nif <(level #) = [21]> then\n    enemy move <(level #) = [21]> speed [5] shoot? <(level #) = [21]> bullet speed [7] direction [90] X and Y pos [-75] [90] [150] [30]\nelse\n    if <(level #) = [22]> then\n        enemy move <[0] = [1]> speed [4] shoot? <[1] = [1]> bullet speed [20] direction [90] X and Y pos [-200] [150] [50] [1]\n        enemy move <[1] = [1]> speed [4] shoot? <[1] = [1]> bullet speed [10] direction [90] X and Y pos [-100] [-50] [50] [4]\n        enemy move <[1] = [1]> speed [4] shoot? <[1] = [1]> bullet speed [10] direction [90] X and Y pos [-100] [0] [50] [4]\n        enemy move <[1] = [1]> speed [4] shoot? <[1] = [1]> bullet speed [10] direction [90] X and Y pos [-100] [50] [50] [4]\n        enemy move <[1] = [1]> speed [4] shoot? <[1] = [1]> bullet speed [10] direction [90] X and Y pos [-100] [100] [50] [4]\n    else\n        if <(level #) = [23]> then\n            enemy move <[1] = [1]> speed [5] shoot? <[] = [21]> bullet speed [7] direction [90] X and Y pos [190] [140] [-200] [30]\n        else\n            if <(level #) = [24]> then\n                grid\n            else\n                if <(level #) = [25]> then\n                    enemy move <[1] = [1]> speed [5] shoot? <[21] = [21]> bullet speed [7] direction [90] X and Y pos [-50] [0] [50] [30]\n                    enemy move <[1] = [1]> speed [5] shoot? <[21] = [21]> bullet speed [7] direction [90] X and Y pos [-50] [150] [50] [30]\n                else\n                    if <(level #) = [26]> then\n                        enemy move <[0] = [1]> speed [5] shoot? <[0] = [21]> bullet speed [7] direction [-90] X and Y pos [130] [-130] [50] [30]\n                    else\n                        if <(level #) = [27]> then\n                            enemy move <[0] = [1]> speed [5] shoot? <[0] = [21]> bullet speed [7] direction [-90] X and Y pos [-95] [-40] [50] [30]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\nhide\nrepeat (10)\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen I receive [menu v]\nhide\nrepeat (10)\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen flag clicked\nhide\nrepeat (10)\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen I receive [level setup v]\nwait (0.1) seconds\nwait until <(loading y) = [0]>\nplace enemies\n\nwhen I receive [level setup v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [restart v]\nhide\nrepeat (10)\n    delete this clone\nend\nplace enemies\n\nwhen I start as a clone\nif <(exclusive?) = [1]> then\n    wait until <<touching (laser v)?> or <<touching (_edge_ v)?> or <<touching (stormbreaker v)?> or <<touching (hero v)?> or <touching (ground v)?>>>>>\nelse\n    wait until <<touching (laser v)?> or <<touching (_edge_ v)?> or >>\nend\nif <touching (hero v)?> then\n    change [player hp v] by (-1)\n    broadcast (render lives v)\nend\ndelete this clone\n\ndefine move\nrepeat until <not <<touching (box v)?> or <touching (ground v)?>>>\n    move (1) steps\nend\n\ndefine grid\ngo to x: (-200) y: (140)\nrepeat (6)\n    repeat (3)\n        enemy move <[0] = [1]> speed [5] shoot? <[] = [21]> bullet speed [7] direction [90] X and Y pos (x position) (y position) [] [30]\n        change y by (-120)\n    end\n    change x by (80)\n    set y to (140)\nend\n\nwhen I receive [stone v]\nif <(Selected Stone) = [3]> then\n    repeat (4)\n        wait (2) seconds\n        space stone\n    end\nelse\n    delete this clone\nend\n\ndefine space stone\nset [exclusive? v] to [1]\ngo to x: (-200) y: (140)\nrepeat (4)\n    create clone of (_myself_ v)\n    change y by (-85)\nend\nset [exclusive? v] to [1]\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [boss beat v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@laser\n\ndefine render laser\nmove (10) steps\nset y to (([y position v] of [hero v]) + (10))\n\nwhen I receive [vision v]\nforever\n    pen up\n    if <key (space v) pressed?> then\n        create clone of (_myself_ v)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I start as a clone\nshow\ngo to [back v] layer\ngo to x: ([x position v] of [hero v]) y: (([y position v] of [hero v]) + (10))\npoint in direction ([direction v] of [hero v])\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    render laser\nend\ndelete this clone\n\nwhen I receive [menu v]\nstop [other scripts in sprite v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [level setup v]\nstop [other scripts in sprite v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [next hero v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Stormbreaker\n\ndefine remove right\nrepeat until <not <<color (#ba7608) is touching (#000000)?> and <touching (ground v)?>>>\n    change x by (-1)\nend\n\ndefine throw right\nset size to (100) %\nswitch costume to (costume2 v)\ngo to (hero v)\nchange y by (20)\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    change x by (20)\n    turn right (87) degrees\nend\nswitch costume to (costume1 v)\nset size to (135) %\npoint in direction (135)\nremove right\n\ndefine throw left\nset size to (100) %\nswitch costume to (costume2 v)\ngo to (hero v)\nchange y by (20)\nrepeat until <<touching (ground v)?> or <touching (_edge_ v)?>>\n    change x by (-20)\n    turn right (-87) degrees\nend\nswitch costume to (costume3 v)\nset size to (135) %\npoint in direction (45)\nremove left\n\ndefine remove left\nrepeat until <not <<color (#ba7608) is touching (#000000)?> and <touching (ground v)?>>>\n    change x by (1)\nend\n\nwhen I receive [return hammer v]\nset rotation style [don't rotate v]\nset [hammer speed v] to [3]\nrepeat until <<(#playing) = [0]> or <touching (hero v)?>>\n    point towards (hero v)\n    move (Hammer speed) steps\n    if <(Hammer speed) < [15]> then\n        change [hammer speed v] by (1)\n    end\nend\nhide\n\nwhen I receive [start v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [level setup v]\nif <not <<(selected lvl) = [5]> or <<(selected ch) = [7]> and <(selected lvl) = [1]>>>> then\n    hide\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen I receive [restart v]\ngo to (hero v)\n\nwhen [space v] key pressed\nif <<(#playing) = [1]> and <<(selected ch) = [6]> or <(selected ch) = [7]>>> then\n    wait until <key (space v) pressed?>\n    set rotation style [all around v]\n    show\n    stop [other scripts in sprite v]\n    erase all\n    if <([direction v] of [hero v]) = [90]> then\n        throw right\n    else\n        throw left\n    end\n    wait (1) seconds\n    broadcast (return hammer v)\nend\n\nwhen I receive [boss loss v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@loki thing\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nset [id v] to [1]\nhide\nstop [other scripts in sprite v]\nrepeat (300)\n    delete this clone\nend\n\nwhen I receive [loki mad v]\nif <(id) = [1]> then\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(selected ch) = [6]> then\n    set [id v] to [0]\n    show\n    go to (mini bosses v)\n    set size to (150) %\n    point in direction (180)\n    go to [front v] layer\n    set [yv v] to [0]\n    repeat until <<touching (ground v)?> or <<touching (_edge_ v)?> or <touching (hero v)?>>>\n        change y by (yv)\n        change [yv v] by (-1)\n    end\n    if <touching (hero v)?> then\n        change [player hp v] by (-1)\n        broadcast (render lives v)\n        delete this clone\n    end\n    hide\n    delete this clone\nelse\n    set [id v] to [0]\n    show\n    go to (thanos v)\n    point towards (hero v)\n    set size to (150) %\n    go to [front v] layer\n    set [yv v] to [0]\n    repeat until <<touching (ground v)?> or <<touching (_edge_ v)?> or <touching (hero v)?>>>\n        move (5) steps\n    end\n    if <touching (hero v)?> then\n        change [player hp v] by (-1)\n        broadcast (render lives v)\n    end\n    hide\n    delete this clone\nend\n\nwhen I receive [next hero v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [stone v]\nset [time stop? v] to [0]\nif <(Selected Stone) = [1]> then\n    set [time stop? v] to [1]\n    repeat (6)\n        create clone of (_myself_ v)\n        wait (2) seconds\n    end\n    wait (4) seconds\n    set [next stone? v] to [0]\n    set [time stop? v] to [0]\nend\n\nwhen I receive [boss beat v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Thanos\n\nwhen I receive [final battle v]\nclear graphic effects\nset [#soul v] to [1]\nset [reality v] to [0]\nwait (4) seconds\nshow\nwait (8) seconds\nset [next stone? v] to [0]\nset [selected stone v] to [0]\nforever\n    set [selected stone v] to [0]\n    repeat (6)\n        wait until <(next stone?) = [0]>\n        change [selected stone v] by (1)\n        broadcast (Stone v)\n        set [next stone? v] to [1]\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen I receive [final battle v]\nset rotation style [left-right v]\npoint in direction (-90)\ngo to x: (200) y: (-70)\nset [yv v] to [0]\nforever\n    if <(#soul) = [0]> then\n    else\n        if <(Reality) = [0]> then\n            change y by (yv)\n            if <(y position) > [-80]> then\n                change [yv v] by (-0.25)\n            else\n                change [yv v] by (0.25)\n            end\n        else\n            repeat until <(y position) > [80]>\n                change y by (yv)\n                change [yv v] by (0.25)\n            end\n            wait until <(Reality) = [0]>\n            wait (4) seconds\n            set [yv v] to [0]\n            repeat until <[-60] > (y position)>\n                change y by (yv)\n                change [yv v] by (-0.25)\n            end\n            set [yv v] to [0]\n        end\n    end\nend\n\nchange [selected stone v] by (1)\nif <(Selected Stone) = [7]> then\nwait (5) seconds\n\nset [selected stone v] to [4]\nbroadcast (Stone v)\n\nset [next stone? v] to [0]\n\nwhen I receive [stone v]\nif <(Selected Stone) = [5]> then\n    set [#soul v] to [0]\n    Clone\n    glide (1) secs to x: (pick random (-200) to (200)) y: (pick random (-100) to (100))\n    wait until <touching (stormbreaker v)?>\n    change [boss hp v] by (-1)\n    broadcast (render lives v)\n    glide (1) secs to x: (200) y: (-70)\n    set [#soul v] to [1]\n    wait (4) seconds\n    set [next stone? v] to [0]\nend\n\ndefine Clone\nrepeat (10)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset rotation style [left-right v]\nif <(pick random (0) to (1)) = [1]> then\n    point in direction (90)\nelse\n    point in direction (-90)\nend\nglide (1) secs to x: (pick random (-200) to (200)) y: (pick random (-100) to (100))\nwait until <<(#soul) = [1]> or <touching (stormbreaker v)?>>\ndelete this clone\n\ngo to x: (200) y: (-70)\n\ndefine win\nif <(boss hp) < [1]> then\n    broadcast (Boss Beat v)\n    repeat (50)\n        change y by (2)\n        change [ghost v] effect by (2)\n    end\n    stop [other scripts in sprite v]\nelse\n    broadcast (boss loss v)\n    wait (2) seconds\n    broadcast (menu v)\nend\nstop [this script v]\n\nwhen I receive [final battle v]\nwait until <<(player hp) < [1]> or <(boss hp) < [1]>>\nwin\n\nwhen I receive [menu v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nset [boss hp v] to [0]\n\n@Stones effect\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nhide\n\ndefine glow (#)\nswitch costume to (costume1 v)\nset size to (175) %\nswitch costume to (#)\nset [ghost v] effect to (100)\nshow\nset [# v] to [13]\nrepeat (13)\n    go to [front v] layer\n    change [ghost v] effect by ((#) * (-1))\n    change [# v] by (-1)\nend\nwait (3) seconds\nrepeat (13)\n    go to [front v] layer\n    change [ghost v] effect by ((#) * (1))\n    change [# v] by (1)\nend\nhide\n\nwhen I receive [stone v]\nglow (Selected Stone)\n\n@Portals\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\n\nwhen I receive [stone v]\nif <(Selected Stone) = [3]> then\n    go to x: (-200) y: (140)\n    repeat (4)\n        Clone at x: (x position) y: (y position)\n        change y by (-85)\n    end\n    wait (15) seconds\n    set [next stone? v] to [0]\nend\n\nwhen I start as a clone\nwait (10) seconds\ndelete this clone\n\nwhen I receive [boss beat v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@lava\n\nwhen I receive [stone v]\nstop [other scripts in sprite v]\nbroadcast (check v)\nif <<(Selected Stone) = [4]> or <(Selected Stone) = [6]>> then\n    go to x: (0) y: (-444444444)\n    wait (5) seconds\n    show\n    repeat (200)\n        change y by (1)\n    end\n    wait (5) seconds\n    repeat (200)\n        change y by (-1)\n    end\n    hide\nend\n\nwhen flag clicked\nstop [other scripts in sprite v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nhide\nrepeat (10)\n    delete this clone\nend\n\nwhen I receive [check v]\nif <<(Selected Stone) = [4]> or <(Selected Stone) = [6]>> then\n    forever\n        wait until <touching (hero v)?>\n        change [player hp v] by (-1)\n        broadcast (render lives v)\n        wait until <not <touching (hero v)?>>\n    end\nend\n\nwhen I receive [boss beat v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Sprite2\n\nwhen I receive [# v]\nif <(#1) = [1]> then\n    clone\nelse\nend\n\nwhen flag clicked\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [level start v]\nset [#1 v] to [1]\nhide\n\nwhen I start as a clone\nshow\nclear graphic effects\nset [#2 v] to [1]\nset [#1 v] to [0]\nset [xv v] to (pick random (-10) to (10))\nset [yv v] to (pick random (1) to (4))\nrepeat (60)\n    change x by (xv)\n    set [xv v] to ((xv) * (0.9))\n    if <<(#2) = [1]> or <not <touching (ground v)?>>> then\n        change y by (yv)\n        change [yv v] by (-0.5)\n    end\n    change [ghost v] effect by (1)\n    if <touching (ground v)?> then\n        set [yv v] to [0]\n        ground\n    end\nend\ndelete this clone\n\ndefine clone\ngo to x: (#x) y: (#y)\nrepeat (pick random (3) to (4))\n    create clone of (_myself_ v)\nend\n\nwhen I receive [start v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\ndefine ground\nset [# v] to [0]\nrepeat until <<(#) > [15]> or <not <touching (ground v)?>>>\n    change y by (1)\n    change [# v] by (1)\nend\nif <touching (ground v)?> then\n    change y by (-15)\n    set [xv v] to ((xv) * (-0.5))\n    change x by ((xv) * (2))\nelse\nend\n\n
Welcome to my largest ever scratch project, a platformer where you get to play as various Avengers from the MCU (Marvel Cinematic Universe).\nIt contains:\n30 levels\n3 mini boss fights\n1 final boss fight (THANOS)\n6 different heroes with assorted powers\nAll the instructions for how to move are in the project.\nPress p while you are in a level to skip it.\nPress r to restart the level\nThe Button to access the final boss appears in the level select area, it takes a second to load in.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAlso, I have the code for some other heroes, so if you want me to make a sequel please tell me.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAnd I know it's inaccurate, so please don't comment on how both Vision and Thanos have a Mind Stone.\n\n#game #games #isthishowtagswork? #avengers #marvel #thor #ironman #captainamerica #platformer #thanos