Red & Blue || A Platformer
@Stage\n\nwhen I receive [// start \\ v]\nclear graphic effects\nclear sound effects\nset volume to (50) %\nforever\n    play sound [2012 \[bfdi music visualizer\] v] until done\nend\n\nwhen I receive [// easter egg \\ v]\nforever\n    change [color v] effect by (2)\n    set [pitch v] effect to (pick random (-30) to (30))\nend\n\n@thumbnail\n\nwhen flag clicked\nshow\ngo to [front v] layer\nclear graphic effects\nwait (0.5) seconds\nbroadcast (// start \\ v)\n\nwhen I receive [// start \\ v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@level\n\nwhen flag clicked\nclear graphic effects\nset [lvl v] to [1]\nforever\n    switch costume to (lvl)\nend\n\nwhen I receive [// easter egg \\ v]\nforever\n    change [color v] effect by (2)\nend\n\n@lava/water only\n\nwhen flag clicked\nhide\nset [lvl v] to [1]\nset [clone# v] to [0]\nrepeat (2)\n    change [clone# v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nforever\n    switch costume to (join (lvl) (join [-] (clone#)))\n    if <(lvl) = [4]> then\n        delete this clone\n    end\nend\n\n@player\n\ndefine platforming (mspeed) (yspeed) (jheight) (friction) (slope)\nswitch costume to (hitbox v)\nchange [yvel v] by (yspeed)\nchange y by (yvel)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((([abs v] of (yvel) ) / (yvel)) * (-1))\n    end\n    set [yvel v] to (<<key (up arrow v) pressed?> and <(([abs v] of (yvel) ) / (yvel)) = [-1]>> * (jheight))\nend\nset [xvel v] to (((xvel) + (((OutputX) / (20)) + (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>))) * (friction))\nchange x by (xvel)\nset [slope v] to [0]\nrepeat until <<(slope) = ((slope) * (-1))> or <not <touching (level v)?>>>\n    change [slope v] by (-1)\n    change y by (1)\nend\nif <touching (level v)?> then\n    change y by (slope)\n    repeat until <not <touching (level v)?>>\n        change x by ((([abs v] of (xvel) ) / (xvel)) * (-1))\n    end\n    set [xvel v] to [0]\n    if <key (up arrow v) pressed?> then\n        change x by (xvel)\n        set [xvel v] to ((<key (right arrow v) pressed?> - <key (left arrow v) pressed?>) * (-8))\n        set [yvel v] to [11]\n    end\nend\nif <(player type) > [2]> then\n    set [player type v] to [1]\nend\nif <(player type) < [1]> then\n    set [player type v] to [2]\nend\nswitch costume to ((1) + (player type))\nif <[1] = (player type)> then\n    if <<touching color (#00b6ff)?> and <touching (lava/water only v)?>> then\n        broadcast (// player only | reset \\ v)\n    end\nelse\n    if <<touching color (#ff0000)?> and <touching (lava/water only v)?>> then\n        broadcast (// player only | reset \\ v)\n    end\nend\nif <touching (finish v)?> then\n    broadcast (// player only | reset \\ v)\n    change [lvl v] by (1)\nend\n\nwhen flag clicked\nset [player type v] to [2]\nbroadcast (// player only | reset \\ v)\nforever\n    platforming [1] [-1] [12] [0.9] [8]\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nrepeat (20)\n    change [ghost v] effect by (5)\n    change size by (-5)\nend\ndelete this clone\n\nwhen I receive [// player only | reset \\ v]\nclear graphic effects\ngo to x: (-162) y: (44)\nchange [player type v] by (1)\nset [xvel v] to [0]\nset [yvel v] to [0]\n\nchange [player type v] by (1)\n\nchange [player type v] by (-1)\n\nwhen I receive [// start \\ v]\nset [xvel v] to [0]\nset [yvel v] to [0]\ngo to x: (-162) y: (100)\n\nwhen I receive [mobile only - jump v]\nif <touching (level v)?> then\n    set [yvel v] to [12]\nend\n\n@p-particles\n\nwhen flag clicked\nhide\nforever\n    set size to ([size v] of [player v]) %\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\ngo to [back v] layer\nset [ghost v] effect to (50)\ngo to (player v)\nrepeat (20)\n    switch costume to (player type)\n    change [ghost v] effect by (5)\n    change size by (-2)\n    change x by (pick random (([size v] of [player v]) * (-0.02)) to (([size v] of [player v]) * (0.02)))\n    change y by (([size v] of [player v]) * (0.010))\nend\ndelete this clone\n\n@finish\n\nwhen flag clicked\nforever\n    if <(distance to [player v]) < [50]> then\n        switch costume to (finish2 v)\n    else\n        switch costume to (finish1 v)\n    end\n    if <(lvl) = [1]> then\n        go to x: (180) y: (-43)\n        show\n    else\n        if <(lvl) = [2]> then\n            go to x: (180) y: (-86)\n            show\n        else\n            if <(lvl) = [3]> then\n                go to x: (180) y: (114)\n                show\n            else\n                if <(lvl) = [4]> then\n                    hide\n                end\n            end\n        end\n    end\nend\n\n@tap to switch\n\nwhen flag clicked\nforever\n    switch costume to (player type)\nend\n\nwhen this sprite clicked\nchange [player type v] by (1)\n\nwhen [space v] key pressed\nchange [player type v] by (1)\n\n@Joystick Engine\n\nwhen flag clicked\nhide variable [joystick on? v]\nhide variable [outputx v]\nhide variable [outputy v]\nhide variable [size v]\nhide variable [x v]\nhide variable [y v]\nhide\nset [type v] to [0]\n\ndefine joystick at x: (x) y: (y) with size of: (size) black/white: (blackwhite) type: (type)\nbroadcast (delete joystick v)\nshow\ngo to [front v] layer\ngo to x: (x) y: (y)\nswitch costume to (circle v)\nset [size v] to (size)\nset [black/white? v] to (blackwhite)\nset [type v] to (type)\nset [x v] to (x)\nset [y v] to (y)\nset size to ((Size) * (2)) %\ncreate clone of (_myself_ v)\nif <(Black/White?) = [black]> then\n    set [brightness v] effect to (-100)\nelse\n    set [brightness v] effect to (100)\nend\n\nwhen I start as a clone\nswitch costume to (stick v)\nset [joystick on? v] to [no]\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        set [joystick on? v] to [yes]\n        wait until <not <mouse down?>>\n        set [joystick on? v] to [no]\n    end\nend\n\nwhen I start as a clone\ngo to [front v] layer\nif <(Black/White?) = [black]> then\n    set [brightness v] effect to (-100)\nelse\n    set [brightness v] effect to (100)\nend\nforever\n    if <(Joystick On?) = [yes]> then\n        go to (mouse-pointer v)\n        set [ghost v] effect to (0)\n        pushback x left (((x) - (21)) - ((Size) * (0.02)))\n        pushback x right (((x) + (21)) - ((Size) * (0.02)))\n        pushback y up (((y) + (21)) - ((Size) * (0.02)))\n        pushback y down (((y) - (21)) - ((Size) * (0.02)))\n        if <((y position) - (y)) > [15]> then\n            broadcast (mobile only - jump v)\n        end\n    else\n        set [ghost v] effect to (70)\n        change x by (((x) - (x position)) * (0.3))\n        change y by (((y) - (y position)) * (0.3))\n    end\n    set [outputx v] to ((x position) - (x))\n    set [outputy v] to ((y position) - (y))\nend\n\nwhen [m v] key pressed\ngo to (mouse-pointer v)\njoystick at x: (x position) y: (y position) with size of: [50] black/white: [white] type: [1]\n\nwhen flag clicked\nforever\n    if <(Joystick On?) = [yes]> then\n        set [ghost v] effect to (0)\n    else\n        set [ghost v] effect to (70)\n    end\nend\n\ndefine pushback x left (x)\nif <(x position) < (x)> then\n    set x to (x)\nend\n\ndefine pushback x right (x)\nif <(x position) > (x)> then\n    set x to (x)\nend\n\ndefine pushback y up (y)\nif <(y position) > (y)> then\n    set y to (y)\nend\n\ndefine pushback y down (y)\nif <(y position) < (y)> then\n    set y to (y)\nend\n\nwhen I receive [delete joystick v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(type) = [2]> then\n        if <mouse down?> then\n            repeat until <not <mouse down?>>\n                show\n            end\n        else\n            hide\n        end\n    else\n        show\n    end\nend\n\nwhen flag clicked\njoystick at x: [-159] y: [-107] with size of: [50] black/white: [white] type: [2]\n\nwhen flag clicked\nforever\n    if <(type) = [2]> then\n        hide\n        if <mouse down?> then\n            joystick at x: (mouse x) y: (mouse y) with size of: [50] black/white: [white] type: [2]\n            wait until <not <mouse down?>>\n        end\n    else\n        show\n    end\nend\n\n
ʏᴀʏ! ᴛʜɪꜱ ɢᴀᴍᴇ ᴡᴏɴ ᴛʜᴇ ᴄᴏɴᴛᴇꜱᴛ!\n-- ʀᴇᴅ & ʙʟᴜᴇ || ᴘʟᴀᴛꜰᴏʀᴍᴇʀ --\nɪɴꜱᴛʀᴜᴄᴛɪᴏɴꜱ:\n← → ↑ ↓ - ᴀʀʀᴏᴡ ᴋᴇʏꜱ ᴛᴏ ᴍᴏᴠᴇ & ᴊᴜᴍᴘ, ᴏʀ ᴛʜᴇ ᴊᴏʏꜱᴛɪᴄᴋ (ᴛᴀᴘ ᴀɴᴅ ʜᴏʟᴅ) ᴛᴏ ᴍᴏᴠᴇ ᴀɴᴅ ᴊᴜᴍᴘ.\nꜱᴘᴀᴄᴇ ᴋᴇʏ ᴏʀ ʙᴜᴛᴛᴏɴ ᴀᴛ ᴛʜᴇ ᴛᴏᴘ ʟᴇꜰᴛ ᴄᴏʀɴᴇʀ ᴏꜰ ᴛʜᴇ ꜱᴄʀᴇᴇɴ ᴛᴏ ꜱᴡɪᴛᴄʜ ʙᴇᴛᴡᴇᴇɴ ʟᴀᴠᴀ ᴀɴᴅ ᴡᴀᴛᴇʀ.\nᴍᴏʀᴇ ʟᴇᴠᴇʟꜱ ᴄᴏᴍɪɴɢ ꜱᴏᴏɴ ( ɪ ʜᴀᴛᴇ ʟᴇᴠᴇʟ ᴅᴇꜱɪɢɴ :ᴘ)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nᴄᴀɴ ʏᴏᴜ ꜰɪɴᴅ ᴛʜᴇ ᴇᴀꜱᴛᴇʀ ᴇɢɢ ᴍᴏᴅᴇ?