|Grass Lands|Platformer|Online                                           #Games #Platformer

Instructions: -Move-\nArrow keys/ W A S D\n----------------------------\n-Avoid-\nSpikes \n\nFulscreen recommended\nTurbo mode not recommended\n------------------------------------------\nI am taking this down

@Stage\n\n@Player\n\nwhen flag clicked\nhide\nbroadcast (Reset v)\nbroadcast (Start v)\n\ndefine tick\nshow\ngo to x: (0) y: (0)\nswitch costume to (3 v)\nset size to (100) %\nset [y v] to (round (y))\ninsert (x position) at (1) of [wall v] \ndelete (5) of [wall v]\nchange [y v] by (-5)\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    change [y v] by (-5)\n    Position\n    if <<touching (ground v)?> or <touching (water v)?>> then\n        if <(jump) < [6]> then\n            change [jump v] by (5)\n            set [yv v] to [25]\n        end\n    end\n    change [y v] by (5)\nend\nif <(xv) < [10]> then\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        set [cos v] to [1]\n        change [xv v] by (1.8)\n    else\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            set [cos v] to [2]\n            change [xv v] by (-1.8)\n        else\n            set [cos v] to [3]\n        end\n    end\nend\nif <(yv) < [-10]> then\n    set [yv v] to [-10]\nend\nchange [yv v] by (-1.5)\nset [xv v] to ((xv) * (0.9))\nset [yv v] to ((yv) * (0.99))\nyv (yv)\nxv (xv)\nif <touching (bounce pad v)?> then\n    set [yv v] to [40]\nend\nif <<<(y) < [-500]> or <touching (spikes v)?>> or <key (r v) pressed?>> then\n    set [die v] to [Die]\nend\nswitch costume to (Cos)\nif <<(x) > [-490]> and <(x) < [1060]>> then\n    change [scrollx v] by (round (((x) - (ScrollX)) / (10)))\nend\nchange [scrolly v] by (round (((y) - (ScrollY)) / (10)))\nPosition\nif <touching (win v)?> then\n    set [win v] to [win]\n    broadcast (Level 2 v)\nend\n\ndefine yv (yv)\nif <not <touching (water v)?>> then\n    change [y v] by (yv)\nelse\n    if <not <key (up arrow v) pressed?>> then\n        change [y v] by ((yv) / (6))\n    else\n        change [y v] by (10)\n    end\n    set [jump v] to [0]\nend\nPosition\nrepeat until <not <touching (ground v)?>>\n    if <(yv) > [0]> then\n        set [yv v] to [5]\n        change [y v] by (-1)\n    else\n        set [jump v] to [0]\n        change [y v] by (1)\n    end\n    Position\nend\n\ndefine xv (xv)\nchange [x v] by (xv)\nPosition\nif <touching (ground v)?> then\n    repeat (10)\n        change [y v] by (1)\n        Position\n        if <not <touching (ground v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-10)\nend\nrepeat until <not <touching (ground v)?>>\n    change [x v] by ((([abs v] of (xv) ) / (xv)) * (-1))\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <<not <(xv) = [0]>> and <(item (1) of [wall v]) = (item (3) of [wall v])>>> then\n        set [yv v] to [23]\n        if <touching (ground v)?> then\n            if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n                change [xv v] by (-10)\n            else\n                if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n                    change [xv v] by (10)\n                end\n            end\n        end\n        set [xv v] to ((xv) * (0.95))\n        change [x v] by (xv)\n    end\n    Position\nend\n\nwhen I receive [platformer: die v]\nbroadcast (Start v)\n\ndefine Position\ngo to x: ((x) - (ScrollX)) y: ((y) - (ScrollY))\n\ndefine Reset\ngo to x: (-220) y: (-90)\nset [win v] to [0]\nset [x v] to [0]\nset [y v] to [50]\nset [scrollx v] to [0]\nset [scrolly v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\nset [ghost v] effect to (0)\n\nwhen I receive [start v]\nforever\n    Reset\n    set [die v] to []\n    repeat until <not <(Die) = []>>\n        tick\n        broadcast (Game Loop v)\n    end\n    Die\nend\n\ndefine Die\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nset [die v] to []\n\ndefine Joining\ndelete all of [join v]\ninsert (☁ P1) at (1) of [join v] \ninsert (☁ P2) at (2) of [join v] \ninsert (☁ P3) at (3) of [join v] \ninsert (☁ P4) at (4) of [join v] \nbroadcast (Setup v)\nbroadcast (Connecting v)\nwait (3) seconds\nif <(item (1) of [join v]) = (☁ P1)> then\n    set [p# v] to [1]\n    broadcast (Connected v)\nelse\n    if <(item (2) of [join v]) = (☁ P2)> then\n        set [p# v] to [2]\n        broadcast (Connected v)\n    else\n        if <(item (3) of [join v]) = (☁ P3)> then\n            set [p# v] to [3]\n            broadcast (Connected v)\n        else\n            if <(item (4) of [join v]) = (☁ P4)> then\n                set [p# v] to [4]\n                broadcast (Connected v)\n            else\n                broadcast (Server Full v)\n            end\n        end\n    end\nend\n\nwhen I receive [connected v]\nforever\n    Send Cloud\nend\n\nwhen flag clicked\nbroadcast (options v)\nhide\n\ndefine Write (value)\nset [letter # v] to [1]\nrepeat (length of (value))\n    set [encoded v] to (join (encoded) (item # of (letter (letter #) of (value)) in [code v]))\n    change [letter # v] by (1)\nend\nset [encoded v] to (join (encoded) [99])\n\ndefine Send (encoded) to (player #)\nif <(player #) = [1]> then\n    set [☁ p1 v] to (encoded)\nelse\n    if <(player #) = [2]> then\n        set [☁ p2 v] to (encoded)\n    else\n        if <(player #) = [3]> then\n            set [☁ p3 v] to (encoded)\n        else\n            if <(player #) = [4]> then\n                set [☁ p4 v] to (encoded)\n            end\n        end\n    end\nend\n\ndefine Send Cloud\nset [encoded v] to []\nWrite (timer)\nWrite (username)\nWrite (x)\nWrite (y)\nWrite (Cos)\nSend (encoded) to (P#)\n\nwhen I receive [game v]\nshow\nJoining\n\nwhen I receive [level 2 v]\nReset\n\nwhen flag clicked\nbroadcast (Game v)\n\nwhen flag clicked\nchange [☁ visits v] by (1)\nhide variable [☁ visits v]\n\nwhen flag clicked\nforever\n    if <touching (coins v)?> then\n        broadcast (Coin v)\n        set [coin v] to [1]\n    end\n    if <touching (jump pad v)?> then\n        change [yv v] by (25)\n    end\n    if <touching (ladder v)?> then\n        change [yv v] by (4)\n    end\nend\n\n@Multiplayer\n\ndefine Decode\nset [value v] to []\nrepeat (round ((length of (cloud encoded)) / (2)))\n    set [value v] to (join (value) (item (join (letter (letter number) of (cloud encoded)) (letter ((letter number) + (1)) of (cloud encoded))) of [code v]))\n    change [letter number v] by (2)\n    if <(letter (letter number) of (cloud encoded)) = [9]> then\n        stop [this script v]\n    end\nend\n\ndefine Load Encoded (clone #)\nif <(clone #) = [1]> then\n    set [cloud encoded v] to (☁ P1)\nelse\n    if <(clone #) = [2]> then\n        set [cloud encoded v] to (☁ P2)\n    else\n        if <(clone #) = [3]> then\n            set [cloud encoded v] to (☁ P3)\n        else\n            if <(clone #) = [4]> then\n                set [cloud encoded v] to (☁ P4)\n            end\n        end\n    end\nend\n\nwhen I receive [connected v]\nforever\n    broadcast (Multiplayer v)\nend\n\ndefine Multiplayer\nLoad Encoded (Multiplayer ID)\nif <(online?) = (join [U] (cloud encoded))> then\n    change [offline v] by (2)\n    if <(offline) > [100]> then\n        set [offline v] to [101]\n    end\nelse\n    if <not <(P#) = (Multiplayer ID)>> then\n        show\n        set [online? v] to (join [U] (cloud encoded))\n        set [offline v] to [0]\n    else\n        hide\n    end\nend\nset [letter number v] to [1]\nDecode\nDecode\nsay (value)\nDecode\nset x to ((value) - (ScrollX))\nDecode\nset y to ((value) - (ScrollY))\nDecode\nif <<<(x position) > [200]> or <(x position) < [-200]>> or <<(y position) > [160]> or <(y position) < [-160]>>> then\n    set rotation style [all around v]\n    switch costume to (arrow v)\n    point towards (player v)\n    if on edge, bounce\nelse\n    switch costume to (value)\n    point in direction (90)\nend\n\nwhen I receive [connected v]\nLoad Encoded (Multiplayer ID)\nset [online? v] to (join [U] (cloud encoded))\n\nwhen I receive [multiplayer v]\nMultiplayer\n\nwhen I receive [setup v]\nSetup\n\ndefine Setup\nset [multiplayer id v] to [1]\nrepeat (3)\n    hide\n    create clone of (_myself_ v)\n    change [multiplayer id v] by (1)\nend\n\nset [☁ p1 v] to []\nset [☁ p2 v] to []\nset [☁ p3 v] to []\nset [☁ p4 v] to []\n\n@Ground\n\nwhen I receive [start v]\nswitch costume to (nothing v)\nset size to (100) %\nset [x v] to [0]\nset [y v] to [0]\nClone x: [0] y: [0]\nClone x: [560] y: [-150]\nClone x: [-1150] y: [-300]\nClone x: [1700] y: [-100]\nClone x: [1800] y: [-300]\n\ndefine Clone x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [game loop v]\nforever\n    Position ((x) - (ScrollX)) ((y) - (ScrollY))\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nswitch costume to (nothing v)\nbroadcast (Game Loop v)\nhide\n\nwhen I receive [game v]\nshow\n\n@Spikes\n\nwhen I receive [start v]\nswitch costume to (nothing v)\nset size to (100) %\nset [x v] to [0]\nset [y v] to [0]\nClone x: [0] y: [0]\nClone x: [560] y: [-150]\nClone x: [-1150] y: [-300]\n\ndefine Clone x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [game loop v]\nforever\n    Position ((x) - (ScrollX)) ((y) - (ScrollY))\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [game v]\nshow\n\nwhen I receive [level 2 v]\nbroadcast (Reset v)\nClone x: [0] y: [0]\nClone x: [560] y: [-150]\nClone x: [-1150] y: [-300]\n\n@Water\n\nwhen I receive [start v]\nswitch costume to (nothing v)\nset [x v] to [0]\nset [y v] to [0]\nWater Clone x: [-500] y: [-130]\n\ndefine Water Clone x: (x) y: (y)\nset [water v] to [0]\nrepeat (3)\n    create clone of (_myself_ v)\n    set [x v] to (x)\n    set [y v] to (y)\n    change [water v] by (1)\n    switch costume to (1 v)\nend\n\nnext costume\n\nwhen I receive [game loop v]\nPosition ((x) - (ScrollX)) ((y) - (ScrollY))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nchange [y2 v] by (([sin v] of (((days since 2000) * (10000000)) * (join [1.] (Water))) ) / (1.7))\nset [ghost v] effect to (50)\nset size to (100) %\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [game v]\nshow\n\n@Server Messages\n\nwhen I receive [connected v]\nshow\nswitch costume to (connected v)\nclear graphic effects\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [connecting v]\nshow\nswitch costume to (connecting v)\n\nwhen I receive [server full v]\nshow\nswitch costume to (server full v)\nclear graphic effects\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nhide\ngo to x: (185) y: (160)\n\n@Sprite1\n\nwhen flag clicked\nhide\ngo to x: (-150) y: (20)\nforever\n    create clone of (_myself_ v)\n    wait (0.7) seconds\nend\n\nwhen I start as a clone\nshow\ngo to x: (-150) y: (20)\nglide (1) secs to x: (250) y: (20)\ndelete this clone\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\nend\n\n@Trees/bushes\n\nwhen I receive [start v]\nswitch costume to (nothing v)\nset size to (100) %\nset [x v] to [0]\nset [y v] to [0]\nClone x: [0] y: [0]\nClone x: [560] y: [-150]\nClone x: [-1150] y: [-300]\nClone x: [1700] y: [-100]\nClone x: [1800] y: [-300]\n\ndefine Clone x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [game loop v]\nforever\n    Position ((x) - (ScrollX)) ((y) - (ScrollY))\nend\n\ndefine Position (x) (y)\ngo to [front v] layer\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nbroadcast (Game Loop v)\nhide\n\nwhen I receive [game v]\nshow\n\n@Jump Pad\n\nwhen I receive [start v]\nswitch costume to (nothing v)\nset size to (100) %\nset [x v] to [0]\nset [y v] to [0]\nClone x: [0] y: [0]\nClone x: [560] y: [-150]\nClone x: [-1150] y: [-300]\nClone x: [1700] y: [-100]\nClone x: [1800] y: [-300]\n\ndefine Clone x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [game loop v]\nforever\n    Position ((x) - (ScrollX)) ((y) - (ScrollY))\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nbroadcast (Game Loop v)\nhide\n\nwhen I receive [game v]\nshow\n\n@Coins\n\nwhen I receive [start v]\nswitch costume to (nothing v)\nset size to (100) %\nset [x v] to [0]\nset [y v] to [0]\nClone x: [0] y: [0]\nClone x: [560] y: [-150]\nClone x: [-1150] y: [-300]\nClone x: [1700] y: [-100]\nClone x: [1800] y: [-300]\n\ndefine Clone x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [game loop v]\nforever\n    Position ((x) - (ScrollX)) ((y) - (ScrollY))\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\n    if <(Coin) = [1]> then\n        hide\n    end\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nset [coin v] to [0]\nbroadcast (Game Loop v)\nhide\n\nwhen I receive [game v]\nshow\n\nwhen I receive [coin v]\nhide\n\n@Ladder\n\nwhen I receive [start v]\nswitch costume to (nothing v)\nset size to (100) %\nset [x v] to [0]\nset [y v] to [0]\nClone x: [0] y: [0]\nClone x: [560] y: [-150]\nClone x: [-1150] y: [-300]\nClone x: [1700] y: [-100]\nClone x: [1800] y: [-300]\n\ndefine Clone x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [game loop v]\nforever\n    Position ((x) - (ScrollX)) ((y) - (ScrollY))\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x position) = (x)> and <(y position) = (y)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nbroadcast (Game Loop v)\nhide\n\nwhen I receive [game v]\nshow\n\n