The Cure | A Platformer

Instructions: #3 of the Disaster series.\nThe story: You travelled across the city and you retrieved the cure! You have now put on your hazmat suit and shrunk yourself into an infected's bloodstream to distribute the cure. Can you save everyone?\n\nControls:\nArrow keys or WASD to move. Press the down arrow key or s to crouch.\nPressing space will skip a level but adds 10 seconds to your time. \nAvoid the white blood cells(the moving one and the white patches).

@Stage\n\nwhen flag clicked\nstop all sounds\nforever\n    play sound [Dramatic6 v] until done\n    play sound [Dramatic5 v] until done\n    play sound [Dramatic1 v] until done\n    play sound [Dramatic2 v] until done\n    play sound [Dramatic3 v] until done\n    play sound [Dramatic4 v] until done\nend\n\nwhen I receive [next level v]\nnext backdrop\n\nwhen flag clicked\nswitch backdrop to (backdrop3 v)\n\nwhen flag clicked\nforever\n    if <key (space v) pressed?> then\n        broadcast (Next Level v)\n        change [time taken v] by (10)\n        wait (1) seconds\n    end\nend\n\nwhen I receive [start the platformer v]\nrepeat until <(Complete?) = [1]>\n    change [time taken v] by (1)\n    wait (1) seconds\nend\nchange [☁ total infected's saved v] by (1)\n\n@Ground\n\nwhen flag clicked\nset [drawing level finished? v] to [1]\nhide\nswitch costume to (costume3 v)\ngo to x: (-2) y: (5)\ngo to [front v] layer\n\ndefine Touch Ground <up?>\nchange [falling v] by (1)\nrepeat until <not <touching (ground v)?>>\n    change y by (1)\n    set [falling v] to [0]\n    set [speed y v] to [0]\nend\n\nwhen I receive [next level v]\nnext costume\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [8]> then\n        broadcast (Show Fake Lava v)\n    end\nend\n\nwhen flag clicked\nset [time taken v] to [0]\nforever\n    if <(costume [number v]) = [9]> then\n        broadcast (Hide Next Level v)\n    end\nend\n\nwhen I receive [start the platformer v]\nswitch costume to (costume3 v)\nshow\n\nwhen [timer v] > (0.4)\nhide variable [deaths v]\nhide variable [time taken v]\nhide\n\nwhen flag clicked\nforever\n    if <not <(costume [number v]) = [8]>> then\n        broadcast (Hide Fake Lava v)\n    else\n        broadcast (Show Fake Lava v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [2]> then\n        broadcast (Acid Rain Residue coordinates v)\n    end\nend\n\nbroadcast (Drawing Level  v)\n\nwhen flag clicked\nset pen size to (10)\nerase all\nset pen color to (#767676)\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [3]> then\n        broadcast (ARRc2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [3]> then\n        broadcast (Acid Rain Residue coordinates Lv3 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [2]> then\n        broadcast (Acid Rain Residue Lv2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [5]> then\n        broadcast (Acid Rain Residue Lv5 v)\n    end\nend\n\nforever\n    if <(costume [number v]) = [6]> then\n        broadcast (Show Portal v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [4]> then\n        broadcast (Acid Rain Residue Lv4 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [6]> then\n        broadcast (Acid Rain Residue Lv6 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [12]> then\n        broadcast (Show Heart v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [5]> then\n        broadcast (New blood cell v)\n    end\nend\n\nwhen flag clicked\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [8]> then\n        broadcast (Hide Moving Platforms v)\n    end\nend\n\nhide\n\n@player\n\nwhen flag clicked\nforever\n    if <touching (backup next level v)?> then\n        broadcast (Next Level v)\n        wait (2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (bouncy v)?> then\n        set [y_vel v] to [20]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(x position) = [237]> then\n        broadcast (Next Level v)\n        go to x: (-210) y: (0)\n    end\nend\n\ndefine walls\nif <not <(t) = [s]>> then\n    if <<(t) < [4]> and <<<touching (ground v)?> or <touching (moving platform v)?>> or <<touching (moving platform2 v)?> or <touching (moving platform3 v)?>>>> then\n        change [t v] by (1)\n        change y by (1)\n        walls\n    else\n        if <(t) = [4]> then\n            change y by (-4)\n            change x by ((-1) * (x_vel))\n            set [x_vel v] to [0]\n        end\n        set [t v] to [s]\n    end\nend\n\nwhen flag clicked\npoint in direction (90)\nhide\n\nwhen I receive [you won v]\nstop [other scripts in sprite v]\n\nwhen I receive [next v]\ngo to x: (-210) y: (0)\nset [x_vel v] to [0]\nset [y_vel v] to [0]\nbroadcast (platform v)\n\nwhen I receive [restart v]\nstop [other scripts in sprite v]\ngo to x: (-210) y: (0)\nset [x_vel v] to [0]\nset [y_vel v] to [0]\nbroadcast (platform v)\n\nif <<touching (not touch v)?> or <<touching (_edge_ v)?> and <(edge) = [1]>>> then\n    broadcast (restart v)\n    wait (0.1) seconds\nend\n\nwhen flag clicked\nforever\n    if <touching (next level v)?> then\n        broadcast (Next Level v)\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-206) y: (-33)\n\nwhen flag clicked\nset [deaths v] to [0]\nforever\n    if <<<<<touching (death v)?> or <touching (white blood cells v)?>> or <touching (white blood cell v)?>> or <touching (acid rain residue3 v)?>> or <touching (acid rain residue4 v)?>> then\n        broadcast (SET WHITE BLOOD CELL'S POS v)\n        go to x: (-206) y: (-33)\n        change [deaths v] by (1)\n        change [☁ worldwide deaths v] by (1)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (portal v)?> then\n        go to x: (-206) y: (-33)\n        broadcast (Next Level v)\n    end\nend\n\nwhen I receive [start the platformer v]\nset rotation style [left-right v]\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x_vel v] by (1)\n        point in direction (90)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x_vel v] by (-1)\n        point in direction (-90)\n    end\n    set [x_vel v] to ((0.815) * (x_vel))\n    change x by (x_vel)\n    set [t v] to [0]\n    walls\n    if <not <(t) = [s]>> then\n        add (t) to [bugs v]\n    end\n    change [y_vel v] by (-0.8)\n    change y by (y_vel)\n    if <<<touching (ground v)?> or <touching (moving platform v)?>> or <<touching (moving platform2 v)?> or <touching (moving platform3 v)?>>> then\n        change y by ((-1) * (y_vel))\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(y_vel) < [0]>> then\n            set [y_vel v] to [12]\n        else\n            set [y_vel v] to [0]\n        end\n    end\n    broadcast (message1 v)\n    check\nend\n\nwhen I receive [start the platformer v]\ngo to [front v] layer\nset [edge v] to [1]\ndelete (all) of [bugs v]\nbroadcast (platform v)\n\nwhen I receive [start the platformer v]\nshow\ngo to x: (-210) y: (0)\nset [x_vel v] to [0]\nset [y_vel v] to [0]\n\nwhen [timer v] > (0.4)\nhide\n\nwhen flag clicked\nset [size check v] to [0]\nforever\n    \n        go to x: (-206) y: (-33)\n        change [deaths v] by (1)\n    end\nend\n\nwhen flag clicked\nhide variable [deaths v]\nhide variable [time taken v]\n\ndefine check\n\nwhen flag clicked\nset [xpos4cells v] to [0]\nset [ypos4cells v] to [0]\nforever\n    set [xpos4cells v] to (x position)\n    set [ypos4cells v] to (y position)\nend\n\nwhen flag clicked\nhide variable [☁ total infected's saved v]\nhide variable [☁ total infected's saved v]\nset [complete? v] to [0]\nforever\n    if <touching (heart v)?> then\n        set [complete? v] to [1]\n        hide\n    end\nend\n\nwhen I receive [complete!! v]\nhide\nshow variable [time taken v]\nshow variable [☁ total infected's saved v]\n\n@Sprite2\n\nwhen flag clicked\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (0)\nset size to (pick random (1.01) to (400)) %\nset [ghost v] effect to (pick random (70) to (100))\ngo to x: (500) y: (pick random (-180.01) to (180))\nglide (pick random (1.01) to (5)) secs to x: (-240) y: (pick random (-180.1) to (180))\nrepeat (10)\n    change [color v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [start the platformer v]\ngo to [front v] layer\nhide\nforever\n    create clone of (_myself_ v)\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nwait (2) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nbroadcast (Start the Platformer v)\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (0) y: (0)\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.4)\ngo to [front v] layer\ngo to x: (0) y: (0)\nshow\n\n@Sprite3\n\nwhen flag clicked\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (0)\nset size to (pick random (1.01) to (400)) %\nset [ghost v] effect to (pick random (70) to (100))\ngo to x: (500) y: (pick random (-180.01) to (180))\nglide (pick random (1.01) to (5)) secs to x: (-240) y: (pick random (-180.1) to (180))\nrepeat (10)\n    change [color v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [start the platformer v]\ngo to [front v] layer\nhide\nforever\n    create clone of (_myself_ v)\nend\n\n@Sprite4\n\nwhen flag clicked\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (0)\nset size to (pick random (1.01) to (400)) %\nset [ghost v] effect to (pick random (70) to (100))\ngo to x: (500) y: (pick random (-180.01) to (180))\nglide (pick random (1.01) to (5)) secs to x: (-240) y: (pick random (-180.1) to (180))\nrepeat (10)\n    change [color v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [start the platformer v]\ngo to [front v] layer\nhide\nforever\n    create clone of (_myself_ v)\nend\n\n@Sprite5\n\nwhen flag clicked\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (0)\nset size to (pick random (1.01) to (400)) %\nset [ghost v] effect to (pick random (70) to (100))\ngo to x: (500) y: (pick random (-180.01) to (180))\nglide (pick random (1.01) to (5)) secs to x: (-240) y: (pick random (-180.1) to (180))\nrepeat (10)\n    change [color v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [start the platformer v]\ngo to [front v] layer\nhide\nforever\n    create clone of (_myself_ v)\nend\n\n@Death\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start the platformer v]\nshow\nforever\n    go to [front v] layer\nend\n\nwhen [timer v] > (0.4)\nhide\n\nwhen I receive [start the platformer v]\nshow\nforever\n    go to [front v] layer\nend\n\n@White Blood Cells\n\nwhen flag clicked\nswitch costume to (costume2 v)\npoint in direction (90)\ngo to x: (0) y: (0)\nhide\n\nwhen [timer v] > (0.4)\nhide\n\nwhen I receive [start the platformer v]\nshow\nforever\n    go to [front v] layer\nend\n\nwhen I receive [next level v]\nnext costume\n\n@Bouncy\n\nwhen flag clicked\nhide\nswitch costume to (costume11 v)\ngo to x: (0) y: (0)\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start the platformer v]\nshow\nforever\n    go to [front v] layer\nend\n\nwhen [timer v] > (0.4)\nhide\n\n@WHITE BLOOD CELL\n\nwhen I receive [start the platformer v]\nshow\nrepeat until <(Complete?) = [1]>\n    go to [front v] layer\n    glide (2) secs to (random position v)\nend\nhide\n\nwhen I receive [start the platformer v]\nforever\n    go to [front v] layer\nend\n\nwhen [timer v] > (0.4)\nhide\n\nwhen flag clicked\ngo to x: (-209) y: (127)\n\n@Sprite1\n\nwhen I receive [start the platformer v]\nshow\ngo to [front v] layer\nswitch costume to (costume2 v)\nrepeat until <(Complete?) = [1]>\n    glide (0.5) secs to x: ((XPOS4CELLS) - (25)) y: (YPOS4CELLS)\n    glide (0.5) secs to x: ((XPOS4CELLS) - (25)) y: (YPOS4CELLS)\nend\n\nwhen flag clicked\nset size to (15) %\nhide\n\nwhen [timer v] > (0.4)\nhide\n\nwhen flag clicked\nforever\n    if <(Complete?) = [1]> then\n        set size to (40) %\n        glide (1) secs to (heart v)\n        wait (1.5) seconds\n        hide\n        play sound [pop v] until done\n        broadcast (Complete!! v)\n        stop [this script v]\n    end\nend\n\n@Heart\n\nwhen flag clicked\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [show heart v]\nset size to (100) %\nshow\n\nset [fisheye v] effect to (0)\n\nforever\n    change size by (10)\n    wait (0.5) seconds\n    change size by (-10)\nend\n\nrepeat (5)\n\nchange size by (-5)\n\nforever\n    set size to (125) %\nend\n\nchange size by (25)\n\nchange size by (-25)\n\nchange [fisheye v] effect by (-1)\n\nchange [fisheye v] effect by (1)\n\nrepeat (50)\n    change [fisheye v] effect by (1)\nend\nrepeat (50)\n    change [fisheye v] effect by (-1)\nend\n\nrepeat (2)\n\nrepeat (2)\n\nwhen I receive [show heart v]\nforever\n    play sound [heartbeat-1 v] until done\nend\n\nset size to (5) %\n\n@Sprite6\n\nwhen flag clicked\nhide variable [time taken v]\nhide variable [deaths v]\nhide variable [☁ total infected's saved v]\nhide variable [☁ worldwide deaths v]\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [complete!! v]\nshow variable [☁ worldwide deaths v]\nshow variable [deaths v]\nshow\ngo to [front v] layer\n\nwhen [timer v] > (0.4)\nhide variable [time taken v]\nhide variable [deaths v]\nhide variable [☁ total infected's saved v]\nhide variable [☁ worldwide deaths v]\nhide\n\n@Backup Next Level\n\nwhen flag clicked\nhide\n\nwhen I receive [start the platformer v]\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen I receive [failed platformer v]\nhide\n\nwhen [timer v] > (0.4)\nhide\n\nforever\n\n@Music\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nstop all sounds\nforever\n    play sound [Dramatic6 v] until done\n    play sound [Dramatic5 v] until done\n    play sound [Dramatic1 v] until done\n    play sound [Dramatic2 v] until done\n    play sound [Dramatic3 v] until done\n    play sound [Dramatic4 v] until done\nend\n\n