2 Square || A Platformer || #All #Games
@Stage\n\nwhen flag clicked\nforever\n    play sound [Music Sound v] until done\nend\n\n@Thumbnail \n\nwhen flag clicked\nshow\ngo to x: (36) y: (28)\nset [ghost v] effect to (100)\n\n@Blue Square\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nset size to (100) %\npoint in direction (90)\ngo to x: (-208) y: (-91)\nset [x v] to [0]\nset [y v] to [0]\nset [ghost v] effect to (0)\nforever\n    if  then\n        change [x v] by (1)\n    end\n    if  then\n        change [x v] by (-1)\n    end\n    set [x v] to ((X) * (0.9))\n    change x by (X)\n    if <<touching color (#000000)?> or <touching color (#ff1b1b)?>> then\n        change y by (1)\n        if <<touching color (#000000)?> or <touching color (#ff1b1b)?>> then\n            change y by (1)\n            if <<touching color (#000000)?> or <touching color (#ff1b1b)?>> then\n                change y by (1)\n                if <<touching color (#000000)?> or <touching color (#ff1b1b)?>> then\n                    change y by (1)\n                    if <<touching color (#000000)?> or <touching color (#ff1b1b)?>> then\n                        change y by (1)\n                        if <<touching color (#000000)?> or <touching color (#ff1b1b)?>> then\n                            change x by ((X) * (-1))\n                            change y by (-4)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-1)\n    change y by (Y)\n    if <<touching color (#000000)?> or <touching color (#ff1b1b)?>> then\n        change y by ((Y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<touching color (#000000)?> or <touching color (#ff1b1b)?>> then\n        if  then\n            set [y v] to [12]\n        end\n    end\n    if <(y position) < [-179]> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [ghost v] effect to (0)\n        set size to (100) %\n        point in direction (90)\n        go to x: (-208) y: (-91)\n    end\n    if <<(x position) > [225]> and <([x position v] of [red square v]) > [225]>> then\n        set size to (100) %\n        point in direction (90)\n        go to x: (-208) y: (-91)\n        set [x v] to [0]\n        set [y v] to [0]\n        broadcast (Next v)\n    end\n    if <<touching (spikes v)?> or <touching (saw v)?>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [ghost v] effect to (0)\n        set size to (100) %\n        point in direction (90)\n        go to x: (-208) y: (-91)\n    end\n    if <touching color (#ffa100)?> then\n        change [x v] by ((X) * (0.1))\n    end\n    if <touching color (#1dff00)?> then\n        set size to (50) %\n    end\n    if <touching color (#c900ff)?> then\n        set size to (100) %\n    end\n    if <touching color (#ffec24)?> then\n        set [y v] to [19]\n    end\n    if <key (s v) pressed?> then\n        set size to (100) %\n        point in direction (90)\n        go to x: (-208) y: (-91)\n        set [x v] to [0]\n        set [y v] to [0]\n        broadcast (Next v)\n        wait until <not <key (s v) pressed?>>\n    end\n    if <key (r v) pressed?> then\n        set size to (100) %\n        point in direction (90)\n        go to x: (-208) y: (-91)\n        set [x v] to [0]\n        set [y v] to [0]\n        wait until <not <key (r v) pressed?>>\n    end\nend\n\n@Red Square\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nset size to (100) %\npoint in direction (90)\ngo to x: (-150) y: (-92)\nset [x red v] to [0]\nset [y red v] to [0]\nset [bounce blue v] to [0]\nforever\n    if  then\n        change [x red v] by (1)\n    end\n    if  then\n        change [x red v] by (-1)\n    end\n    set [x red v] to ((X red) * (0.9))\n    change x by (X red)\n    if <<touching color (#000000)?> or <touching color (#00b5ff)?>> then\n        change y by (1)\n        if <<touching color (#000000)?> or <touching color (#00b5ff)?>> then\n            change y by (1)\n            if <<touching color (#000000)?> or <touching color (#00b5ff)?>> then\n                change y by (1)\n                if <<touching color (#000000)?> or <touching color (#00b5ff)?>> then\n                    change y by (1)\n                    if <<touching color (#000000)?> or <touching color (#00b5ff)?>> then\n                        change y by (1)\n                        if <<touching color (#000000)?> or <touching color (#00b5ff)?>> then\n                            change x by ((X red) * (-1))\n                            change y by (-4)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y red v] by (-1)\n    change y by (Y red)\n    if <<touching color (#000000)?> or <touching color (#00b5ff)?>> then\n        change y by ((Y red) * (-1))\n        set [y red v] to [0]\n    end\n    change y by (-1)\n    if <<touching color (#000000)?> or <touching color (#00b5ff)?>> then\n        if  then\n            set [y red v] to [12]\n        end\n    end\n    if <<touching (spikes v)?> or <touching (saw v)?>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [ghost v] effect to (0)\n        set size to (100) %\n        point in direction (90)\n        go to x: (-150) y: (-92)\n    end\n    if <(y position) < [-179]> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [ghost v] effect to (0)\n        set size to (100) %\n        point in direction (90)\n        go to x: (-150) y: (-92)\n    end\n    if <touching color (#ffa100)?> then\n        change [x red v] by ((X red) * (0.1))\n    end\n    if <touching color (#1dff00)?> then\n        set size to (50) %\n    end\n    if <touching color (#c900ff)?> then\n        set size to (100) %\n    end\n    if <touching color (#ffec24)?> then\n        set [y red v] to [19]\n    end\n    if <key (r v) pressed?> then\n        set size to (100) %\n        point in direction (90)\n        go to x: (-150) y: (-92)\n        set [x red v] to [0]\n        set [y red v] to [0]\n        wait until <not <key (r v) pressed?>>\n    end\nend\n\nwhen I receive [next v]\nset size to (100) %\npoint in direction (90)\ngo to x: (-150) y: (-92)\nset [x red v] to [0]\nset [y red v] to [0]\n\n@Ground\n\nwhen flag clicked\nshow\nswitch costume to (1 v)\n\nwhen I receive [next v]\nnext costume\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [3]> then\n        broadcast (Button v)\n    else\n        broadcast (Hide v)\n    end\nend\n\n@button red\n\nwhen flag clicked\nhide\n\nwhen I receive [button v]\ngo to x: (200) y: (-105)\nshow\nforever\n    if <touching (red square v)?> then\n        broadcast (Magic v)\n    end\nend\n\nwhen I receive [hide v]\nhide\n\n@Magic ground\n\nwhen flag clicked\nhide\n\nwhen I receive [magic v]\nshow\nif <([costume # v] of [ground v]) = [3]> then\n    show\n    switch costume to (1 v)\n    repeat (10)\n        change y by (-10)\n    end\nelse\n    repeat (10)\n        change y by (20)\n    end\nend\n\nwhen flag clicked\nforever\n    if <([costume # v] of [ground v]) = [3]> then\n        show\n    end\nend\n\nwhen flag clicked\ngo to x: (29) y: (28)\n\nwhen flag clicked\nforever\n    if <([costume # v] of [ground v]) = [3]> then\n        show\n    else\n        hide\n    end\nend\n\n@Spikes\n\nwhen flag clicked\nshow\nswitch costume to (1 v)\n\nwhen I receive [next v]\nnext costume\n\n@Saw\n\nwhen I receive [next v]\nnext costume\n\nwhen flag clicked\nforever\n    point in direction ((90) + (([sin v] of ((turn) * (2)) ) * (300)))\n    if <(costume [number v]) = [7]> then\n        go to x: (-39) y: (-112)\n    end\n    if <(costume [number v]) = [10]> then\n        go to x: (155) y: (-109)\n    end\n    if <(costume [number v]) = [13]> then\n        go to x: (75) y: (-112)\n    end\nend\n\nwhen flag clicked\nshow\nswitch costume to (1 v)\nforever\n    change [turn v] by (0.9)\n    go to [back v] layer\nend\n\n@Magic\n\nwhen flag clicked\nshow\nswitch costume to (1 v)\n\nwhen I receive [next v]\nnext costume\n\n@Ground move\n\nwhen flag clicked\nforever\n    if <([costume # v] of [ground v]) = [17]> then\n        show\n        go to x: (176) y: (-88)\n        repeat (125)\n            change x by (-2)\n        end\n        go to x: (-74) y: (-88)\n        repeat (125)\n            change x by (2)\n        end\n        go to x: (176) y: (-88)\n    else\n        go to x: (176) y: (-88)\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\n
       ★★★★★★★★★★ 2 Square  ★★★★★★★★★★\n\n                        ★★★★★How to play★★★★★\n- Red Square : Arrow keys to move\n- Blue Square : W A D to move\n- Don't touch Spikes, Saw and Lava\n- Press S to skip\n- Press R to reset\n\n                        \n           ★★★★★★★★★★Credits★★★★★★★★★★\n- Thanks to @AKAV_BROTHERS for the idea !\n-The other codes by me !    ( 100 % )