A Scroll Platformer Multiplayer

Instructions: Use the arrow keys in pc mode or drag in mobile mode to move player 1 and WASD to move player 2. On a shared screen, the camera adjusts to the distance of the two characters. And on screen for one, by pressing the "space" key the camera follows the indicated player.\nEnemies have a bug in the shared screen mode :/\nOriginal: https://scratch.mit.edu/projects/318447129

@Stage\n\nwhen flag clicked\nforever\n    if <(Level) = [13]> then\n        switch backdrop to (backdrop2 v)\n    else\n        if <(Level) > [13]> then\n            switch backdrop to (backdrop3 v)\n        else\n            switch backdrop to (backdrop1 v)\n        end\n    end\nend\n\nwhen I receive [turn page v]\nforever\n    play sound [Bob-omb Battlefi v] until done\nend\n\n@Improved2\n\nwhen I receive [turn page v]\nset [x v] to [-202]\nset [y v] to [-100]\nset [to scroll x v] to [0]\nset [to scroll y v] to [0]\nif <(Type Scroll) = [2]> then\n    create clone of (_myself_ v)\nend\nReset Level\nforever\n    switch costume to (hitbox v)\n    if <(wall jump) > [0]> then\n        change [wall jump v] by (-1)\n    else\n        Controls - Left and Right\n    end\n    if <([abs v] of (speed x) ) > [0.5]> then\n        set [last v] to (speed x)\n    end\n    Check Hit Celing / Wall (speed x) or (last)\n    Tick\nend\n\ndefine Controls - Left and Right\nset [speed x v] to ((speed x) * (0.7))\nif <<key (left arrow v) pressed?> or <(left key pressed) = [1]>> then\n    change [speed x v] by (-1.5)\nend\nif <<key (right arrow v) pressed?> or <(right key pressed) = [1]>> then\n    change [speed x v] by (1.5)\nend\nPosition\n\ndefine Controls - Jump, Crouch\nif <<key (up arrow v) pressed?> or <<(up key pressed) = [1]> or <touching (bounce v)?>>> then\n    if <<(jump key) = [0]> and <(falling?) < [3]>> then\n        set [speed y v] to [14]\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n    end\nelse\n    set [jump key v] to [0]\nend\nif <<key (down arrow v) pressed?> or <(down key pressed) = [1]>> then\n    set [in platforrm v] to [2]\nend\nPosition\n\ndefine Gravity\nif <<(speed y) < [4]> or <<key (up arrow v) pressed?> or <(up key pressed) = [1]>>> then\n    change [speed y v] by (-1)\nelse\n    change [speed y v] by (-2)\nend\nchange [y v] by (speed y)\nchange [falling? v] by (1)\nPosition\n\ndefine Check Hit Ceiling / Floor <up?>\nGet Touching \nif <(touch) = [0]> then\n    set [in platforrm v] to [1]\nelse\n    if <<up?> and <(touch) = [1]>> then\n        set [in platforrm v] to [2]\n    end\nend\nrepeat until <(touch) < (in platforrm)>\n    if <up?> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [falling? v] to [0]\n    end\n    Position\n    Get Touching <not <up?>>\n    set [speed y v] to [0]\nend\n\ndefine Get Touching <check platform?>\nif <touching (ground v)?> then\n    set [touch v] to [9]\nelse\n    if <<check platform?> and <touching (platforms v)?>> then\n        set [touch v] to [1]\n    else\n        set [touch v] to [0]\n    end\nend\n\ndefine Reset Level\nset size to (25) %\nset rotation style [left-right v]\npoint in direction (90)\nif <(Type Scroll) = [2]> then\n    set [x v] to ((((480) * (Level1)) - (480)) - (202))\nelse\n    set [x v] to ((((480) * (Level)) - (480)) - (202))\nend\nset [y v] to [-100]\nPosition\nCheck Hit Ceiling / Floor <(speed y) > [0]>\nreset timer\nshow\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling? v] to [10]\nset [in platforrm v] to [1]\nset [frame v] to [0]\nset [wall jump v] to [0]\nbroadcast (spawn enemies v)\n\ndefine Set Costume\nif <(falling?) < [6]> then\n    if <(frame) = [0]> then\n        switch costume to (costume13 v)\n    else\n        switch costume to ([floor v] of ((1) + ((frame) mod (12))) )\n    end\nelse\n    if <(speed y) > [0]> then\n        switch costume to (costume13 v)\n    else\n        switch costume to (costume13 v)\n    end\nend\n\nwhen flag clicked\nset [level v] to [1]\n\nwhen I receive [reset level v]\nReset Level\n\nwhen I receive [bounce v]\nset [speed y v] to [6]\nset [falling? v] to [6]\nset [jump key v] to [1]\n\ndefine Position\ngo to x: (((x) - (SCROLL X)) * (ZOOM)) y: (((y) - (SCROLL Y)) * (ZOOM))\nset size to ((25) * (ZOOM)) %\nif <<(round (((x) - (SCROLL X)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y)) * (ZOOM))) = (round (y position))>> then\n    show\nelse\n    hide\n    if <<(Type Scroll) = [1]> and <(Screen For) = [2]>> then\n        if <([abs v] of (((x) - (SCROLL X)) * (ZOOM)) ) > [240]> then\n            set [x v] to ([x v] of [improved3 v])\n            set [y v] to ([y v] of [improved3 v])\n            set [speed x v] to [0]\n            set [speed y v] to [0]\n            Position\n            Check Hit Ceiling / Floor <(speed y) > [0]>\n        end\n    end\nend\n\ndefine Check Hit Celing / Wall (sx) or (lx)\nchange [x v] by (sx)\nPosition\nif <touching (ground v)?> then\n    repeat (8)\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 (-7)\n    repeat until <not <touching (ground v)?>>\n        if <<(sx) > [0]> or <(lx) > [0]>> then\n            change [x v] by (-1)\n            if <<<key (up arrow v) pressed?> or <(up key pressed) = [1]>> and <([abs v] of (speed x) ) > [3.5]>> then\n                if <(speed x) > [15]> then\n                    set [speed x v] to [15]\n                else\n                    if <(speed x) < [-15]> then\n                        set [speed x v] to [-15]\n                    else\n                        set [speed x v] to ((-1.2) * (speed x))\n                    end\n                end\n                set [speed y v] to [11]\n                set [falling? v] to [6]\n                set [wall jump v] to [15]\n                repeat (10)\n                    if <touching (ground v)?> then\n                        change [x v] by (-1)\n                        Position\n                    end\n                end\n                repeat until <not <touching (ground v)?>>\n                    Tick\n                end\n            else\n                set [speed x v] to [0]\n            end\n        else\n            if <<not <(sx) > [0]>> or <(lx) < [0]>> then\n                change [x v] by (1)\n                if <<<key (up arrow v) pressed?> or <(up key pressed) = [1]>> and <([abs v] of (speed x) ) > [3.5]>> then\n                    if <(speed x) > [15]> then\n                        set [speed x v] to [15]\n                    else\n                        if <(speed x) < [-15]> then\n                            set [speed x v] to [-15]\n                        else\n                            set [speed x v] to ((-1.2) * (speed x))\n                        end\n                    end\n                    set [speed y v] to [11]\n                    set [falling? v] to [6]\n                    set [wall jump v] to [15]\n                    repeat (10)\n                        if <touching (ground v)?> then\n                            change [x v] by (1)\n                            Position\n                        end\n                    end\n                    repeat until <not <touching (ground v)?>>\n                        Tick\n                    end\n                else\n                    set [speed x v] to [0]\n                end\n            end\n        end\n        Position\n    end\nend\n\nwhen [r v] key pressed\nbroadcast (reset level v)\n\ndefine Tick\nControls - Jump, Crouch\nGravity\nCheck Hit Ceiling / Floor <(speed y) > [0]>\nif <<(Type Scroll) = [0]> or <<(Type Scroll) = [1]> and <(Screen For) = [1]>>> then\n    if <<(Type Scroll) = [0]> and <(Multiplayer) = [1]>> then\n        change [to scroll x v] by (round (((x) - (to scroll x)) / (15)))\n        change [to scroll y v] by (round (((y) - (to scroll y)) / (15)))\n    else\n        change [scroll x v] by (round (((x) - (SCROLL X)) / (10)))\n        change [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\n        if <(SCROLL X) < [0]> then\n            set [scroll x v] to [0]\n        end\n        if <(SCROLL X) > [9600]> then\n            set [scroll x v] to [9600]\n        end\n    end\nelse\n    if <not <<(Type Scroll) = [1]> and <(Screen For) = [2]>>> then\n        change [scroll x v] by (round (((x) - (SCROLL X)) / (10)))\n        change [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\n        if <(SCROLL X) < [0]> then\n            set [scroll x v] to [0]\n        end\n        if <(SCROLL X) > [9600]> then\n            set [scroll x v] to [9600]\n        end\n    end\nend\nif <touching (hurt v)?> then\n    Reset Level\nend\nif <(y) < [-180]> then\n    Reset Level\nend\nSet Costume\nbroadcast (tick v)\nif <(Type Scroll) = [2]> then\n    if <(x) > (((480) * (Level1)) - (240))> then\n        change [level1 v] by (1)\n        broadcast (spawn enemies v)\n    end\nelse\n    if <(x) > (((480) * (Level)) - (240))> then\n        change [level v] by (1)\n        broadcast (spawn enemies v)\n    end\nend\n\nwhen I receive [reset level 2 v]\nPosition\n\nwhen I start as a clone\nforever\n    set [x v] to ([x v] of [improved2 v])\n    set [y v] to ([y v] of [improved2 v])\n    Position2\nend\n\ndefine Position2\ngo to x: (((x) - (SCROLL X2)) * (ZOOM)) y: (((y) - (SCROLL Y2)) * (ZOOM))\nset size to ((25) * (ZOOM)) %\nif <<<(round (((x) - (SCROLL X2)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y2)) * (ZOOM))) = (round (y position))>> and <(y) < [180]>> then\n    show\nelse\n    hide\nend\n\n@Improved3\n\nwhen I receive [turn page v]\nset [x v] to [-202]\nset [y v] to [-100]\nset [to scroll x v] to [0]\nset [to scroll y v] to [0]\nif <(Type Scroll) = [2]> then\n    create clone of (_myself_ v)\nend\nReset Level\nforever\n    if <(Multiplayer) = [1]> then\n        switch costume to (hitbox v)\n        if <(wall jump) > [0]> then\n            change [wall jump v] by (-1)\n        else\n            Controls - Left and Right\n        end\n        if <([abs v] of (speed x) ) > [0.5]> then\n            set [last v] to (speed x)\n        end\n        Check Hit Celing / Wall (speed x) or (last)\n        Tick\n    else\n        hide\n    end\nend\n\ndefine Controls - Left and Right\nset [speed x v] to ((speed x) * (0.7))\nif <<key (a v) pressed?> or <(left key pressed) = [1]>> then\n    change [speed x v] by (-1.5)\nend\nif <<key (d v) pressed?> or <(right key pressed) = [1]>> then\n    change [speed x v] by (1.5)\nend\nPosition\n\ndefine Controls - Jump, Crouch\nif <<key (w v) pressed?> or <<(up key pressed) = [1]> or <touching (bounce v)?>>> then\n    if <<(jump key) = [0]> and <(falling?) < [3]>> then\n        set [speed y v] to [14]\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n    end\nelse\n    set [jump key v] to [0]\nend\nif <<key (s v) pressed?> or <(down key pressed) = [1]>> then\n    set [in platforrm v] to [2]\nend\nPosition\n\ndefine Gravity\nif <<(speed y) < [4]> or <<key (w v) pressed?> or <(up key pressed) = [1]>>> then\n    change [speed y v] by (-1)\nelse\n    change [speed y v] by (-2)\nend\nchange [y v] by (speed y)\nchange [falling? v] by (1)\nPosition\n\ndefine Check Hit Ceiling / Floor <up?>\nGet Touching \nif <(touch) = [0]> then\n    set [in platforrm v] to [1]\nelse\n    if <<up?> and <(touch) = [1]>> then\n        set [in platforrm v] to [2]\n    end\nend\nrepeat until <(touch) < (in platforrm)>\n    if <up?> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [falling? v] to [0]\n    end\n    Position\n    Get Touching <not <up?>>\n    set [speed y v] to [0]\nend\n\ndefine Get Touching <check platform?>\nif <<<touching (ground v)?> and <(Type Scroll) < [2]>> or <<touching (ground2 v)?> and <(Type Scroll) = [2]>>> then\n    set [touch v] to [9]\nelse\n    if <<check platform?> and <<<touching (platforms v)?> and <(Type Scroll) < [2]>> or <<touching (platforms2 v)?> and <(Type Scroll) = [2]>>>> then\n        set [touch v] to [1]\n    else\n        set [touch v] to [0]\n    end\nend\n\ndefine Reset Level\nset size to (25) %\nset rotation style [left-right v]\npoint in direction (90)\nif <(Type Scroll) = [2]> then\n    set [x v] to ((((480) * (Level2)) - (480)) - (202))\nelse\n    set [x v] to ((((480) * (Level)) - (480)) - (202))\nend\nset [y v] to [-100]\nPosition\nCheck Hit Ceiling / Floor <(speed y) > [0]>\nreset timer\nshow\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling? v] to [10]\nset [in platforrm v] to [1]\nset [frame v] to [0]\nset [wall jump v] to [0]\nif <(Type Scroll) = [2]> then\n    broadcast (spawn enemies 2 v)\nelse\n    broadcast (spawn enemies v)\nend\n\ndefine Set Costume\nif <(falling?) < [6]> then\n    if <(frame) = [0]> then\n        switch costume to (costume13 v)\n    else\n        switch costume to ([floor v] of ((1) + ((frame) mod (12))) )\n    end\nelse\n    if <(speed y) > [0]> then\n        switch costume to (costume13 v)\n    else\n        switch costume to (costume13 v)\n    end\nend\n\nwhen flag clicked\nset [level v] to [1]\n\nwhen I receive [reset level 2 v]\nReset Level\n\nwhen I receive [bounce 2 v]\nset [speed y v] to [6]\nset [falling? v] to [6]\nset [jump key v] to [1]\n\ndefine Position\nif <(Type Scroll) = [2]> then\n    go to x: (((x) - (SCROLL X2)) * (ZOOM)) y: (((y) - (SCROLL Y2)) * (ZOOM))\n    set size to ((25) * (ZOOM)) %\n    if <<<(round (((x) - (SCROLL X2)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y2)) * (ZOOM))) = (round (y position))>> and <(y) < [180]>> then\n        show\n    else\n        hide\n    end\nelse\n    go to x: (((x) - (SCROLL X)) * (ZOOM)) y: (((y) - (SCROLL Y)) * (ZOOM))\n    set size to ((25) * (ZOOM)) %\n    if <<(round (((x) - (SCROLL X)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y)) * (ZOOM))) = (round (y position))>> then\n        show\n    else\n        hide\n        if <<(Type Scroll) = [1]> and <(Screen For) = [1]>> then\n            if <([abs v] of (((x) - (SCROLL X)) * (ZOOM)) ) > [240]> then\n                set [x v] to ([x v] of [improved2 v])\n                set [y v] to ([y v] of [improved2 v])\n                set [speed x v] to [0]\n                set [speed y v] to [0]\n                Position\n                Check Hit Ceiling / Floor <(speed y) > [0]>\n            end\n        end\n    end\nend\n\ndefine Check Hit Celing / Wall (sx) or (lx)\nchange [x v] by (sx)\nPosition\nif <<<touching (ground v)?> and <(Type Scroll) < [2]>> or <<touching (ground2 v)?> and <(Type Scroll) = [2]>>> then\n    repeat (8)\n        change [y v] by (1)\n        Position\n        if <(Type Scroll) = [2]> then\n            if <not <touching (ground2 v)?>> then\n                stop [this script v]\n            end\n        else\n            if <not <touching (ground v)?>> then\n                stop [this script v]\n            end\n        end\n    end\n    change [y v] by (-7)\n    if <(Type Scroll) = [2]> then\n        repeat until <not <touching (ground2 v)?>>\n            if <<(sx) > [0]> or <(lx) > [0]>> then\n                change [x v] by (-1)\n                if <<<key (w v) pressed?> or <(up key pressed) = [1]>> and <([abs v] of (speed x) ) > [3.5]>> then\n                    if <(speed x) > [15]> then\n                        set [speed x v] to [15]\n                    else\n                        if <(speed x) < [-15]> then\n                            set [speed x v] to [-15]\n                        else\n                            set [speed x v] to ((-1.2) * (speed x))\n                        end\n                    end\n                    set [speed y v] to [11]\n                    set [falling? v] to [6]\n                    set [wall jump v] to [15]\n                    repeat (10)\n                        if <touching (ground2 v)?> then\n                            change [x v] by (-1)\n                            Position\n                        end\n                    end\n                    repeat until <not <touching (ground2 v)?>>\n                        Tick\n                    end\n                else\n                    set [speed x v] to [0]\n                end\n            else\n                if <<not <(sx) > [0]>> or <(lx) < [0]>> then\n                    change [x v] by (1)\n                    if <<<key (w v) pressed?> or <(up key pressed) = [1]>> and <([abs v] of (speed x) ) > [3.5]>> then\n                        if <(speed x) > [15]> then\n                            set [speed x v] to [15]\n                        else\n                            if <(speed x) < [-15]> then\n                                set [speed x v] to [-15]\n                            else\n                                set [speed x v] to ((-1.2) * (speed x))\n                            end\n                        end\n                        set [speed y v] to [11]\n                        set [falling? v] to [6]\n                        set [wall jump v] to [15]\n                        repeat (10)\n                            if <touching (ground2 v)?> then\n                                change [x v] by (1)\n                                Position\n                            end\n                        end\n                        repeat until <not <touching (ground2 v)?>>\n                            Tick\n                        end\n                    else\n                        set [speed x v] to [0]\n                    end\n                end\n            end\n            Position\n        end\n    else\n        repeat until <not <touching (ground v)?>>\n            if <<(sx) > [0]> or <(lx) > [0]>> then\n                change [x v] by (-1)\n                if <<<key (w v) pressed?> or <(up key pressed) = [1]>> and <([abs v] of (speed x) ) > [3.5]>> then\n                    if <(speed x) > [15]> then\n                        set [speed x v] to [15]\n                    else\n                        if <(speed x) < [-15]> then\n                            set [speed x v] to [-15]\n                        else\n                            set [speed x v] to ((-1.2) * (speed x))\n                        end\n                    end\n                    set [speed y v] to [11]\n                    set [falling? v] to [6]\n                    set [wall jump v] to [15]\n                    repeat (10)\n                        if <touching (ground v)?> then\n                            change [x v] by (-1)\n                            Position\n                        end\n                    end\n                    repeat until <not <touching (ground v)?>>\n                        Tick\n                    end\n                else\n                    set [speed x v] to [0]\n                end\n            else\n                if <<not <(sx) > [0]>> or <(lx) < [0]>> then\n                    change [x v] by (1)\n                    if <<<key (w v) pressed?> or <(up key pressed) = [1]>> and <([abs v] of (speed x) ) > [3.5]>> then\n                        if <(speed x) > [15]> then\n                            set [speed x v] to [15]\n                        else\n                            if <(speed x) < [-15]> then\n                                set [speed x v] to [-15]\n                            else\n                                set [speed x v] to ((-1.2) * (speed x))\n                            end\n                        end\n                        set [speed y v] to [11]\n                        set [falling? v] to [6]\n                        set [wall jump v] to [15]\n                        repeat (10)\n                            if <touching (ground v)?> then\n                                change [x v] by (1)\n                                Position\n                            end\n                        end\n                        repeat until <not <touching (ground v)?>>\n                            Tick\n                        end\n                    else\n                        set [speed x v] to [0]\n                    end\n                end\n            end\n            Position\n        end\n    end\nend\n\nwhen [r v] key pressed\nbroadcast (reset level 2 v)\n\ndefine Tick\nControls - Jump, Crouch\nGravity\nCheck Hit Ceiling / Floor <(speed y) > [0]>\nif <<(Type Scroll) = [0]> or <<(Type Scroll) = [1]> and <(Screen For) = [2]>>> then\n    if <(Type Scroll) = [0]> then\n        change [to scroll x v] by (round (((x) - (to scroll x)) / (15)))\n        change [to scroll y v] by (round (((y) - (to scroll y)) / (15)))\n    else\n        change [scroll x v] by (round (((x) - (SCROLL X)) / (10)))\n        change [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\n        if <(SCROLL X) < [0]> then\n            set [scroll x v] to [0]\n        end\n        if <(SCROLL X) > [9600]> then\n            set [scroll x v] to [9600]\n        end\n    end\nelse\n    if <not <<(Type Scroll) = [1]> and <(Screen For) = [1]>>> then\n        change [scroll x2 v] by (round (((x) - (SCROLL X2)) / (10)))\n        change [scroll y2 v] by (round (((y) - (SCROLL Y2)) / (10)))\n        if <(SCROLL X2) < [0]> then\n            set [scroll x2 v] to [0]\n        end\n        if <(SCROLL X2) > [9600]> then\n            set [scroll x2 v] to [9600]\n        end\n    end\nend\nif <<<touching (hurt v)?> and <(Type Scroll) < [2]>> or <<touching (hurt2 v)?> and <(Type Scroll) = [2]>>> then\n    Reset Level\nend\nif <(y) < [-180]> then\n    Reset Level\nend\nSet Costume\nbroadcast (tick v)\nif <(Type Scroll) = [2]> then\n    if <(x) > (((480) * (Level2)) - (240))> then\n        change [level2 v] by (1)\n        broadcast (spawn enemies 2 v)\n    end\nelse\n    if <(x) > (((480) * (Level)) - (240))> then\n        change [level v] by (1)\n        broadcast (spawn enemies v)\n    end\nend\n\nwhen I receive [reset level v]\nPosition\n\nwhen I start as a clone\nforever\n    set [x v] to ([x v] of [improved3 v])\n    set [y v] to ([y v] of [improved3 v])\n    Position2\nend\n\ndefine Position2\ngo to x: (((x) - (SCROLL X)) * (ZOOM)) y: (((y) - (SCROLL Y)) * (ZOOM))\nset size to ((25) * (ZOOM)) %\nif <<(round (((x) - (SCROLL X)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y)) * (ZOOM))) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\n@Ground\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nset [i v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [scroll x2 v] to [0]\nset [scroll y2 v] to [0]\nQuick\n\ndefine Position\ngo to x: (((x) - (SCROLL X)) * (ZOOM)) y: (((y) - (SCROLL Y)) * (ZOOM))\nset size to ((100) * (ZOOM)) %\nif <<(round (((x) - (SCROLL X)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y)) * (ZOOM))) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\ndefine Create Clone (x) (y) (for)\nset [x v] to (x)\nset [y v] to (y)\nset [for v] to (for)\nnext costume\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\nPosition\n\ndefine Quick\nswitch costume to (level 1 v)\nrepeat (20)\n    change [i v] by (1)\n    Create Clone ((480) * (i)) [0] [1]\nend\nset [x v] to [0]\nset [y v] to [0]\nset [for v] to [1]\nswitch costume to (level 1 v)\n\n@hurt\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nset [j v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nQuick\n\ndefine Position\ngo to x: (((x) - (SCROLL X)) * (ZOOM)) y: (((y) - (SCROLL Y)) * (ZOOM))\nset size to ((100) * (ZOOM)) %\nif <<(round (((x) - (SCROLL X)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y)) * (ZOOM))) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\ndefine Create Clone (x) (y) (for)\nset [x v] to (x)\nset [y v] to (y)\nset [for v] to (for)\nnext costume\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [8]> then\n        turn right (1.5) degrees\n    else\n        if <(costume [number v]) = [9]> then\n            turn right (2.5) degrees\n        else\n            point in direction (90)\n        end\n    end\nend\n\nwhen I receive [tick v]\nPosition\n\ndefine Quick\nswitch costume to (level 1 v)\nrepeat (20)\n    change [j v] by (1)\n    Create Clone ((480) * (j)) [0] [1]\nend\nset [x v] to [0]\nset [y v] to [0]\nset [for v] to [1]\nswitch costume to (level 1 v)\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen I receive [turn page v]\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (50)\ngo to [front v] layer\nif <(Mobile?) = [0]> then\n    hide\nend\n\n@Sprite2\n\nwhen flag clicked\nhide\nset [left key pressed v] to [0]\nset [right key pressed v] to [0]\nset [down key pressed v] to [0]\nset [down key pressed v] to [0]\n\nif <<(direction) > [44]> and <(direction) < [91]>> then\n\nwhen I receive [turn page v]\ngo to x: (0) y: (0)\nset [left key pressed v] to [0]\nset [right key pressed v] to [0]\nset [down key pressed v] to [0]\nset [down key pressed v] to [0]\nshow\nset [ghost v] effect to (50)\ngo to [front v] layer\nforever\n    go to x: (0) y: (0)\n    set [left key pressed v] to [0]\n    set [right key pressed v] to [0]\n    set [up key pressed v] to [0]\n    set [down key pressed v] to [0]\n    if <(Mobile?) = [0]> then\n        hide\n        stop [this script v]\n    end\n    if <mouse down?> then\n        go to x: (0) y: (0)\n        point towards (mouse-pointer v)\n        move (28) steps\n        if <<(direction) > [-60]> and <(direction) < [60]>> then\n            set [up key pressed v] to [1]\n        else\n            if <<(direction) < [-120]> or <(direction) > [120]>> then\n                set [down key pressed v] to [1]\n            end\n        end\n        if <<(direction) > [30]> and <(direction) < [150]>> then\n            set [right key pressed v] to [1]\n        else\n            if <<(direction) > [-150]> and <(direction) < [-30]>> then\n                set [left key pressed v] to [1]\n            end\n        end\n    end\nend\n\n@Platforms\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nset [k v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nQuick\n\ndefine Create Clone (x) (y) (for)\nset [x v] to (x)\nset [y v] to (y)\nset [for v] to (for)\nnext costume\ncreate clone of (_myself_ v)\n\ndefine Position\ngo to x: (((x) - (SCROLL X)) * (ZOOM)) y: (((y) - (SCROLL Y)) * (ZOOM))\nset size to ((100) * (ZOOM)) %\nif <<(round (((x) - (SCROLL X)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y)) * (ZOOM))) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\nPosition\n\ndefine Quick\nswitch costume to (costume1 v)\nrepeat (20)\n    change [k v] by (1)\n    Create Clone ((480) * (k)) [0] [1]\nend\nset [x v] to [0]\nset [y v] to [0]\nset [for v] to [1]\nswitch costume to (costume1 v)\n\n@Sprite3\n\nwhen flag clicked\nshow\npoint in direction (90)\nhide variable [level v]\nhide variable [level1 v]\nhide variable [level2 v]\nset [multiplayer v] to [1]\nset [level v] to [1]\nset [level1 v] to [1]\nset [level2 v] to [1]\ngo to [front v] layer\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nset [id v] to [0]\nrepeat (5)\n    change [id v] by (1)\n    create clone of (_myself_ v)\nend\nforever\n    set [id v] to [0]\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(id) = [0]> then\n    go to [front v] layer\n    go [forward v] (1) layers\n    go to x: (pick random (-240) to (240)) y: (-480)\n    point in direction (90)\n    set rotation style [all around v]\n    switch costume to (costume4 v)\n    show\n    set [ghost v] effect to (50)\n    repeat (40)\n        turn right (3) degrees\n        change y by (10)\n    end\n    repeat until <touching (_edge_ v)?>\n        turn right (3) degrees\n        change y by (10)\n    end\n    change y by (10)\n    delete this clone\nelse\n    if <(id) = [1]> then\n        go to [front v] layer\n        go to x: (0) y: (0)\n        switch costume to (costume5 v)\n        show\n    else\n        if <(id) = [2]> then\n            go to [front v] layer\n            go to x: (-150) y: (0)\n            switch costume to (costume2 v)\n            show\n            forever\n                if <touching (mouse-pointer v)?> then\n                    set [brightness v] effect to (50)\n                    if <mouse down?> then\n                        set [mobile? v] to [0]\n                        set [type scroll v] to [0]\n                        start sound [Collect v]\n                        broadcast (turn page v)\n                    end\n                else\n                    clear graphic effects\n                end\n                if <(Multiplayer) = [0]> then\n                    delete this clone\n                end\n            end\n        else\n            if <(id) = [3]> then\n                go to [front v] layer\n                go to x: (0) y: (0)\n                switch costume to (costume3 v)\n                show\n                forever\n                    if <touching (mouse-pointer v)?> then\n                        set [brightness v] effect to (50)\n                        if <mouse down?> then\n                            set [mobile? v] to [0]\n                            set [type scroll v] to [1]\n                            set [screen for v] to [1]\n                            start sound [Collect v]\n                            broadcast (turn page v)\n                        end\n                    else\n                        clear graphic effects\n                    end\n                    if <(Multiplayer) = [0]> then\n                        delete this clone\n                    end\n                end\n            else\n                if <(id) = [4]> then\n                    go to [front v] layer\n                    go to x: (150) y: (0)\n                    switch costume to (costume6 v)\n                    show\n                    forever\n                        if <touching (mouse-pointer v)?> then\n                            set [brightness v] effect to (50)\n                            if <mouse down?> then\n                                set [mobile? v] to [0]\n                                set [type scroll v] to [2]\n                                start sound [Collect v]\n                                broadcast (turn page v)\n                            end\n                        else\n                            clear graphic effects\n                        end\n                        if <(Multiplayer) = [0]> then\n                            delete this clone\n                        end\n                    end\n                else\n                    if <(id) = [5]> then\n                        go to [front v] layer\n                        go to x: (0) y: (-100)\n                        if <(Multiplayer) = [0]> then\n                            switch costume to (costume9 v)\n                        else\n                            switch costume to (costume10 v)\n                        end\n                        show\n                        forever\n                            if <touching (mouse-pointer v)?> then\n                                set [brightness v] effect to (50)\n                                if <mouse down?> then\n                                    wait until <not <mouse down?>>\n                                    if <(Multiplayer) = [0]> then\n                                        set [multiplayer v] to [1]\n                                        switch costume to (costume10 v)\n                                        set [id v] to [2]\n                                        create clone of (_myself_ v)\n                                        set [id v] to [3]\n                                        create clone of (_myself_ v)\n                                        set [id v] to [4]\n                                        create clone of (_myself_ v)\n                                    else\n                                        set [multiplayer v] to [0]\n                                        switch costume to (costume9 v)\n                                        set [id v] to [6]\n                                        create clone of (_myself_ v)\n                                        set [id v] to [7]\n                                        create clone of (_myself_ v)\n                                    end\n                                    start sound [Collect v]\n                                end\n                            else\n                                clear graphic effects\n                            end\n                        end\n                    else\n                        if <(id) = [6]> then\n                            go to [front v] layer\n                            go to x: (-100) y: (0)\n                            switch costume to (costume7 v)\n                            show\n                            forever\n                                if <touching (mouse-pointer v)?> then\n                                    set [brightness v] effect to (50)\n                                    if <mouse down?> then\n                                        set [mobile? v] to [1]\n                                        set [type scroll v] to [0]\n                                        start sound [Collect v]\n                                        broadcast (turn page v)\n                                    end\n                                else\n                                    clear graphic effects\n                                end\n                                if <(Multiplayer) = [1]> then\n                                    delete this clone\n                                end\n                            end\n                        else\n                            if <(id) = [7]> then\n                                go to [front v] layer\n                                go to x: (100) y: (0)\n                                switch costume to (costume8 v)\n                                show\n                                forever\n                                    if <touching (mouse-pointer v)?> then\n                                        set [brightness v] effect to (50)\n                                        if <mouse down?> then\n                                            set [mobile? v] to [0]\n                                            set [type scroll v] to [0]\n                                            start sound [Collect v]\n                                            broadcast (turn page v)\n                                        end\n                                    else\n                                        clear graphic effects\n                                    end\n                                    if <(Multiplayer) = [1]> then\n                                        delete this clone\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nchange y by (10)\n\nwhen I receive [turn page v]\nif <(Type Scroll) = [2]> then\n    show variable [level1 v]\n    show variable [level2 v]\nelse\n    show variable [level v]\nend\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Sptite4\n\ndefine Gravity\nif <(speed y) < [4]> then\n    change [speed y v] by (-1)\nelse\n    change [speed y v] by (-2)\nend\nchange [y v] by (speed y)\nchange [falling? v] by (1)\nPosition\n\ndefine Check Hit Ceiling / Floor <up?>\nGet Touching \nif <(touch) = [0]> then\n    set [in platforrm v] to [1]\nelse\n    if <<up?> and <(touch) = [1]>> then\n        set [in platforrm v] to [2]\n    end\nend\nrepeat until <(touch) < (in platforrm)>\n    if <up?> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [falling? v] to [0]\n    end\n    Position\n    Get Touching <not <up?>>\n    set [speed y v] to [0]\nend\n\ndefine Get Touching <check platform?>\nif <<<<touching (ground v)?> and <not <(id) = [2]>>> or <<touching (ground2 v)?> and <(id) = [2]>>> or <touching (sptite4 v)?>> then\n    set [touch v] to [9]\nelse\n    if <<check platform?> and <<<touching (platforms v)?> and <not <(id) = [2]>>> or <<touching (platforms2 v)?> and <(id) = [2]>>>> then\n        set [touch v] to [1]\n    else\n        set [touch v] to [0]\n    end\nend\n\nwhen flag clicked\nset [level v] to [1]\nset [clone? v] to [0]\n\nwhen I receive [reset level 2 v]\nif <(id) = [2]> then\n    delete this clone\nend\n\ndefine Position\nif <(id) = [2]> then\n    go to x: (((x) - (SCROLL X2)) * (ZOOM)) y: (((y) - (SCROLL Y2)) * (ZOOM))\n    set size to ((30) * (ZOOM)) %\n    if <<(round (((x) - (SCROLL X2)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y2)) * (ZOOM))) = (round (y position))>> then\n        show\n        set [showing? v] to [1]\n    else\n        hide\n        set [showing? v] to [0]\n    end\nelse\n    go to x: (((x) - (SCROLL X)) * (ZOOM)) y: (((y) - (SCROLL Y)) * (ZOOM))\n    set size to ((30) * (ZOOM)) %\n    if <<(round (((x) - (SCROLL X)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y)) * (ZOOM))) = (round (y position))>> then\n        show\n        set [showing? v] to [1]\n    else\n        hide\n        set [showing? v] to [0]\n    end\nend\n\ndefine Check Hit Celing / Wall (sx) or (lx)\nchange [x v] by (sx)\nPosition\nif <<<touching (ground v)?> and <not <(id) = [2]>>> or <<touching (ground2 v)?> and <(id) = [2]>>> then\n    repeat (8)\n        change [y v] by (1)\n        Position\n        if <(id) = [2]> then\n            if <not <touching (ground2 v)?>> then\n                stop [this script v]\n            end\n        else\n            if <not <touching (ground v)?>> then\n                stop [this script v]\n            end\n        end\n    end\n    change [y v] by (-8)\n    if <(id) = [2]> then\n        repeat until <not <touching (ground2 v)?>>\n            if <<(sx) > [0]> or <(lx) > [0]>> then\n                change [x v] by (-1)\n                set [speed x v] to [0]\n            else\n                if <<not <(sx) > [0]>> or <(lx) < [0]>> then\n                    change [x v] by (1)\n                    set [speed x v] to [0]\n                end\n            end\n            Position\n        end\n    else\n        repeat until <not <touching (ground v)?>>\n            if <<(sx) > [0]> or <(lx) > [0]>> then\n                change [x v] by (-1)\n                set [speed x v] to [0]\n            else\n                if <<not <(sx) > [0]>> or <(lx) < [0]>> then\n                    change [x v] by (1)\n                    set [speed x v] to [0]\n                end\n            end\n            Position\n        end\n    end\nend\n\nwhen I receive [reset level v]\nif <(id) < [2]> then\n    delete this clone\nend\n\nwhen I receive [spawn enemies v]\nif <(id) < [2]> then\n    delete this clone\nend\n\nwhen I receive [spawn enemies v]\nif <(clone?) = [0]> then\n    go to x: (0) y: (0)\n    hide\n    if <(Type Scroll) < [2]> then\n        if <(Level) = [16]> then\n            Create enemy (0) (-120) (16) for [0]\n        end\n        if <(Level) = [17]> then\n            Create enemy (0) (-120) (17) for [0]\n            Create enemy (0) (-120) (17) for [0]\n            Create enemy (100) (-120) (17) for [0]\n            Create enemy (150) (-120) (17) for [0]\n        end\n        if <(Level) = [18]> then\n            Create enemy (150) (-120) (18) for [0]\n            Create enemy (150) (-120) (18) for [0]\n            Create enemy (150) (-120) (18) for [0]\n            Create enemy (0) (-120) (18) for [0]\n        end\n        if <(Level) = [19]> then\n            Create enemy (-190) (100) (19) for [0]\n            Create enemy (0) (100) (19) for [0]\n            Create enemy (190) (100) (19) for [0]\n            Create enemy (0) (-100) (19) for [0]\n            Create enemy (0) (-100) (19) for [0]\n            Create enemy (0) (-100) (19) for [0]\n        end\n        if <(Level) = [20]> then\n            Create enemy (-35) (-150) (20) for [0]\n            Create enemy (-35) (-150) (20) for [0]\n            Create enemy (-35) (-150) (20) for [0]\n            Create enemy (-35) (-150) (20) for [0]\n            Create enemy (-35) (-150) (20) for [0]\n            Create enemy (-35) (-150) (20) for [0]\n            Create enemy (-150) (-50) (20) for [0]\n        end\n    else\n        if <(Level1) = [16]> then\n            Create enemy (0) (-120) (16) for [1]\n        end\n        if <(Level1) = [17]> then\n            Create enemy (0) (-120) (17) for [1]\n            Create enemy (0) (-120) (17) for [1]\n            Create enemy (100) (-120) (17) for [1]\n            Create enemy (150) (-120) (17) for [1]\n        end\n        if <(Level1) = [18]> then\n            Create enemy (150) (-120) (18) for [1]\n            Create enemy (150) (-120) (18) for [1]\n            Create enemy (150) (-120) (18) for [1]\n            Create enemy (0) (-120) (18) for [1]\n        end\n        if <(Level1) = [19]> then\n            Create enemy (-190) (100) (19) for [1]\n            Create enemy (0) (100) (19) for [1]\n            Create enemy (190) (100) (19) for [1]\n            Create enemy (0) (-100) (19) for [1]\n            Create enemy (0) (-100) (19) for [1]\n            Create enemy (0) (-100) (19) for [1]\n        end\n        if <(Level1) = [20]> then\n            Create enemy (-35) (-150) (20) for [1]\n            Create enemy (-35) (-150) (20) for [1]\n            Create enemy (-35) (-150) (20) for [1]\n            Create enemy (-35) (-150) (20) for [1]\n            Create enemy (-35) (-150) (20) for [1]\n            Create enemy (-35) (-150) (20) for [1]\n            Create enemy (-150) (-50) (20) for [1]\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<<(distance to [improved2 v]) < (distance to [improved3 v])> and <(Type Scroll) < [2]>> or <<<(Type Scroll) = [2]> and <(id) = [1]>> or <(Multiplayer) = [0]>>> then\n        if <([x v] of [improved2 v]) < (x)> then\n            change [speed x v] by (-0.5)\n        end\n        if <([x v] of [improved2 v]) > (x)> then\n            change [speed x v] by (0.5)\n        end\n    else\n        if <([x v] of [improved3 v]) < (x)> then\n            change [speed x v] by (-0.5)\n        end\n        if <([x v] of [improved3 v]) > (x)> then\n            change [speed x v] by (0.5)\n        end\n    end\n    if <(speed x) > [1.5]> then\n        set [speed x v] to [1.5]\n    end\n    if <(speed x) < [-1.5]> then\n        set [speed x v] to [-1.5]\n    end\nend\n\nwhen I start as a clone\nhide\nshow\nset [speed x v] to [0]\nset size to ((30) * (ZOOM)) %\nset rotation style [left-right v]\nset [speed y v] to [0]\nset [clone? v] to [1]\nset [start x v] to (x)\nset [start y v] to (y)\nCheck Hit Ceiling / Floor <(speed y) > [0]>\nforever\n    switch costume to (costume15 v)\n    if <(showing?) = [1]> then\n        if <([abs v] of (speed x) ) > [0.5]> then\n            set [last v] to (speed x)\n        end\n        Check Hit Celing / Wall (speed x) or (last)\n        Gravity\n        Check Hit Ceiling / Floor <(speed y) > [0]>\n        if <<<touching (improved2 v)?> and <(([y v] of [improved2 v]) - ((15) * (ZOOM))) < (y)>> and <(id) < [2]>> then\n            broadcast (reset level v)\n        end\n        if <<<touching (improved2 v)?> and <(([y v] of [improved2 v]) - ((15) * (ZOOM))) > (y)>> and <(id) < [2]>> then\n            broadcast (bounce v)\n            switch costume to (costume14 v)\n            switch costume to (costume2 v)\n            start sound [pop2 v]\n            wait (0.1) seconds\n            delete this clone\n        end\n        if <<<touching (improved3 v)?> and <(([y v] of [improved3 v]) - ((15) * (ZOOM))) < (y)>> and <((id) mod (2)) = [0]>> then\n            broadcast (reset level 2 v)\n        end\n        if <<<touching (improved3 v)?> and <(([y v] of [improved3 v]) - ((15) * (ZOOM))) > (y)>> and <((id) mod (2)) = [0]>> then\n            broadcast (bounce 2 v)\n            switch costume to (costume14 v)\n            switch costume to (costume2 v)\n            start sound [pop2 v]\n            wait (0.1) seconds\n            delete this clone\n        end\n        if <(y) < [-180]> then\n            delete this clone\n        end\n    else\n        repeat until <(showing?) = [1]>\n            Position\n        end\n        Check Hit Ceiling / Floor <(speed y) > [0]>\n    end\nend\n\ndefine Create enemy (x) (y) (level) for (p)\nif <<<(Level) = (level)> and <(p) = [0]>> or <<<(Level1) = (level)> and <(p) = [1]>> or <<(Level2) = (level)> and <(p) = [2]>>>> then\n    if <(p) = [1]> then\n        set [x v] to ((x) + (((480) * (Level1)) - (480)))\n    else\n        if <(p) = [2]> then\n            set [x v] to ((x) + (((480) * (Level2)) - (480)))\n        else\n            set [x v] to ((x) + (((480) * (Level)) - (480)))\n        end\n    end\n    set [y v] to (y)\n    set [dizzy v] to [0]\n    set [level in v] to (level)\n    set [id v] to (p)\n    create clone of (_myself_ v)\nend\nset [x v] to [-999999]\n\nwhen I receive [tick v]\nPosition\n\nwhen I start as a clone\nforever\n    if <<<not <(Level) = (level in)>> and <(id) = [0]>> or <<<not <(Level1) = (level in)>> and <(id) = [1]>> or <<not <(Level2) = (level in)>> and <(id) = [2]>>>> then\n        delete this clone\n    end\nend\n\nwhen I receive [spawn enemies 2 v]\nif <(clone?) = [0]> then\n    go to x: (0) y: (0)\n    hide\n    if <(Type Scroll) = [2]> then\n        if <(Level2) = [16]> then\n            Create enemy (0) (-120) (16) for [2]\n        end\n        if <(Level2) = [17]> then\n            Create enemy (0) (-120) (17) for [2]\n            Create enemy (0) (-120) (17) for [2]\n            Create enemy (100) (-120) (17) for [2]\n            Create enemy (150) (-120) (17) for [2]\n        end\n        if <(Level2) = [18]> then\n            Create enemy (150) (-120) (18) for [2]\n            Create enemy (150) (-120) (18) for [2]\n            Create enemy (150) (-120) (18) for [2]\n            Create enemy (0) (-120) (18) for [2]\n        end\n        if <(Level2) = [19]> then\n            Create enemy (-190) (100) (19) for [2]\n            Create enemy (0) (100) (19) for [2]\n            Create enemy (190) (100) (19) for [2]\n            Create enemy (0) (-100) (19) for [2]\n            Create enemy (0) (-100) (19) for [2]\n            Create enemy (0) (-100) (19) for [2]\n        end\n        if <(Level2) = [20]> then\n            Create enemy (-35) (-150) (20) for [2]\n            Create enemy (-35) (-150) (20) for [2]\n            Create enemy (-35) (-150) (20) for [2]\n            Create enemy (-35) (-150) (20) for [2]\n            Create enemy (-35) (-150) (20) for [2]\n            Create enemy (-35) (-150) (20) for [2]\n            Create enemy (-150) (-50) (20) for [2]\n        end\n    end\nend\n\nwhen I receive [spawn enemies 2 v]\nif <(id) = [2]> then\n    delete this clone\nend\n\n@Logo\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    show\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\n@scroll\n\nwhen I receive [turn page v]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [zoom v] to [1]\nif <(Type Scroll) = [2]> then\n    create clone of (_myself_ v)\nend\nforever\n    if <<(Type Scroll) = [0]> and <(Multiplayer) = [1]>> then\n        set [scroll x v] to (to scroll x)\n        set [scroll y v] to (to scroll y)\n        if <(SCROLL X) < [0]> then\n            set [scroll x v] to [0]\n        end\n        if <(SCROLL X) > [9600]> then\n            set [scroll x v] to [9600]\n        end\n        if <(SCROLL X2) < [0]> then\n            set [scroll x2 v] to [0]\n        end\n        if <(SCROLL X2) > [9600]> then\n            set [scroll x2 v] to [9600]\n        end\n    end\n    if <(Type Scroll) = [2]> then\n        set [scroll y v] to [-180]\n        set [scroll y2 v] to [180]\n    else\n        set [scroll y v] to [0]\n    end\n    if <<(Type Scroll) = [0]> and <(Multiplayer) = [1]>> then\n        set [xdis v] to ([abs v] of ((([x v] of [improved2 v]) - (SCROLL X)) - (([x v] of [improved3 v]) - (SCROLL X))) )\n        set [ydis v] to ([abs v] of ((([y v] of [improved2 v]) - (SCROLL Y)) - (([y v] of [improved3 v]) - (SCROLL Y))) )\n        change [zoom v] by (((((100) - (([sqrt v] of (((xDis) * (xDis)) + ((yDis) * (yDis))) ) * (0.1))) / (75)) - (ZOOM)) / (10))\n        if <(ZOOM) > [1]> then\n            set [zoom v] to [1]\n        end\n        if <(ZOOM) < [0.5]> then\n            set [zoom v] to [0.5]\n        end\n    else\n        if <<(Type Scroll) = [2]> and <(Multiplayer) = [1]>> then\n            set [zoom v] to [0.5]\n        else\n            set [zoom v] to [1]\n        end\n    end\n    set size to ((100) * (ZOOM)) %\n    if <(Type Scroll) = [1]> then\n        show\n        go to (join [Improved] ((Screen For) + (1)))\n        if <(y position) > [155]> then\n            set y to (185)\n            point in direction (-90)\n        else\n            point in direction (90)\n        end\n        switch costume to (join [scroll] (Screen For))\n    else\n        if <(Type Scroll) = [2]> then\n            show\n            go to (improved2 v)\n            if <(y position) > [160]> then\n                set y to (185)\n                point in direction (-90)\n            else\n                point in direction (90)\n            end\n            switch costume to (scroll1 v)\n        else\n            hide\n        end\n    end\nend\n\nwhen I receive [turn page v]\nforever\n    if <(Type Scroll) = [1]> then\n        wait until <key (space v) pressed?>\n        set [screen for v] to (((Screen For) mod (2)) + (1))\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I start as a clone\nforever\n    set size to ((100) * (ZOOM)) %\n    if <(Type Scroll) = [2]> then\n        show\n        go to (improved3 v)\n        if <(y position) > [-20]> then\n            set y to (5)\n            point in direction (-90)\n        else\n            point in direction (90)\n        end\n        switch costume to (scroll2 v)\n    else\n        hide\n    end\nend\n\n@Ground2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nset [i v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [scroll x2 v] to [0]\nset [scroll y2 v] to [0]\nQuick\n\ndefine Position\ngo to x: (((x) - (SCROLL X2)) * (ZOOM)) y: (((y) - (SCROLL Y2)) * (ZOOM))\nset size to ((100) * (ZOOM)) %\nif <<<(round (((x) - (SCROLL X2)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y2)) * (ZOOM))) = (round (y position))>> and <(Type Scroll) = [2]>> then\n    show\nelse\n    hide\nend\n\ndefine Create Clone (x) (y) (for)\nset [x v] to (x)\nset [y v] to (y)\nset [for v] to (for)\nnext costume\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\nPosition\n\ndefine Quick\nswitch costume to (level 1 v)\nrepeat (20)\n    change [i v] by (1)\n    Create Clone ((480) * (i)) [0] [2]\nend\nset [x v] to [0]\nset [y v] to [0]\nset [for v] to [2]\nswitch costume to (level 1 v)\n\n@hurt2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nset [j v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nQuick\n\ndefine Position\ngo to x: (((x) - (SCROLL X2)) * (ZOOM)) y: (((y) - (SCROLL Y2)) * (ZOOM))\nset size to ((100) * (ZOOM)) %\nif <<<(round (((x) - (SCROLL X2)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y2)) * (ZOOM))) = (round (y position))>> and <(Type Scroll) = [2]>> then\n    show\nelse\n    hide\nend\n\ndefine Create Clone (x) (y) (for)\nset [x v] to (x)\nset [y v] to (y)\nset [for v] to (for)\nnext costume\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) = [8]> then\n        turn right (1.5) degrees\n    else\n        if <(costume [number v]) = [9]> then\n            turn right (2.5) degrees\n        else\n            point in direction (90)\n        end\n    end\nend\n\nwhen I receive [tick v]\nPosition\n\ndefine Quick\nswitch costume to (level 1 v)\nrepeat (20)\n    change [j v] by (1)\n    Create Clone ((480) * (j)) [0] [2]\nend\nset [x v] to [0]\nset [y v] to [0]\nset [for v] to [2]\nswitch costume to (level 1 v)\n\n@Platforms2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nset [k v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nQuick\n\ndefine Create Clone (x) (y) (for)\nset [x v] to (x)\nset [y v] to (y)\nset [for v] to (for)\nnext costume\ncreate clone of (_myself_ v)\n\ndefine Position\ngo to x: (((x) - (SCROLL X2)) * (ZOOM)) y: (((y) - (SCROLL Y2)) * (ZOOM))\nset size to ((100) * (ZOOM)) %\nif <<<(round (((x) - (SCROLL X2)) * (ZOOM))) = (round (x position))> and <(round (((y) - (SCROLL Y2)) * (ZOOM))) = (round (y position))>> and <(Type Scroll) = [2]>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\nPosition\n\ndefine Quick\nswitch costume to (costume1 v)\nrepeat (20)\n    change [k v] by (1)\n    Create Clone ((480) * (k)) [0] [2]\nend\nset [x v] to [0]\nset [y v] to [0]\nset [for v] to [2]\nswitch costume to (costume1 v)\n\n@Background\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nhide\n\nwhen I receive [turn page v]\nif <(Type Scroll) = [2]> then\n    create clone of (_myself_ v)\n    switch backdrop to (backdrop1 v)\n    forever\n        go to [back v] layer\n        set size to (50) %\n        go to x: (0) y: (90)\n        show\n        if <(Level1) = [13]> then\n            switch costume to (backdrop2 v)\n        else\n            if <(Level1) > [13]> then\n                switch costume to (backdrop3 v)\n            else\n                switch costume to (backdrop1 v)\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nswitch costume to (backdrop1 v)\nforever\n    go to [back v] layer\n    set size to (50) %\n    go to x: (0) y: (-90)\n    show\n    if <(Level2) = [13]> then\n        switch costume to (backdrop2 v)\n    else\n        if <(Level2) > [13]> then\n            switch costume to (backdrop3 v)\n        else\n            switch costume to (backdrop1 v)\n        end\n    end\nend\n\n