☁Upwards☁ v1.4 A Multiplayer Platformer

Instructions:      ✦ Upwards a Cloud Multiplayer Platformer✦\n            Just go UP                                     \n                     Youtube- @DrollerApollo13\n\nWelcome! This is a new kind of scrolling platformer. There are multiple different paths to explore! Remember to Like and Fave!\n\n➥ Pre and post releases here: https://scratch.mit.edu/users/CoolplatipusTest/\nThis project will probably have no one on line but I promise it works.\n\nHow to move:\n➜ Arrow Keys / WASD / Tap to move\n➜ Space does NOT equal jump\n\nWhat places to visit:\n➜ Castle\n➜ Season Island (constantly changing every 10 min)\n➜ Sky Cube Cloud\n➜ Sky Ladders\n➜ Home/ Hub\n\n\nFOLLOW @ronsinda

@Stage\n\nwhen flag clicked\nforever\n    if <(Sword Inventory) = (Inventory slot)> then\n        switch backdrop to (backdrop2 v)\n    else\n        switch backdrop to (backdrop1 v)\n    end\nend\n\n@Blank\n\nwhen flag clicked\nset [timer v] to [0]\nforever\n    change [timer v] by (1)\n    wait (1) seconds\nend\n\n@Opponents\n\ndefine begin decode of (encoded)\nset [encoded v] to (encoded)\nset [letter # v] to [1]\n\ndefine value = read from encoded\nset [value v] to []\nforever\n    set [idx v] to (join (letter (letter #) of (encoded)) (letter ((letter #) + (1)) of (encoded)))\n    change [letter # v] by (2)\n    if <(idx) < [1]> then\n        stop [this script v]\n    end\n    set [value v] to (join (value) (item (idx) of [code v]))\nend\n\ndefine setup players\nhide\nset [hidden v] to [1]\nclear graphic effects\nset [ghost v] effect to (50)\nset [offline v] to [100]\nset [player # v] to [1]\npoint in direction (90)\nrepeat ((MAX PLAYERS) - (1))\n    create clone of (_myself_ v)\n    add [] to [enemyrainbow? v]\n    add [0] to [enemyx v]\n    add [0] to [enemyy v]\n    change [player # v] by (1)\nend\n\nwhen I receive [begin v]\nforever\n    if <(MY PLAYER #) = (player #)> then\n        set [offline v] to [100]\n    else\n        tick\n    end\nend\n\ndefine value = cloud # (player #)\nif <(player #) = [1]> then\n    set [value v] to (☁ P1)\nelse\n    if <(player #) = [2]> then\n        set [value v] to (☁ P2)\n    else\n        if <(player #) = [3]> then\n            set [value v] to (☁ P3)\n        else\n            if <(player #) = [4]> then\n                set [value v] to (☁ P4)\n            else\n                if <(player #) = [5]> then\n                    set [value v] to (☁ P5)\n                else\n                    if <(player #) = [6]> then\n                        set [value v] to (☁ P6)\n                    else\n                        if <(player #) = [7]> then\n                            set [value v] to (☁ P7)\n                        else\n                            if <(player #) = [8]> then\n                                set [value v] to (☁ P8)\n                            else\n                                if <(player #) = [9]> then\n                                    set [value v] to (☁ P9)\n                                else\n                                    if <(player #) = [10]> then\n                                        set [value v] to (☁ P10)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine tick\nvalue = cloud # (player #)\nif <(join (value) [A]) = (last value)> then\n    change [offline v] by (1)\n    if <(offline) = [100]> then\n        replace item (player #) of [enemyrainbow? v] with [0]\n        replace item (player #) of [enemyx v] with [0]\n        replace item (player #) of [enemyy v] with [0]\n        set [hidden v] to [1]\n        hide\n    end\nelse\n    set [last value v] to (join (value) [A])\n    if <(offline) > [99]> then\n        set [hidden v] to [0]\n        show\n    end\n    set [offline v] to [0]\nend\nbegin decode of (value)\nvalue = read from encoded\nswitch costume to (value)\nif < (costume [name v]) contains [4]?> then\n    replace item (player #) of [enemyrainbow? v] with [1]\nelse\n    replace item (player #) of [enemyrainbow? v] with [0]\nend\nvalue = read from encoded\nif <<<(y position) < [-160]> or <[160] < (y position)>> or <<(x position) < [-220]> or <[220] < (x position)>>> then\n    set rotation style [all around v]\n    go to [front v] layer\n    point towards (player v)\n    switch costume to (arrow v)\n    if on edge, bounce\n    think []\n    set [ghost v] effect to (0)\nelse\n    set rotation style [don't rotate v]\n    point in direction (90)\n    set [ghost v] effect to (10)\n    if <(names?) = [0]> then\n        think []\n    else\n        think (value)\n    end\nend\nvalue = read from encoded\nvalue = read from encoded\nset x to ((value) - (SCROLL X))\nif <(hidden) = [0]> then\n    replace item (player #) of [enemyx v] with (x position)\nend\nif <<(x position) > [230]> or <(x position) < [-230]>> then\n    replace item (player #) of [enemyx v] with [0]\nend\nvalue = read from encoded\nset y to ((value) - (SCROLL Y))\nif <(hidden) = [0]> then\n    replace item (player #) of [enemyy v] with (y position)\nend\nif <<(y position) > [170]> or <(y position) < [-170]>> then\n    replace item (player #) of [enemyy v] with [0]\nend\nvalue = read from encoded\nbroadcast (Decode chat v)\nbroadcast (draw enemy rainbow skins v)\n\nwhen I receive [join game v]\nvalue = cloud # (player #)\nset [last value v] to (join (value) [A])\nwait (3) seconds\nvalue = cloud # (player #)\nif <(join (value) [A]) = (last value)> then\n    set [my player # v] to (player #)\nend\n\nwhen I receive [setup opponents v]\nsetup players\n\n@    \n\nwhen flag clicked\nclear graphic effects\nswitch costume to (connecting v)\ngo to x: (0) y: (0)\nforever\n    wait (1) seconds\n    if <(CONNECT) = [Connected]> then\n        switch costume to (connected v)\n        wait (2) seconds\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        stop [this script v]\n    else\n        if <(CONNECT) = [Full]> then\n            switch costume to (full v)\n        else\n            switch costume to (connecting v)\n        end\n    end\nend\n\nwhen I receive [timeout v]\ngo to x: (0) y: (0)\nclear graphic effects\nswitch costume to (timeout v)\nshow\ngo to [front v] layer\nstop [all v]\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen I receive [i died v]\nforever\n    hide\nend\n\n@Platforms\n\nwhen I receive [green flag v]\nset size to (750) %\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at [600] [0]\nClone at [400] [0]\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nset [ghost v] effect to (99)\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen flag clicked\n\n@Platforms_Art\n\nwhen I receive [green flag v]\nset size to (750) %\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at [600] [0]\nClone at [400] [0]\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at (x) (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@ThumbSprite4\n\nwhen flag clicked\nswitch costume to ( v)\ngo to x: (0) y: (0)\nforever\n    show\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\nwhen I receive [banned v]\nswitch costume to (banned v)\nstop [all v]\n\n@Clouds\n\nwhen flag clicked\nset [ghost v] effect to (30)\n\nwhen flag clicked\ncreate clone of (_myself_ v)\nforever\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    glide (4) secs to x: (311) y: (y position)\n    if <(x position) = [311]> then\n        set x to (-350)\n        set y to (pick random (5) to (170))\n    end\nend\n\nwhen I start as a clone\nwait (2) seconds\nforever\n    glide (4) secs to x: (311) y: (y position)\n    if <(x position) = [311]> then\n        set x to (-350)\n        set y to (pick random (5) to (170))\n    end\nend\n\n@Love\n\nwhen flag clicked\nset [loved v] to [0]\nswitch costume to (costume1 v)\nforever\n    if <(Loved) = [1]> then\n        switch costume to (costume2 v)\n    end\nend\n\n@Fave\n\nwhen flag clicked\nset [faved v] to [0]\nswitch costume to (costume1 v)\nforever\n    if <(Faved) = [1]> then\n        switch costume to (costume2 v)\n    end\nend\n\n@Love Detector\n\nwhen flag clicked\nset [loved v] to [0]\nset [faved v] to [0]\nforever\n    if <touching (mouse-pointer v)?> then\n        wait (0.4) seconds\n        set [loved v] to [1]\n    end\nend\n\n@Fave Detector\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        wait (0.4) seconds\n        set [faved v] to [1]\n    end\nend\n\n@Sprite2\n\n@Banned\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if < (Banned) contains (username)?> then\n        broadcast (Banned v)\n        show\n        go to [front v] layer\n        wait (1) seconds\n    else\n        hide\n    end\nend\n\n@Skin\n\nwhen flag clicked\nshow\nswitch costume to (normal v)\ngo to x: (0) y: (40)\nset [skin select v] to [1]\nforever\n    if <(skin select) = [1]> then\n        switch costume to (normal v)\n    end\n    if <(skin select) = [2]> then\n        switch costume to (red v)\n    end\n    if <(skin select) = [3]> then\n        switch costume to (teal v)\n    end\n    if <(skin select) = [4]> then\n        switch costume to (rainbow v)\n    end\n    if <(skin select) = [5]> then\n        switch costume to (blue?? v)\n    end\n    if <(skin select) = [6]> then\n        switch costume to (grass v)\n    end\n    if <(skin select) = [7]> then\n        switch costume to (lava v)\n    end\n    if <(skin select) = [8]> then\n        if <[vip v] contains (username)?> then\n            switch costume to (cracked v)\n        else\n            switch costume to (cracked_locked v)\n        end\n    end\n    if <(skin select) = [9]> then\n        if <[followers v] contains (username)?> then\n            switch costume to (cave v)\n        else\n            switch costume to (cave locked v)\n        end\n    end\n    if <(skin select) = [10]> then\n        switch costume to (bot v)\n    end\n    if <(skin select) > [10]> then\n        set [skin select v] to [1]\n    end\n    if <(skin select) < [1]> then\n        set [skin select v] to [10]\n    end\nend\n\nwhen I receive [select v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@SkinButtons\n\nwhen flag clicked\nset [cloneid v] to [1]\nshow\nrepeat (3)\n    create clone of (_myself_ v)\n    change [cloneid v] by (1)\nend\nhide\n\nwhen I start as a clone\nforever\n    if <(cloneID) = [1]> then\n        switch costume to (left v)\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            wait until <not <mouse down?>>\n            change [skin select v] by (-1)\n        end\n    else\n        if <(cloneID) = [2]> then\n            switch costume to (right v)\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                wait until <not <mouse down?>>\n                change [skin select v] by (1)\n            end\n        else\n            if <(cloneID) = [3]> then\n                switch costume to (select v)\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    if <not <(skin select) = [8]>> then\n                        broadcast (select v)\n                    else\n                        if < (VIP) contains (username)?> then\n                            broadcast (select v)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [select v]\ndelete this clone\n\n@Player\n\nwhen flag clicked\nshow list [chat v]\nset [is the chat open v] to [0]\nforever\n    if <<key (t v) pressed?> or <<touching (mouse pointer v)?> and <mouse down?>>> then\n        if <(is the chat open) = [1]> then\n            set [is the chat open v] to [0]\n        else\n            set [is the chat open v] to [1]\n        end\n        wait until <<not <<touching (mouse pointer v)?> and <mouse down?>>> and <not <key (t v) pressed?>>>\n    end\nend\n\nwhen flag clicked\nset [max players v] to [10]\nset [my player # v] to [0]\nset [connect v] to [Connecting]\nbroadcast (setup opponents v) and wait\nbroadcast (join game v) and wait\nif <(MY PLAYER #) > [0]> then\n    set [connect v] to [Connected]\nelse\n    set [connect v] to [Full]\nend\nbroadcast (begin v)\n\ndefine write (val) to encoded\nset [letter # v] to [1]\nrepeat (length of (val))\n    set [encoded v] to (join (encoded) (item # of (letter (letter #) of (val)) in [code v]))\n    change [letter # v] by (1)\nend\nset [encoded v] to (join (encoded) [00])\n\nwhen I receive [begin v]\nforever\n    if <(MY PLAYER #) > [0]> then\n        send cloud data\n    end\nend\n\ndefine set cloud # (player) to (value)\nif <(player) = [1]> then\n    set [☁ p1 v] to (value)\nelse\n    if <(player) = [2]> then\n        set [☁ p2 v] to (value)\n    else\n        if <(player) = [3]> then\n            set [☁ p3 v] to (value)\n        else\n            if <(player) = [4]> then\n                set [☁ p4 v] to (value)\n            else\n                if <(player) = [5]> then\n                    set [☁ p5 v] to (value)\n                else\n                    if <(player) = [6]> then\n                        set [☁ p6 v] to (value)\n                    else\n                        if <(player) = [7]> then\n                            set [☁ p7 v] to (value)\n                        else\n                            if <(player) = [8]> then\n                                set [☁ p8 v] to (value)\n                            else\n                                if <(player) = [9]> then\n                                    set [☁ p9 v] to (value)\n                                else\n                                    if <(player) = [10]> then\n                                        set [☁ p10 v] to (value)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine send cloud data\nset [encoded v] to []\nwrite (costume [number v]) to encoded\nwrite (username) to encoded\nwrite (round ((timer) * (10))) to encoded\nwrite (x) to encoded\nwrite (y) to encoded\nwrite (CHAT) to encoded\nset cloud # (MY PLAYER #) to (encoded)\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Reset\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v)\n    end\n    if <(EXIT) = [win]> then\n        Game - Win\n    else\n        set [exit v] to []\n    end\nend\n\ndefine Reset\nif <(CHECKPOINT) = [0]> then\n    set [x v] to [-100]\n    set [y v] to [-60]\n    set [scroll y v] to (y)\n    set [scroll x v] to (x)\nelse\n    if <(CHECKPOINT) = [1]> then\n        set [x v] to [210]\n        set [y v] to [60]\n        set [scroll y v] to (y)\n        set [scroll x v] to (x)\n    else\n        if <(CHECKPOINT) = [2]> then\n    end\nend\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [5]\nset [timout v] to [0]\nset [exit v] to []\nset size to (100) %\nshow\nset rotation style [left-right v]\n\ndefine Tick\nif <touching (ladder v)?> then\n    change [sx v] by ((2) * (<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<((mouse x) - (20)) > (x position)> and <mouse down?>>> - <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<((mouse x) + (20)) < (x position)> and <mouse down?>>>))\n    set [sx v] to ((sx) * (0.65))\nelse\n    change [sx v] by ((1.8) * (<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<((mouse x) - (20)) > (x position)> and <mouse down?>>> - <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<((mouse x) + (20)) < (x position)> and <mouse down?>>>))\n    set [sx v] to ((sx) * (0.75))\nend\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<((mouse y) - (20)) > (y position)> and <mouse down?>>> then\n    if <(in air) < [3]> then\n        if <(sy) > [-2]> then\n            set [sy v] to [12]\n        end\n    end\nend\nif <touching (bouncy v)?> then\n    set [sy v] to [20]\nend\nif <touching (ladder v)?> then\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<((mouse y) - (20)) > (y position)> and <mouse down?>>> then\n        change [y v] by (6)\n    end\n    if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<((mouse y) + (20)) < (y position)> and <mouse down?>>> then\n        change [y v] by (-6)\n    end\n    set [sy v] to [0]\nelse\n    if <(sy) > [-20]> then\n        change [sy v] by (-1.3)\n    end\nend\nChange player y by (sy)\n Test - Die\nset [scroll x v] to (x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nPosition\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\nif <<<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<((mouse x) - (20)) > (x position)> and <mouse down?>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<((mouse x) + (20)) < (x position)> and <mouse down?>>>> or <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<((mouse y) - (20)) > (y position)> and <mouse down?>>> or <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<((mouse y) + (20)) > (y position)> and <mouse down?>>>>> then\n    set [timout v] to [0]\nelse\n    change [timout v] by (1)\nend\nif <(timout) > [999]> then\n    broadcast (timeout v)\n    hide\nend\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platforms v)?> then\n    repeat (8)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-8)\n    if <touching (platforms v)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<((mouse y) - (5)) > (y position)> and <mouse down?>>> then\n            if <(sx) > [0]> then\n                set [sx v] to [-16]\n            else\n                set [sx v] to [16]\n            end\n            set [sy v] to [12]\n        end\n        Position\n    end\n    repeat until <not <touching (platforms v)?>>\n        change [x v] by ((([abs v] of (sx) ) / (sx)) * (-1))\n        Position\n    end\nend\n\ndefine Change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platforms v)?>>\n    change [y v] by ((([abs v] of (sy) ) / (sy)) * (-1))\n    if <(sy) < [0]> then\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\nif <touching (jump_through v)?> then\n    if <(sy) < [0]> then\n        change [y v] by ((sy) * (-1))\n        set [sy v] to [0]\n        set [in air v] to [0]\n        Position\n    end\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine  Test - Die\nif <(Health) = [1]> then\n    change [deaths v] by (1)\n    broadcast (i died v)\n    set [exit v] to [die]\nend\n\ndefine Game - Win\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nchange [level v] by (1)\nwait (1) seconds\nset [ghost v] effect to (0)\n\nwhen flag clicked\nforever\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<((mouse y) - (20)) > (y position)> and <mouse down?>>> and <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<((mouse x) + (15)) > (x position)> and <mouse down?>>>> then\n        switch costume to (join [right up] (skin))\n    else\n        if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<((mouse y) - (20)) > (y position)> and <mouse down?>>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<((mouse x) - (15)) < (x position)> and <mouse down?>>>> then\n            switch costume to (join [left up] (skin))\n        else\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<((mouse y) - (20)) > (y position)> and <mouse down?>>> then\n                switch costume to (join [up] (skin))\n            else\n                if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<((mouse x) + (15)) > (x position)> and <mouse down?>>> then\n                    switch costume to (join [right] (skin))\n                else\n                    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<((mouse x) - (15)) < (x position)> and <mouse down?>>> then\n                        switch costume to (join [left] (skin))\n                    else\n                        switch costume to (join [middle] (skin))\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [timeout v]\nhide\n\nwhen flag clicked\nset [deaths v] to [0]\n\nwhen flag clicked\nforever\n    if <touching (opponents v)?> then\n        broadcast (-health v)\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#c7c7c7)?> then\n        broadcast (i died v)\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    set [skin v] to (skin select)\nend\n\nwhen flag clicked\nbroadcast (Green flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [select v]\nset [color v] to [0]\nset pen size to (10)\nforever\n    if <(color) > [100]> then\n        set [color v] to [0]\n    end\n    change [color v] by (1)\n    if <(skin) = [4]> then\n        broadcast (draw player rainbow skin v)\n    end\nend\n\nwhen flag clicked\ndelete all of [enemyrainbow? v]\ndelete all of [enemyx v]\ndelete all of [enemyy v]\n\n@Pen\n\ndefine draw player rainbow skin with color (color)\npen up\nerase all\nset pen (color v) to (color)\ngo to x: (([x position v] of [player v]) - (10)) y: (([y position v] of [player v]) + (10))\npen down\ngo to x: (([x position v] of [player v]) + (10)) y: (([y position v] of [player v]) + (10))\ngo to x: (([x position v] of [player v]) + (10)) y: (([y position v] of [player v]) - (10))\ngo to x: (([x position v] of [player v]) - (10)) y: (([y position v] of [player v]) - (10))\ngo to x: (([x position v] of [player v]) - (10)) y: (([y position v] of [player v]) + (10))\npen up\nset [idx v] to [0]\nrepeat (length of [enemyrainbow? v])\n    change [idx v] by (1)\n    if <<(item (idx) of [enemyrainbow? v]) = [1]> and <<not <(item (idx) of [enemyx v]) = [0]>> and <not <(item (idx) of [enemyy v]) = [0]>>>> then\n        go to x: ((item (idx) of [enemyx v]) - (10)) y: ((item (idx) of [enemyy v]) + (10))\n        pen down\n        go to x: ((item (idx) of [enemyx v]) + (10)) y: ((item (idx) of [enemyy v]) + (10))\n        go to x: ((item (idx) of [enemyx v]) + (10)) y: ((item (idx) of [enemyy v]) - (10))\n        go to x: ((item (idx) of [enemyx v]) - (10)) y: ((item (idx) of [enemyy v]) - (10))\n        go to x: ((item (idx) of [enemyx v]) - (10)) y: ((item (idx) of [enemyy v]) + (10))\n        pen up\n    end\nend\n\nwhen I receive [draw player rainbow skin v]\ndraw player rainbow skin with color (color)\n\nwhen flag clicked\nerase all\nset pen size to (10)\n\n