Red: A Platformer, Part II
@Stage\n\nwhen [m v] key pressed\nshow variable [mouse v]\nset [mouse v] to (join (mouse x) (join [,] (mouse y)))\n\nwhen [h v] key pressed\nhide variable [mouse v]\n\nwhen flag clicked\nforever\n    play sound [Starcat - Bipolarity v] until done\n    wait (2) seconds\nend\n\n@Blue\n\ndefine say (text)\nset [say v] to []\nset [letter v] to []\nrepeat (length of (text))\n    change [letter v] by (1)\n    set [say v] to (join (say) (letter (letter) of (text)))\n    wait (0.05) seconds\n    say (say)\nend\nwait (1) seconds\nsay []\n\ndefine (x) (y) (speed) (size)\nrepeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>\n    change x by (((round (x)) - (round (x position))) / (speed))\n    change y by (((round (y)) - (round (y position))) / (speed))\n    change size by (((size) - (size)) / (speed))\nend\ngo to x: (x) y: (y)\nrepeat until <(round (size)) = (round (size))>\n    change size by (((size) - (size)) / (size))\nend\nset size to (size) %\n\ndefine setup\nshow\ngo to [front v] layer\nset rotation style [left-right v]\ngo to x: (-210) y: (-80)\npoint in direction (90)\nset size to (100) %\nset [xvel v] to [0]\nset [yvel v] to [0]\n\nwhen flag clicked\nset [cammode v] to [off]\nclear graphic effects\nset [level v] to [1]\nsetup\nforever\n    if <not <(Level) = [8]>> then\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n            if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(mouse y) < (y position)>>> then\n                point in direction (90)\n                change [xvel v] by (0.5)\n            else\n                point in direction (90)\n                change [xvel v] by (0.75)\n            end\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n            if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(mouse y) < (y position)>>> then\n                point in direction (-90)\n                change [xvel v] by (-0.5)\n            else\n                point in direction (-90)\n                change [xvel v] by (-0.75)\n            end\n        end\n    end\n    set [xvel v] to ((Xvel) * (0.9))\n    change x by (Xvel)\n    if <<touching (level v)?> or <touching (doors v)?>> then\n        change y by (1)\n        if <<touching (level v)?> or <touching (doors v)?>> then\n            change y by (1)\n            if <<touching (level v)?> or <touching (doors v)?>> then\n                change y by (1)\n                if <<touching (level v)?> or <touching (doors v)?>> then\n                    change y by (1)\n                    if <<touching (level v)?> or <touching (doors v)?>> then\n                        change y by (1)\n                        if <<touching (level v)?> or <touching (doors v)?>> then\n                            change y by (1)\n                            if <<touching (level v)?> or <touching (doors v)?>> then\n                                change y by (1)\n                                if <<touching (level v)?> or <touching (doors v)?>> then\n                                    change x by ((Xvel) * (-1))\n                                    change y by (1)\n                                    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                                        if <(Xvel) > [0]> then\n                                            set [xvel v] to [-7]\n                                        else\n                                            set [xvel v] to [7]\n                                        end\n                                        set [yvel v] to [12]\n                                    else\n                                        set [xvel v] to [0]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <not <(Level) = [8]>> then\n        change [yvel v] by (-1)\n        change y by (Yvel)\n    else\n        set [yvel v] to [0]\n    end\n    if <<touching (level v)?> or <touching (doors v)?>> then\n        change y by ((Yvel) * (-1))\n        set [yvel v] to [0]\n    end\n    change y by (-1)\n    if <<touching (level v)?> or <touching (doors v)?>> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [yvel v] to [15]\n        end\n    end\n    change y by (1)\n    if <<(x position) > [239]> or <key (b v) pressed?>> then\n        if <(Level) = [8]> then\n            set [level v] to [1]\n            broadcast (Restart v)\n            setup\n        else\n            change [level v] by (1)\n            broadcast (Next Level v)\n            setup\n        end\n        if <key (b v) pressed?> then\n            wait until <not <key (b v) pressed?>>\n        end\n    end\n    if <touching (spike v)?> then\n        broadcast (Restart v)\n    end\n    if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(mouse y) < (y position)>>> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\n    if <touching color (#ff764a)?> then\n        set [yvel v] to [15]\n    end\nend\n\nwhen flag clicked\nset [level v] to [1]\n\nwhen I receive [yellow ring v]\nset [yvel v] to [15]\n\nwhen I receive [purple ring v]\nset [yvel v] to [9]\n\nwhen I receive [red ring v]\nset [yvel v] to [18]\n\nwhen I receive [restart v]\nsetup\n\nwhen I receive [outro v]\nhide\n\nwhen [c v] key pressed\nif <(CamMode) = [off]> then\n    set [cammode v] to [on]\n    set [ghost v] effect to (50)\nelse\n    set [cammode v] to [off]\n    set [ghost v] effect to (0)\nend\nwait until <not <key (c v) pressed?>>\n\nwhen flag clicked\nwait until <(Level) = [8]>\ngo to x: (-210) y: (-91)\nsay [!?!]\nwait (1) seconds\nrepeat until <(x position) = [99]>\n    [99] [-91] [7] [100]\nend\n\nwhen I receive [dialougue v]\nsay [Ok, thanks!]\nsay [It's time to battle Red Cube, once and for all!]\nbroadcast (Trans v)\n\nwhen flag clicked\nwait until <(Level) = [8]>\nwait (3) seconds\nsay [Not-Orange? What are you doing here?]\nbroadcast (Dialogue v)\n\n@Level\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Spike\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Text\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@ThumbNail\n\nwhen flag clicked\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@Rings\n\nwhen flag clicked\nset [delete all clones? v] to [yes]\nhide\n\ndefine Clone Ring (#) x: (x) y: (y)\ngo to x: (x) y: (y)\nswitch costume to (#)\nset [i v] to (#)\ncreate clone of (_myself_ v)\n\nwhen I receive [next level v]\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nClone Rings\n\nwhen I start as a clone\nshow\nrepeat until <(delete all clones?) = [yes]>\n    if <<touching (blue v)?> and <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <mouse down?>>> then\n        if <(i) = [1]> then\n            broadcast (Yellow Ring v)\n        end\n        if <(i) = [2]> then\n            broadcast (Purple Ring v)\n        end\n        if <(i) = [3]> then\n            broadcast (Red Ring v)\n        end\n    end\nend\ndelete this clone\n\nwhen I receive [restart v]\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nClone Rings\n\nwhen flag clicked\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nClone Rings\n\ndefine Clone Rings\nif <(Level) = [2]> then\n    Clone Ring [2] x: [4] y: [7]\nend\nif <(Level) = [6]> then\n    Clone Ring [1] x: [0] y: [0]\n    Clone Ring [1] x: [100] y: [0]\n    Clone Ring [1] x: [-100] y: [0]\nend\n\nbroadcast (Restart v)\n\n@Sun\n\nwhen flag clicked\ngo to [back v] layer\nreset timer\nforever\n    go to x: (-240) y: (180)\n    set size to ((([sin v] of ((timer) * (160)) ) * (20)) + (120)) %\nend\n\n@Doors\n\nwhen I receive [next level v]\nclear graphic effects\nshow\nnext costume\n\nwhen flag clicked\nswitch costume to (1 v)\n\nwhen I receive [open door v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@Keys\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <touching (blue v)?> then\n        broadcast (Open Door v)\n        hide\n    end\nend\n\n@Enemy\n\nwhen flag clicked\nset [delete all clones? v] to [yes]\nhide\n\ndefine Clone Enemy (#) x: (x) y: (y)\ngo to x: (x) y: (y)\nswitch costume to (#)\nset [i v] to (#)\ncreate clone of (_myself_ v)\n\nwhen I receive [next level v]\nClone Enemies\n\nwhen I start as a clone\npoint in direction (90)\nclear graphic effects\nset size to (100) %\nshow\nset [enemyx v] to [0]\nset [enemyy v] to [0]\ngo to [front v] layer\nrepeat until <(delete all clones?) = [yes]>\n    if <touching (blue v)?> then\n        if <<([y position v] of [blue v]) > ((y position) + (17.5))> and <(costume [name v]) = [1]>> then\n            set [yvel v] to [15]\n            delete this clone\n        else\n            broadcast (Restart v)\n        end\n    end\n    if <(CamMode) = [off]> then\n        change [enemyy v] by (-1)\n        if <([x position v] of [blue v]) < ((x position) - (10))> then\n            change [enemyx v] by ((0) - ((Speed) / (10)))\n            point in direction (-90)\n        end\n        if <((x position) - (-10)) < ([x position v] of [blue v])> then\n            change [enemyx v] by ((Speed) / (10))\n            point in direction (90)\n        end\n        set [enemyx v] to ((Enemyx) * (0.9))\n        change x by (Enemyx)\n        if <touching (level v)?> then\n            change y by (1)\n        end\n        if <touching (level v)?> then\n            change y by (1)\n        end\n        if <touching (level v)?> then\n            change y by (1)\n        end\n        if <touching (level v)?> then\n            change y by (1)\n        end\n        if <touching (level v)?> then\n            change y by (-4)\n            change x by ((Enemyx) * (-1))\n            if <(y position) < ([x position v] of [blue v])> then\n                set [enemyy v] to [10]\n                if <([abs v] of (x) ) = (x)> then\n                    set [enemyx v] to [-10]\n                else\n                    set [enemyx v] to [10]\n                end\n            else\n                set [enemyx v] to [0]\n            end\n        end\n        change y by (Enemyy)\n        if <touching (level v)?> then\n            change y by ((Enemyy) - ((Enemyy) * (2)))\n            set [enemyy v] to [0]\n        end\n        change y by (-1)\n        if <<((y position) - (-50)) < ([x position v] of [blue v])> and <touching (level v)?>> then\n            set [enemyy v] to [14]\n        end\n        change y by (1)\n    end\nend\ndelete this clone\n\nwhen I receive [restart v]\nClone Enemies\n\nwhen flag clicked\nClone Enemies\n\ndefine Clone Enemies\nset [delete all clones? v] to [yes]\nwait (0.1) seconds\nset [delete all clones? v] to [no]\nif <(Level) = [1]> then\n    Clone Enemy [1] x: [200] y: [-25]\n    Clone Enemy [1] x: [150] y: [-25]\nend\nif <(Level) = [2]> then\n    Clone Enemy [1] x: [172] y: [71]\nend\nif <(Level) = [3]> then\n    Clone Enemy [1] x: [194] y: [-24]\nend\nif <(Level) = [4]> then\n    Clone Enemy [2] x: [75] y: [39]\nend\nif <(Level) = [5]> then\n    Clone Enemy [1] x: [-110] y: [72]\n    Clone Enemy [1] x: [181] y: [-78]\nend\nif <(Level) = [6]> then\n    Clone Enemy [1] x: [180] y: [0]\n    Clone Enemy [1] x: [210] y: [0]\nend\nif <(Level) = [7]> then\n    repeat (5)\n        Clone Enemy [1] x: [201] y: [81]\n        wait (0.5) seconds\n    end\nend\nstop [this script v]\n\n@Blackout\n\nwhen flag clicked\nhide\n\nwhen I receive [trans v]\nshow\ngo to [front v] layer\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nbroadcast (Outro v)\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@Outro\n\nwhen I receive [outro v]\nshow\ngo to [front v] layer\nforever\n    go to x: ((mouse x) / (40)) y: ((mouse y) / (40))\nend\n\nwhen flag clicked\nhide\n\n@Decor\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Art Creator\n\n@Not-Orange\n\nwhen flag clicked\ngo to x: (176) y: (-90)\nhide\nwait until <(Level) = [8]>\nshow\n\ndefine say (text)\nset [say v] to []\nset [letter v] to []\nrepeat (length of (text))\n    change [letter v] by (1)\n    set [say v] to (join (say) (letter (letter) of (text)))\n    say (say)\n    wait (0.05) seconds\nend\nwait (1) seconds\nsay []\n\nwhen I receive [dialogue v]\nsay [Red Cube kept us trapped here. He took the rest of us to do an experiment.]\nsay [Here, take this! It's the Shield of Invincibility. It'll be useful for defense.]\nsay [Mayor Green knew you would come to battle Red Cube, so he wanted me to give this to you.]\nsay [And take this too. It is the Orb of Perellius.]\nsay [It'll give you unlimited power when you press the space key.]\nbroadcast (Dialougue v)\n\n
-----------------------------✦Rᴇᴅ✦-----------------------------\n\n❖Bᴀᴄᴋsᴛᴏʀʏ❖\n➜ Rᴇᴅ Cᴜʙᴇ ʜᴀs ᴄᴀᴘᴛᴜʀᴇᴅ ᴀʟʟ ᴏғ Bʟᴜᴇ's ᴠɪʟʟᴀɢᴇ. Hᴇ ɪs ᴛʜᴇ ʟᴀsᴛ ᴏɴᴇ ʀᴇᴍᴀɪɴɪɴɢ, sᴏ ʜᴇ sᴇᴛs ᴏɴ ᴀ ǫᴜᴇsᴛ ᴛᴏ ᴛʀᴀᴠᴇʟ ᴛᴏ ᴛʜᴇ ʀᴇᴅ ᴋɪɴɢᴅᴏᴍ, sᴇᴛ ʜɪs ᴠɪʟʟᴀɢᴇ ғʀᴇᴇ, ᴀɴᴅ ᴅᴇғᴇᴀᴛ Rᴇᴅ Cᴜʙᴇ ᴏɴᴄᴇ ᴀɴᴅ ғᴏʀ ᴀʟʟ.  \n\n➜ ᴛʜɪs ɪs ᴘᴀʀᴛ ᴛᴡᴏ. ᴘᴀʀᴛ ᴏɴᴇ ɪs ᴜᴘ ᴛʜᴇʀᴇ.\n➜ Mᴏsᴛ ᴏғ ᴛʜᴇ ɪɴsᴛʀᴜᴄᴛɪᴏɴs ᴀʀᴇ ɪɴ ᴛʜᴇ ɢᴀᴍᴇ.  \n\n❖Cʀᴇᴅɪᴛs❖ \n➜ Jᴏɪɴ ᴍʏ 750 ᴄᴏɴᴛᴇsᴛ ғᴏʀ ʙɪɢ ᴘʀɪᴢᴇs!: https://scratch.mit.edu/projects/493054353/\n➜ Pʟᴇᴀsᴇ ᴅᴏɴ'ᴛ ʀᴇᴍɪx ɪғ ʏᴏᴜ ᴅᴏɴ'ᴛ ᴄʜᴀɴɢᴇ ᴀɴʏᴛʜɪɴɢ. \n➜ I ᴡɪʟʟ ᴍᴀᴋᴇ ᴀ ᴛᴜᴛᴏʀɪᴀʟ ᴏғ ʜᴏᴡ ᴛᴏ ᴍᴀᴋᴇ ᴀ ᴘʟᴀᴛғᴏʀᴍᴇʀ ʟɪᴋᴇ ᴛʜɪs sᴏᴏɴ! :) \n➜ soɴɢ ɪs sᴛᴀʀᴄᴀᴛ - ʙɪᴘᴏʟᴀʀɪᴛʏ\n➜ @0014049, @SGChase18, @JWhandle\n