MarioCube - A Platformer                       #games
@Stage\n\nwhen flag clicked\nforever\n    set [mouse v] to (join (mouse x) (join [/] (mouse y)))\nend\n\nwhen flag clicked\nforever\n    play sound [bensound-adventure v] until done\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [27]> then\n        switch backdrop to (backdrop3 v)\n    else\n        switch backdrop to (backdrop1 v)\n    end\nend\n\n@Player\n\nwhen flag clicked\nbroadcast (Green flag v) and wait\nset [level v] to [1]\nset [coins v] to [0]\nset [unlocked skins v] to [1]\nset [skin v] to [1]\nNext level\nforever\n    switch costume to (hitbox \(ground\) v)\n    if <(Shop open?) = [0]> then\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n            point in direction (90)\n            change [xv v] by (((3) * (Gravity)) * (Speed boost))\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n            point in direction (-90)\n            change [xv v] by (((-3) * (Gravity)) * (Speed boost))\n        end\n    end\n    set [xv v] to ((xv) * (0.6))\n    change x by (xv)\n    if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>> or <touching (moving platforms v)?>>> then\n        change y by ((1) * (Gravity))\n        if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>> or <touching (moving platforms v)?>>> then\n            change y by ((1) * (Gravity))\n            if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>> or <touching (moving platforms v)?>>> then\n                change y by ((1) * (Gravity))\n                if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>> or <touching (moving platforms v)?>>> then\n                    change y by ((1) * (Gravity))\n                    if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>> or <touching (moving platforms v)?>>> then\n                        change x by (() - (xv))\n                        change y by ((-4) * (Gravity))\n                    end\n                    set [xv v] to [0]\n                end\n            end\n        end\n    end\n    change [yv v] by ((-1) * (Gravity))\n    change y by (yv)\n    if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>> or <touching (moving platforms v)?>>> then\n        change y by (() - (yv))\n        set [yv v] to [0]\n    end\n    if <(Shop open?) = [0]> then\n        if <touching (water v)?> then\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                change [yv v] by (2)\n            end\n            if <(yv) > ((4) * (Speed boost))> then\n                set [yv v] to ((4) * (Speed boost))\n            else\n                if <(yv) < ((-2) * (Speed boost))> then\n                    set [yv v] to ((-2) * (Speed boost))\n                end\n            end\n        else\n            if <touching (stairs v)?> then\n                if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                    change [yv v] by (2)\n                end\n                if <(yv) > ((6) * (Speed boost))> then\n                    set [yv v] to ((6) * (Speed boost))\n                end\n            else\n                change y by ((-1) * (Gravity))\n                if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>> or <touching (moving platforms v)?>>> then\n                    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                        set [yv v] to (((12) * (Gravity)) * (Jump boost))\n                    end\n                end\n                change y by ((1) * (Gravity))\n            end\n        end\n    end\n    if <<touching (objects v)?> and <[touching \(objects\) v] contains [2]?>> then\n        change [wall timer v] by (1)\n    else\n        set [wall timer v] to [0]\n    end\n    if <(Wall timer) = [1]> then\n        Push out\n    end\n    if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<<[touching \(objects\) v] contains [2]?> and <touching (objects v)?>> and <(Wall timer) > [1]>>> then\n        Death\n    end\n    switch costume to (hitbox \(danger\) v)\n    if <<<touching (danger v)?> or <touching (spikes v)?>> or <<touching (enemy v)?> or <touching (lasers v)?>>> then\n        Death\n    end\n    switch costume to (hitbox \(ground\) v)\n    if <touching (bounce v)?> then\n        if <(yv) = [0]> then\n            change [yv v] by (10)\n        else\n            set [yv v] to ([abs v] of (((yv) * (-1)) + (3)) )\n        end\n    end\n    if <touching (trampoline v)?> then\n        set [yv v] to (Trampoline force)\n    end\n    if <<touching (portal v)?> and <not <<touching (objects v)?> and <[touching \(objects\) v] contains [2]?>>>> then\n        if <(Coins collected) = (Coins max)> then\n            change [coins v] by (Level)\n        end\n        change [level v] by (1)\n        Next level\n    end\n    if <touching (teleports v)?> then\n        if <(Teleports timer) = [0]> then\n            if <(Btrtb) = [btr]> then\n                if <(item (1) of [touching \(teleports\) v]) = [1]> then\n                    go to x: (item (3) of [teleports x/y v]) y: (item (4) of [teleports x/y v])\n                end\n            else\n                if <(Btrtb) = [rtb]> then\n                    if <(item (2) of [touching \(teleports\) v]) = [1]> then\n                        go to x: (item (1) of [teleports x/y v]) y: (item (2) of [teleports x/y v])\n                    end\n                else\n                    if <(item (1) of [touching \(teleports\) v]) = [1]> then\n                        go to x: (item (3) of [teleports x/y v]) y: (item (4) of [teleports x/y v])\n                    else\n                        if <(item (2) of [touching \(teleports\) v]) = [1]> then\n                            go to x: (item (1) of [teleports x/y v]) y: (item (2) of [teleports x/y v])\n                        end\n                    end\n                end\n            end\n        end\n        if <not <(Touching \(Teleports\)) = [00]>> then\n            change [teleports timer v] by (1)\n        end\n    else\n        set [teleports timer v] to [0]\n    end\n    if <touching (speed boost v)?> then\n        Touching [TSB]\n    end\n    change y by (-1)\n    if <touching (moving platforms v)?> then\n        Touching [TMP]\n    end\n    change y by (1)\n    if <touching (gravity switch v)?> then\n        Touching [TGS]\n    end\n    Costume\nend\n\ndefine Respawn\nset [xv v] to [0]\nset [yv v] to [0]\nset [gravity v] to [1]\npoint in direction (90)\nset [ghost v] effect to (0)\nif <(Level) = [13]> then\n    go to x: (-180) y: (115)\nelse\n    if <(Level) = [15]> then\n        go to x: (-180) y: (80)\n    else\n        if <(Level) = [17]> then\n            go to x: (0) y: (-80)\n        else\n            if <(Level) = [22]> then\n                go to x: (-185) y: (-80)\n            else\n                go to x: (-180) y: (-80)\n            end\n        end\n    end\nend\n\ndefine Push out\nif <not <(yv) = [0]>> then\n    repeat (40)\n        if <(yv) > [0]> then\n            change y by (-1)\n        else\n            if <(yv) < [0]> then\n                change y by (1)\n            end\n        end\n        if <not <touching (objects v)?>> then\n            if <(yv) > [0]> then\n                change y by (-1)\n            else\n                if <(yv) < [0]> then\n                    change y by (1)\n                end\n            end\n            stop [this script v]\n        end\n    end\nend\n\ndefine Death\nCostume\nrepeat (10)\n    change y by (2)\n    change [ghost v] effect by (10)\nend\nRespawn\n\ndefine Touching (type)\nset [counter v] to [0]\nrepeat (300)\n    change [counter v] by (1)\n    if <(type) = [TMP]> then\n        if <(item (Counter) of [touching \(moving platforms\) v]) = [1]> then\n            change x by (item (Counter) of [platforms speed x v])\n            change y by (item (Counter) of [platforms speed y v])\n        end\n    else\n        if <(type) = [TSB]> then\n            if <(item (Counter) of [touching \(speedboost\) v]) = [1]> then\n                set [xv v] to (item (Counter) of [speedboost x v])\n                set [yv v] to (item (Counter) of [speedboost y v])\n            end\n        else\n            if <(type) = [TGS]> then\n                if <(item (Counter) of [touching \(gravity switch\) v]) = [1]> then\n                    set [gravity v] to (item (Counter) of [gravity switch v])\n                end\n            end\n        end\n    end\nend\n\ndefine Next level\nCostume\nRespawn\nbroadcast (Next level v) and wait\nbroadcast (Clones v) and wait\nset [speed boost v] to [1]\nset [jump boost v] to [1]\n\nwhen I receive [skip level v]\nchange [level v] by (1)\nNext level\n\nwhen I receive [respawn v]\nRespawn\n\ndefine Costume\nswitch costume to (join (join [Skin ] (Skin)) (join [G] (Gravity)))\n\n@Ground\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\n@Danger\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\n@Coins\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [clones v]\nset [coins max v] to [0]\nset [coins collected v] to [0]\nif <(Level) = [1]> then\n    Clone x: [-62] y: [-74]\n    Clone x: [-24] y: [-74]\n    Clone x: [14] y: [-74]\n    Clone x: [52] y: [-74]\n    Clone x: [90] y: [-74]\n    Clone x: [128] y: [-74]\nelse\n    if <(Level) = [2]> then\n        Clone x: [52] y: [-74]\n        Clone x: [90] y: [-74]\n        Clone x: [128] y: [-74]\n    else\n        if <(Level) = [3]> then\n            Clone x: [-65] y: [-74]\n            Clone x: [32] y: [40]\n            Clone x: [-6] y: [2]\n            Clone x: [-6] y: [-36]\n            Clone x: [128] y: [-74]\n        else\n            if <(Level) = [4]> then\n                Clone x: [52] y: [-74]\n                Clone x: [90] y: [-74]\n                Clone x: [128] y: [-74]\n            else\n                if <(Level) = [5]> then\n                    Clone x: [-22] y: [26]\n                    Clone x: [16] y: [26]\n                else\n                    if <(Level) = [6]> then\n                        Clone x: [-104] y: [100]\n                        Clone x: [-64] y: [112]\n                        Clone x: [8] y: [-74]\n                        Clone x: [106] y: [-74]\n                    else\n                        if <(Level) = [7]> then\n                            Clone x: [44] y: [-78]\n                            Clone x: [82] y: [-78]\n                            Clone x: [120] y: [-78]\n                            Clone x: [114] y: [10]\n                            Clone x: [76] y: [10]\n                            Clone x: [38] y: [10]\n                            Clone x: [-88] y: [10]\n                            Clone x: [-126] y: [10]\n                            Clone x: [-70] y: [108]\n                            Clone x: [-32] y: [108]\n                            Clone x: [6] y: [108]\n                            Clone x: [44] y: [108]\n                            Clone x: [82] y: [108]\n                        else\n                            if <(Level) = [8]> then\n                                Clone x: [-25] y: [-74]\n                                Clone x: [25] y: [-74]\n                            else\n                                if <(Level) = [9]> then\n                                    Clone x: [-30] y: [62]\n                                    Clone x: [12] y: [-54]\n                                    Clone x: [12] y: [-16]\n                                    Clone x: [52] y: [62]\n                                else\n                                    if <(Level) = [10]> then\n                                        Clone x: [-28] y: [30]\n                                        Clone x: [56] y: [0]\n                                        Clone x: [160] y: [0]\n                                    else\n                                        if <(Level) = [11]> then\n                                            Clone x: [15] y: [120]\n                                            Clone x: [15] y: [-74]\n                                            Clone x: [53] y: [-74]\n                                            Clone x: [91] y: [-74]\n                                            Clone x: [91] y: [120]\n                                        else\n                                            if <(Level) = [12]> then\n                                                Clone x: [-4] y: [56]\n                                                Clone x: [-42] y: [56]\n                                            else\n                                                if <(Level) = [13]> then\n                                                    Clone x: [98] y: [-10]\n                                                    Clone x: [138] y: [-38]\n                                                else\n                                                    if <(Level) = [14]> then\n                                                        Clone x: [-90] y: [60]\n                                                        Clone x: [-50] y: [4]\n                                                        Clone x: [-90] y: [-48]\n                                                        Clone x: [50] y: [-6]\n                                                        Clone x: [90] y: [50]\n                                                        Clone x: [50] y: [106]\n                                                    else\n                                                        if <(Level) = [15]> then\n                                                            Clone x: [-100] y: [74]\n                                                            Clone x: [0] y: [74]\n                                                            Clone x: [100] y: [74]\n                                                            Clone x: [-100] y: [-78]\n                                                            Clone x: [0] y: [-78]\n                                                            Clone x: [100] y: [-78]\n                                                        else\n                                                            if <(Level) = [16]> then\n                                                                Clone x: [-96] y: [-20]\n                                                                Clone x: [-58] y: [16]\n                                                                Clone x: [58] y: [16]\n                                                                Clone x: [96] y: [-20]\n                                                            else\n                                                                if <(Level) = [17]> then\n                                                                    Clone x: [46] y: [-64]\n                                                                    Clone x: [-46] y: [16]\n                                                                else\n                                                                    if <(Level) = [18]> then\n                                                                        Clone x: [0] y: [-74]\n                                                                        Clone x: [100] y: [-74]\n                                                                    else\n                                                                        if <(Level) = [19]> then\n                                                                            Clone x: [-68] y: [-16]\n                                                                            Clone x: [-30] y: [-6]\n                                                                        else\n                                                                            if <(Level) = [20]> then\n                                                                                Clone x: [-100] y: [44]\n                                                                                Clone x: [-20] y: [124]\n                                                                                Clone x: [14] y: [124]\n                                                                                Clone x: [48] y: [124]\n                                                                                Clone x: [154] y: [118]\n                                                                                Clone x: [154] y: [58]\n                                                                                Clone x: [154] y: [-2]\n                                                                            else\n                                                                                if <(Level) = [21]> then\n                                                                                    Clone x: [0] y: [-26]\n                                                                                    Clone x: [0] y: [24]\n                                                                                    Clone x: [0] y: [74]\n                                                                                else\n                                                                                    if <(Level) = [22]> then\n                                                                                        Clone x: [-185] y: [110]\n                                                                                        Clone x: [-10] y: [124]\n                                                                                        Clone x: [86] y: [124]\n                                                                                    else\n                                                                                        if <(Level) = [23]> then\n                                                                                            Clone x: [160] y: [90]\n                                                                                            Clone x: [122] y: [90]\n                                                                                            Clone x: [50] y: [-74]\n                                                                                            Clone x: [88] y: [-74]\n                                                                                        else\n                                                                                            if <(Level) = [24]> then\n                                                                                                Clone x: [-6] y: [124]\n                                                                                                Clone x: [74] y: [-74]\n                                                                                                Clone x: [112] y: [-74]\n                                                                                            else\n                                                                                                if <(Level) = [25]> then\n                                                                                                    Clone x: [-84] y: [-74]\n                                                                                                    Clone x: [0] y: [74]\n                                                                                                    Clone x: [92] y: [-78]\n                                                                                                    Clone x: [130] y: [-78]\n                                                                                                    Clone x: [168] y: [-78]\n                                                                                                else\n                                                                                                    if <(Level) = [26]> then\n                                                                                                        Clone x: [-100] y: [124]\n                                                                                                        Clone x: [8] y: [124]\n                                                                                                        Clone x: [46] y: [124]\n                                                                                                    end\n                                                                                                end\n                                                                                            end\n                                                                                        end\n                                                                                    end\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Clone x: (x) y: (y)\nchange [coins max v] by (1)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [ghost v] effect to (0)\nshow\nwait until <touching (player v)?>\nchange [coins collected v] by (1)\nchange [coins v] by (1)\nrepeat (10)\n    change y by (4)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [green flag v]\nhide\n\n@Portal\n\nwhen flag clicked\nforever\n    if <(Level) = [27]> then\n        hide\n    else\n        if <(Level) = [7]> then\n            go to x: (178) y: (114)\n        else\n            if <(Level) = [12]> then\n                go to x: (28) y: (125)\n            else\n                if <(Level) = [17]> then\n                    go to x: (0) y: (120)\n                else\n                    if <(Level) = [21]> then\n                        go to x: (0) y: (120)\n                    else\n                        if <(Level) = [25]> then\n                            go to x: (178) y: (120)\n                        else\n                            go to x: (178) y: (-72)\n                        end\n                    end\n                end\n            end\n        end\n        show\n    end\n    if <(Coins collected) = (Coins max)> then\n        turn right (2) degrees\n        switch costume to (costume1 v)\n    else\n        point in direction (90)\n        switch costume to (costume2 v)\n    end\nend\n\n@Bounce\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nshow\nset [clone v] to [1]\nforever\n    if <touching (player v)?> then\n        switch costume to (costume1 v)\n        repeat (4)\n            wait (0) seconds\n            next costume\n        end\n        switch costume to (costume1 v)\n        wait until <not <touching (player v)?>>\n    end\nend\n\nwhen I receive [clones v]\nset [game object? v] to [1]\nif <(Level) = [3]> then\n    Clone x: [-6] y: [-95]\nelse\n    if <(Level) = [5]> then\n        Clone x: [-104] y: [-95]\n    else\n        if <(Level) = [6]> then\n            Clone x: [-104] y: [-95]\n        else\n            if <(Level) = [7]> then\n                Clone x: [174] y: [-95]\n                Clone x: [-174] y: [-7]\n            else\n                if <(Level) = [12]> then\n                    Clone x: [40] y: [-40]\n                end\n            end\n        end\n    end\nend\nset [game object? v] to [0]\n\nwhen I receive [green flag v]\nhide\n\ndefine Clone x: (x) y: (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [create object v]\nif <(Object type) = [4]> then\n    if <(Game object?) = [0]> then\n        if <touching (mouse-pointer v)?> then\n            delete this clone\n        end\n    end\nelse\n    if <(Clone) = [0]> then\n        if <(Object type) = [1]> then\n            Clone x: (Object X) y: (Object Y)\n        end\n    end\nend\n\n@Objects\n\nwhen I receive [clones v]\ndelete all of [touching \(objects\) v]\ndelete all of [etouching \(objects\) v]\nset [object# v] to [0]\nset [game object? v] to [1]\nif <(Level) = [4]> then\n    Clone x: [15] y: [-56] dir: [0] type: [1] button connect [1] ghost [0]\n    Clone x: [15] y: [32] dir: [0] type: [1] button connect [1] ghost [0]\n    Clone x: [15] y: [120] dir: [0] type: [1] button connect [1] ghost [0]\nelse\n    if <(Level) = [5]> then\n        Clone x: [-2] y: [-3] dir: [90] type: [1] button connect [1] ghost [1]\n    else\n        if <(Level) = [8]> then\n            Clone x: [-50] y: [-56] dir: [0] type: [1] button connect [1] ghost [0]\n            Clone x: [-50] y: [32] dir: [0] type: [1] button connect [1] ghost [0]\n            Clone x: [-50] y: [120] dir: [0] type: [1] button connect [1] ghost [0]\n            Clone x: [0] y: [-56] dir: [0] type: [1] button connect [2] ghost [0]\n            Clone x: [0] y: [32] dir: [0] type: [1] button connect [2] ghost [0]\n            Clone x: [0] y: [120] dir: [0] type: [1] button connect [2] ghost [0]\n            Clone x: [50] y: [-56] dir: [0] type: [1] button connect [3] ghost [0]\n            Clone x: [50] y: [32] dir: [0] type: [1] button connect [3] ghost [0]\n            Clone x: [50] y: [120] dir: [0] type: [1] button connect [3] ghost [0]\n        else\n            if <(Level) = [9]> then\n                Clone x: [158] y: [-50] dir: [45] type: [2] button connect [1] ghost [0]\n            else\n                if <(Level) = [10]> then\n                    Clone x: [70] y: [-30] dir: [90] type: [1] button connect [1] ghost [1]\n                    Clone x: [155] y: [-30] dir: [90] type: [3] button connect [1] ghost [1]\n                else\n                    if <(Level) = [18]> then\n                        Clone x: [-55] y: [-83] dir: [90] type: [4] button connect [1] ghost [0]\n                        Clone x: [-55] y: [-49] dir: [90] type: [4] button connect [1] ghost [0]\n                        Clone x: [-55] y: [-15] dir: [90] type: [4] button connect [1] ghost [0]\n                        Clone x: [-55] y: [19] dir: [90] type: [4] button connect [1] ghost [0]\n                        Clone x: [-55] y: [53] dir: [90] type: [4] button connect [1] ghost [0]\n                        Clone x: [55] y: [-83] dir: [90] type: [4] button connect [2] ghost [0]\n                        Clone x: [55] y: [-49] dir: [90] type: [4] button connect [2] ghost [0]\n                        Clone x: [55] y: [-15] dir: [90] type: [4] button connect [2] ghost [0]\n                        Clone x: [55] y: [19] dir: [90] type: [4] button connect [2] ghost [0]\n                        Clone x: [55] y: [53] dir: [90] type: [4] button connect [2] ghost [0]\n                        Clone x: [55] y: [87] dir: [90] type: [4] button connect [2] ghost [0]\n                        Clone x: [55] y: [121] dir: [90] type: [4] button connect [2] ghost [0]\n                        Clone x: [55] y: [155] dir: [90] type: [4] button connect [2] ghost [0]\n                    else\n                        if <(Level) = [19]> then\n                            Clone x: [142] y: [-56] dir: [0] type: [1] button connect [1] ghost [0]\n                            Clone x: [142] y: [32] dir: [0] type: [1] button connect [1] ghost [0]\n                            Clone x: [142] y: [120] dir: [0] type: [1] button connect [1] ghost [0]\n                        else\n                            if <(Level) = [20]> then\n                                Clone x: [-20] y: [87] dir: [90] type: [4] button connect [1] ghost [1]\n                                Clone x: [14] y: [87] dir: [90] type: [4] button connect [1] ghost [1]\n                                Clone x: [48] y: [87] dir: [90] type: [4] button connect [1] ghost [1]\n                                Clone x: [154] y: [90] dir: [90] type: [2] button connect [2] ghost [0]\n                                Clone x: [154] y: [30] dir: [90] type: [2] button connect [2] ghost [1]\n                                Clone x: [154] y: [-30] dir: [90] type: [2] button connect [2] ghost [0]\n                            else\n                                if <(Level) = [22]> then\n                                    Clone x: [-52] y: [122] dir: [0] type: [1] button connect [1] ghost [0]\n                                    Clone x: [132] y: [122] dir: [0] type: [1] button connect [1] ghost [0]\n                                else\n                                    if <(Level) = [23]> then\n                                        Clone x: [144] y: [-34] dir: [0] type: [2] button connect [1] ghost [0]\n                                    else\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nset [game object? v] to [0]\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I start as a clone\nshow\nset [clone v] to [1]\nif <(Ghost) = [0]> then\n    forever\n        if <(item (Button connect) of [buttons v]) = [1]> then\n            set [effect v] to [1]\n        else\n            set [effect v] to [0]\n        end\n        if <(Effect) = [0]> then\n            set [ghost v] effect to (0)\n        else\n            set [ghost v] effect to (50)\n        end\n    end\nelse\n    forever\n        if <(item (Button connect) of [buttons v]) = [1]> then\n            set [effect v] to [0]\n        else\n            set [effect v] to [1]\n        end\n        if <(Effect) = [0]> then\n            set [ghost v] effect to (0)\n        else\n            set [ghost v] effect to (50)\n        end\n    end\nend\n\ndefine Clone x: (x) y: (y) dir: (dir) type: (type) button connect (button#) ghost (ghost)\nadd [0] to [touching \(objects\) v]\nadd [0] to [etouching \(objects\) v]\nchange [object# v] by (1)\nset [button connect v] to (button#)\nset [ghost v] to (ghost)\ngo to x: (x) y: (y)\npoint in direction (dir)\nswitch costume to (type)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    set size to (200) %\n    if <<touching (player v)?> and <(Effect) = [0]>> then\n        replace item (Object#) of [touching \(objects\) v] with [1]\n    else\n        replace item (Object#) of [touching \(objects\) v] with [0]\n    end\n    if <<touching (enemy v)?> and <(Effect) = [0]>> then\n        replace item (Object#) of [etouching \(objects\) v] with [1]\n    else\n        replace item (Object#) of [etouching \(objects\) v] with [0]\n    end\n    set size to (100) %\n    if <<touching (player v)?> and <(Effect) = [0]>> then\n        replace item (Object#) of [touching \(objects\) v] with [2]\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [create object v]\nif <(Object type) = [4]> then\n    if <(Game object?) = [0]> then\n        if <touching (mouse-pointer v)?> then\n            delete this clone\n        end\n    end\nelse\n    if <(Clone) = [0]> then\n        if <(Object type) = [2]> then\n            Clone x: (Object X) y: (Object Y) dir: (Object direction) type: [1] button connect [0] ghost [0]\n        else\n            if <(Object type) = [3]> then\n                Clone x: (Object X) y: (Object Y) dir: (Object direction) type: [4] button connect [0] ghost [0]\n            end\n        end\n    end\nend\n\n@Buttons\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [clones v]\ndelete all of [buttons v]\nset [button# v] to [0]\nif <(Level) = [4]> then\n    Clone x: [-20] y: [-95] dir: [90] type: [2]\nelse\n    if <(Level) = [5]> then\n        Clone x: [-62] y: [8] dir: [90] type: [2]\n    else\n        if <(Level) = [8]> then\n            Clone x: [-50] y: [-56] dir: [90] type: [4]\n            Clone x: [0] y: [-56] dir: [90] type: [4]\n            Clone x: [50] y: [-56] dir: [90] type: [4]\n        else\n            if <(Level) = [9]> then\n                Clone x: [158] y: [-50] dir: [90] type: [4]\n            else\n                if <(Level) = [10]> then\n                    Clone x: [30] y: [-30] dir: [90] type: [4]\n                else\n                    if <(Level) = [18]> then\n                        Clone x: [-130] y: [88] dir: [90] type: [2]\n                        Clone x: [-100] y: [88] dir: [90] type: [2]\n                    else\n                        if <(Level) = [19]> then\n                            Clone x: [142] y: [32] dir: [90] type: [4]\n                        else\n                            if <(Level) = [20]> then\n                                Clone x: [14] y: [87] dir: [90] type: [4]\n                                Clone x: [154] y: [30] dir: [90] type: [4]\n                            else\n                                if <(Level) = [22]> then\n                                    Clone x: [-185] y: [143] dir: [-90] type: [2]\n                                else\n                                    if <(Level) = [23]> then\n                                        Clone x: [203] y: [78] dir: [0] type: [2]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(Type) = [3]> then\n    switch costume to (costume8 v)\nelse\n    if <(Type) = [4]> then\n        switch costume to (costume10 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\nshow\nforever\n    if <(Type) = [1]> then\n        if <touching (player v)?> then\n            switch costume to (costume1 v)\n            repeat (3)\n                wait (0.05) seconds\n                next costume\n            end\n            switch costume to (costume4 v)\n            replace item (Button#) of [buttons v] with [1]\n            wait until <not <touching (player v)?>>\n            switch costume to (costume4 v)\n            repeat (3)\n                wait (0.05) seconds\n                next costume\n            end\n            switch costume to (costume1 v)\n            replace item (Button#) of [buttons v] with [0]\n            wait until <not <touching (player v)?>>\n        end\n    else\n        if <(Type) = [2]> then\n            if <touching (player v)?> then\n                if <(item (Button#) of [buttons v]) = [0]> then\n                    switch costume to (costume1 v)\n                    repeat (3)\n                        wait (0.05) seconds\n                        next costume\n                    end\n                    switch costume to (costume4 v)\n                    replace item (Button#) of [buttons v] with [1]\n                else\n                    switch costume to (costume4 v)\n                    repeat (3)\n                        wait (0.05) seconds\n                        next costume\n                    end\n                    switch costume to (costume1 v)\n                    replace item (Button#) of [buttons v] with [0]\n                end\n                wait until <not <touching (player v)?>>\n            end\n        else\n            if <touching (mouse-pointer v)?> then\n                if <mouse down?> then\n                    if <(item (Button#) of [buttons v]) = [0]> then\n                        if <(Type) = [3]> then\n                            switch costume to (costume9 v)\n                        else\n                            switch costume to (costume11 v)\n                        end\n                        replace item (Button#) of [buttons v] with [1]\n                    else\n                        if <(Type) = [3]> then\n                            switch costume to (costume8 v)\n                        else\n                            switch costume to (costume10 v)\n                        end\n                        replace item (Button#) of [buttons v] with [0]\n                    end\n                    wait until <not <mouse down?>>\n                end\n            end\n        end\n    end\nend\n\ndefine Clone x: (x) y: (y) dir: (dir) type: (type)\nadd [0] to [buttons v]\nset [type v] to (type)\nchange [button# v] by (1)\ngo to x: (x) y: (y)\npoint in direction (dir)\ncreate clone of (_myself_ v)\n\nwhen I receive [green flag v]\nhide\n\n@Spikes\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [clones v]\nif <(Level) = [7]> then\n    Clone x: [-38] y: [-30] costume: [3] rot speed: [-2]\nelse\n    if <(Level) = [15]> then\n        Clone x: [-100] y: [123] costume: [2] rot speed: [-0.5]\n        Clone x: [0] y: [123] costume: [2] rot speed: [-0.5]\n        Clone x: [100] y: [123] costume: [2] rot speed: [-0.5]\n        Clone x: [-100] y: [-29] costume: [2] rot speed: [-0.5]\n        Clone x: [0] y: [-29] costume: [2] rot speed: [-0.5]\n        Clone x: [100] y: [-29] costume: [2] rot speed: [-0.5]\n    else\n        if <(Level) = [19]> then\n            Clone x: [-20] y: [-100] costume: [1] rot speed: [2]\n            Clone x: [80] y: [-100] costume: [1] rot speed: [2]\n        else\n            if <(Level) = [25]> then\n                Clone x: [-80] y: [80] costume: [2] rot speed: [-1]\n            end\n        end\n    end\nend\n\ndefine Clone x: (x) y: (y) costume: (costume) rot speed: (rot speed)\nset [rotating speed v] to (rot speed)\ngo to x: (x) y: (y)\nswitch costume to (costume)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nforever\n    turn right (Rotating speed) degrees\nend\n\n@Trampoline\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nshow\nforever\n    if <touching (player v)?> then\n        switch costume to (costume1 v)\n        repeat (4)\n            wait (0) seconds\n            next costume\n        end\n        switch costume to (costume1 v)\n        wait until <not <touching (player v)?>>\n    end\nend\n\nwhen I receive [clones v]\nif <(Level) = [9]> then\n    set [trampoline force v] to [18]\n    Clone x: [-70] y: [-88]\n    Clone x: [12] y: [-88]\nelse\n    if <(Level) = [10]> then\n        set [trampoline force v] to [16]\n        Clone x: [-70] y: [-88]\n    else\n        if <(Level) = [23]> then\n            set [trampoline force v] to [20]\n            Clone x: [-106] y: [-88]\n        end\n    end\nend\n\nwhen I receive [green flag v]\nset [trampoline force v] to [15]\nhide\n\ndefine Clone x: (x) y: (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\n@Water\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    set [ghost v] effect to (60)\n    switch costume to (join [Level ] (Level))\n    if <(costume [name v]) = (join [Level ] (Level))> then\n        show\n    else\n        hide\n    end\nend\n\n@Ground 2\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    switch costume to (join [Level ] (Level))\n    if <(costume [name v]) = (join [Level ] (Level))> then\n        show\n    else\n        hide\n    end\nend\n\n@Teleports\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [clones v]\ndelete all of [touching \(teleports\) v]\ndelete all of [teleports x/y v]\nif <(Level) = [15]> then\n    Clone blue x: [178] y: [82] red x: [-178] y: [-72] [btrtb]\nelse\n    if <(Level) = [16]> then\n        Clone blue x: [0] y: [30] red x: [0] y: [-30] [btrtb]\n    else\n        if <(Level) = [18]> then\n            Clone blue x: [-100] y: [-72] red x: [-178] y: [114] [btrtb]\n        else\n            if <(Level) = [25]> then\n                Clone blue x: [4] y: [-72] red x: [-178] y: [30] [btrtb]\n            end\n        end\n    end\nend\n\ndefine Clone blue x: (bx) y: (by) red x: (rx) y: (ry) (btrtb?)\nset [btrtb v] to (btrtb?)\nadd [0] to [touching \(teleports\) v]\nadd (bx) to [teleports x/y v]\nadd (by) to [teleports x/y v]\ngo to x: (bx) y: (by)\nswitch costume to (blue v)\ncreate clone of (_myself_ v)\nadd [0] to [touching \(teleports\) v]\nadd (rx) to [teleports x/y v]\nadd (ry) to [teleports x/y v]\ngo to x: (rx) y: (ry)\nswitch costume to (red v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nforever\n    turn right (2) degrees\n    if <touching (player v)?> then\n        replace item (costume [number v]) of [touching \(teleports\) v] with [1]\n    else\n        replace item (costume [number v]) of [touching \(teleports\) v] with [0]\n    end\nend\n\n@Speed boost\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [clones v]\ndelete all of [speedboost v]\ndelete all of [touching \(speedboost\) v]\nset [clone# v] to [0]\nif <(Level) = [19]> then\n    Clone x: [-104] y: [-52] dir: [45] boost x: [130] boost y: [50]\nend\n\ndefine Clone x: (x) y: (y) dir: (dir) boost x: (boost x) boost y: (boost y)\nadd [] to [touching \(speedboost\) v]\nadd (boost x) to [speedboost x v]\nadd (boost y) to [speedboost y v]\nchange [clone# v] by (1)\ngo to x: (x) y: (y)\npoint in direction (dir)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nshow\nforever\n    if <touching (player v)?> then\n        switch costume to (costume1 v)\n        repeat (4)\n            next costume\n            wait (0.05) seconds\n        end\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        replace item (Clone#) of [touching \(speedboost\) v] with [1]\n    else\n        replace item (Clone#) of [touching \(speedboost\) v] with [0]\n    end\nend\n\n@Stairs\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    switch costume to (join [Level ] (Level))\n    if <(costume [name v]) = (join [Level ] (Level))> then\n        show\n    else\n        hide\n    end\nend\n\n@Moving platforms\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [clones v]\ndelete all of [platforms speed x v]\ndelete all of [platforms speed y v]\ndelete all of [touching \(moving platforms\) v]\nset [platform# v] to [0]\nif <(Level) = [21]> then\n    Clone x: [0] y: [-50] min x: [-120] max x: [120] min y: [-50] max y: [-50] speed x: [2] speed y: [0] costume: [1] dir: [90]\n    Clone x: [0] y: [0] min x: [-120] max x: [120] min y: [0] max y: [0] speed x: [3] speed y: [0] costume: [1] dir: [90]\n    Clone x: [0] y: [50] min x: [-120] max x: [120] min y: [0] max y: [0] speed x: [4] speed y: [0] costume: [1] dir: [90]\nelse\n    if <(Level) = [22]> then\n        Clone x: [-86] y: [-120] min x: [-86] max x: [-86] min y: [-120] max y: [88] speed x: [0] speed y: [1] costume: [4] dir: [90]\n        Clone x: [-19] y: [88] min x: [-19] max x: [98] min y: [88] max y: [88] speed x: [1] speed y: [0] costume: [4] dir: [90]\n    else\n        if <(Level) = [25]> then\n            Clone x: [48] y: [125] min x: [48] max x: [48] min y: [45] max y: [125] speed x: [0] speed y: [1] costume: [1] dir: [0]\n            Clone x: [136] y: [80] min x: [136] max x: [136] min y: [-108] max y: [80] speed x: [0] speed y: [1] costume: [2] dir: [90]\n        end\n    end\nend\n\ndefine Clone x: (x) y: (y) min x: (min x) max x: (max x) min y: (min y) max y: (max y) speed x: (speed x) speed y: (speed y) costume: (costume) dir: (dir)\nadd [0] to [platforms speed x v]\nadd [0] to [platforms speed y v]\nadd [0] to [touching \(moving platforms\) v]\nchange [platform# v] by (1)\nset [min x v] to (min x)\nset [max x v] to (max x)\nset [min y v] to (min y)\nset [max y v] to (max y)\nset [speed x v] to (speed x)\nset [speed y v] to (speed y)\ngo to x: (x) y: (y)\npoint in direction (dir)\nswitch costume to (costume)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nif <(x position) < ((Max x) + (1))> then\n    set [direction v] to [1]\nelse\n    set [direction v] to [0]\nend\nset [xym v] to [XY]\nif <(Speed x) = [0]> then\n    set [xym v] to [Y]\nend\nif <(Speed y) = [0]> then\n    set [xym v] to [X]\nend\nforever\n    if <(Direction) = [1]> then\n        if <(XYM) = [X]> then\n            if <(x position) > (Max x)> then\n                set [direction v] to [-1]\n            end\n        else\n            if <(XYM) = [Y]> then\n                if <(y position) > (Max y)> then\n                    set [direction v] to [-1]\n                end\n            else\n                if <<(x position) > (Max x)> and <(y position) > (Max y)>> then\n                    set [direction v] to [-1]\n                end\n            end\n        end\n    else\n        if <(Direction) = [-1]> then\n            if <(XYM) = [X]> then\n                if <(x position) < (Min x)> then\n                    set [direction v] to [1]\n                end\n            else\n                if <(XYM) = [Y]> then\n                    if <(y position) < (Min y)> then\n                        set [direction v] to [1]\n                    end\n                else\n                    if <<(x position) < (Min x)> and <(y position) < (Min y)>> then\n                        set [direction v] to [1]\n                    end\n                end\n            end\n        end\n    end\n    if <(Direction) = [1]> then\n        replace item (Platform#) of [platforms speed x v] with (Speed x)\n        replace item (Platform#) of [platforms speed y v] with (Speed y)\n    else\n        replace item (Platform#) of [platforms speed x v] with ((Speed x) * (-1))\n        replace item (Platform#) of [platforms speed y v] with ((Speed y) * (-1))\n    end\n    change x by (item (Platform#) of [platforms speed x v])\n    change y by (item (Platform#) of [platforms speed y v])\n    set size to (150) %\n    if <touching (player v)?> then\n        replace item (Platform#) of [touching \(moving platforms\) v] with [1]\n    else\n        replace item (Platform#) of [touching \(moving platforms\) v] with [0]\n    end\n    set size to (100) %\nend\n\n@Enemy\n\nwhen I receive [green flag v]\nhide\n\nwhen I start as a clone\nshow\nset [direction v] to [1]\nforever\n    if <(Direction) = [1]> then\n        if <(x position) > (Max x)> then\n            set [direction v] to [-1]\n        end\n    else\n        if <(x position) < (Min x)> then\n            set [direction v] to [1]\n        end\n    end\n    if <(Direction) = [1]> then\n        point in direction (90)\n        change [xv v] by (2)\n    end\n    if <(Direction) = [-1]> then\n        point in direction (-90)\n        change [xv v] by (-2)\n    end\n    set [xv v] to ((xv) * (0.6))\n    change x by (xv)\n    if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>>> then\n        change y by (1)\n        if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>>> then\n            change y by (1)\n            if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>>> then\n                change y by (1)\n                if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>>> then\n                    change y by (1)\n                    if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>>> then\n                        change x by (() - (xv))\n                        change y by (-4)\n                    end\n                    set [xv v] to [0]\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (yv)\n    if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<[touching \(objects\) v] contains [1]?> and <touching (objects v)?>>> then\n        change y by (() - (yv))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<<touching (ground v)?> or <touching (ground 2 v)?>> or <<[etouching \(objects\) v] contains [1]?> and <touching (objects v)?>>> then\n        switch costume to (hitbox  v)\n        change y by (1)\n        if <touching (ground v)?> then\n            set [yv v] to [12]\n        end\n        switch costume to (hitbox \(ground\) v)\n        change y by (-1)\n    end\n    change y by (1)\n    switch costume to (hitbox \(ground\) v)\n    if <<touching (danger v)?> or <touching (spikes v)?>> then\n        Death\n    end\n    switch costume to (hitbox \(ground\) v)\n    switch costume to (costume1 v)\nend\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [clones v]\nif <(Level) = [23]> then\n    Clone x: [115] y: [-60] min x: [-45] max x: [115]\n    Clone x: [-45] y: [115] min x: [-45] max x: [155]\nend\n\ndefine Clone x: (x) y: (y) min x: (min x) max x: (max x)\nset [min x v] to (min x)\nset [max x v] to (max x)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\ndefine Death\nswitch costume to (costume1 v)\nrepeat (10)\n    change y by (2)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@Gravity switch\n\nwhen I receive [green flag v]\nhide\n\nwhen I start as a clone\nshow\nforever\n    if <touching (player v)?> then\n        replace item (Clone#) of [touching \(gravity switch\) v] with [1]\n    else\n        replace item (Clone#) of [touching \(gravity switch\) v] with [0]\n    end\nend\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I receive [clones v]\ndelete all of [gravity switch v]\ndelete all of [touching \(gravity switch\) v]\nset [clone# v] to [0]\nif <(Level) = [24]> then\n    Clone x: [-65] y: [-92] gravity switch: [-1]\n    Clone x: [45] y: [140] gravity switch: [1]\nelse\n    if <(Level) = [26]> then\n        Clone x: [-100] y: [-92] gravity switch: [-1]\n        Clone x: [180] y: [140] gravity switch: [1]\n    end\nend\n\ndefine Clone x: (x) y: (y) gravity switch: (gravity switch)\nadd [0] to [touching \(gravity switch\) v]\nadd (gravity switch) to [gravity switch v]\nchange [clone# v] by (1)\ngo to x: (x) y: (y)\nif <(gravity switch) = [-1]> then\n    point in direction (90)\nelse\n    point in direction (-90)\nend\ncreate clone of (_myself_ v)\n\n@!\n\nwhen I receive [next level v]\nif <(Type) = [2]> then\n    delete this clone\nend\n\nwhen I receive [clones v]\nset [touching v] to [0]\nif <(Type) = [2]> then\n    set [clone# v] to [0]\n    if <(Level) = [1]> then\n        Clone x: [-110] y: [-78] dir: [90]\n    else\n        if <(Level) = [2]> then\n            Clone x: [-110] y: [-78] dir: [90]\n        else\n            if <(Level) = [3]> then\n                Clone x: [-110] y: [-78] dir: [90]\n            else\n                if <(Level) = [4]> then\n                    Clone x: [-110] y: [-78] dir: [90]\n                else\n                    if <(Level) = [7]> then\n                        Clone x: [-110] y: [-78] dir: [90]\n                    else\n                        if <(Level) = [8]> then\n                            Clone x: [-110] y: [-78] dir: [90]\n                        else\n                            if <(Level) = [9]> then\n                                Clone x: [-110] y: [-78] dir: [90]\n                            else\n                                if <(Level) = [10]> then\n                                    Clone x: [-110] y: [-78] dir: [90]\n                                else\n                                    if <(Level) = [11]> then\n                                        Clone x: [-110] y: [-78] dir: [90]\n                                    else\n                                        if <(Level) = [12]> then\n                                            Clone x: [-110] y: [-78] dir: [90]\n                                        else\n                                            if <(Level) = [15]> then\n                                                Clone x: [120] y: [74] dir: [90]\n                                            else\n                                                if <(Level) = [19]> then\n                                                    Clone x: [-150] y: [-78] dir: [90]\n                                                else\n                                                    if <(Level) = [20]> then\n                                                        Clone x: [-150] y: [-78] dir: [90]\n                                                    else\n                                                        if <(Level) = [21]> then\n                                                            Clone x: [-110] y: [-78] dir: [90]\n                                                        else\n                                                            if <(Level) = [23]> then\n                                                                Clone x: [-150] y: [-78] dir: [90]\n                                                            else\n                                                                if <(Level) = [24]> then\n                                                                    Clone x: [-110] y: [-78] dir: [90]\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Clone x: (x) y: (y) dir: (dir)\nchange [clone# v] by (1)\ngo to x: (x) y: (y)\npoint in direction (dir)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(Type) = [1]> then\n    go to x: (-134) y: (114)\n    set [ghost v] effect to (100)\n    wait until <not <(Touching) = [0]>>\n    show\n    forever\n        if <(Touching) = [0]> then\n            change [ghost v] effect by (5)\n        else\n            switch costume to (join [Level ] (join (join (Level) [.]) (Touching)))\n            change [ghost v] effect by (-5)\n        end\n    end\nelse\n    switch costume to (! v)\n    go to [back v] layer\n    show\n    forever\n        if <touching (player v)?> then\n            set [touching v] to (Clone#)\n            wait until <not <touching (player v)?>>\n            set [touching v] to [0]\n        end\n    end\nend\n\nwhen I receive [green flag v]\nhide\nset [touching v] to [0]\nset [type v] to [1]\ncreate clone of (_myself_ v)\nset [type v] to [2]\n\n@Backpack\n\nwhen flag clicked\nClones\n\nwhen I start as a clone\nif <(Type) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (black v)\n    set [ghost v] effect to (80)\n    show\nelse\n    if <(Type) = [2]> then\n        if <(Type 2) = [0]> then\n            go [backward v] (1) layers\n            set [ghost v] effect to (30)\n            forever\n                if <(Selected object) = [0]> then\n                    hide\n                else\n                    show\n                    switch costume to (join [O] (Selected object))\n                    go to x: (mouse x) y: (mouse y)\n                    if <(y position) < [-140]> then\n                        set y to (-140)\n                    end\n                    if <(y position) > [156]> then\n                        set y to (156)\n                    end\n                    if <<(Selected object) = [1]> or <(Selected object) = [4]>> then\n                        point in direction (90)\n                    else\n                        point in direction (Object direction)\n                    end\n                    if <mouse down?> then\n                        if <<(mouse y) > [-140]> and <(mouse y) < [156]>> then\n                            set [object x v] to (x position)\n                            set [object y v] to (y position)\n                            set [object type v] to (Selected object)\n                            broadcast (Create object v)\n                            if <not <(Selected object) = [4]>> then\n                                replace item (Selected object) of [objects v] with ((item (Selected object) of [objects v]) - (1))\n                            end\n                            set [selected object v] to [0]\n                        end\n                    end\n                end\n            end\n        else\n            if <(Type 2) < [5]> then\n                if <(Clone#) = [0]> then\n                    if <(Type 2) = [1]> then\n                        switch costume to (bounce v)\n                    else\n                        if <(Type 2) = [2]> then\n                            switch costume to (stick v)\n                        else\n                            if <(Type 2) = [3]> then\n                                switch costume to (box v)\n                            else\n                                switch costume to (object destroyer v)\n                            end\n                        end\n                    end\n                    go to x: ((((Type 2) - (1)) * (46)) - (212)) y: (-160)\n                    show\n                    forever\n                        if <touching (mouse-pointer v)?> then\n                            if <mouse down?> then\n                                if <(Type 2) = [4]> then\n                                    set [object direction v] to [90]\n                                    set [selected object v] to (Type 2)\n                                else\n                                    if <(item (Type 2) of [objects v]) > [0]> then\n                                        set [object direction v] to [90]\n                                        set [selected object v] to (Type 2)\n                                    end\n                                end\n                            end\n                        end\n                        if <key ((Type 2) v) pressed?> then\n                            if <(Type 2) = [4]> then\n                                set [object direction v] to [90]\n                                set [selected object v] to (Type 2)\n                            else\n                                if <(item (Type 2) of [objects v]) > [0]> then\n                                    set [object direction v] to [90]\n                                    set [selected object v] to (Type 2)\n                                end\n                            end\n                        end\n                    end\n                else\n                    forever\n                        if <(length of (item (Type 2) of [objects v])) < (Clone#)> then\n                            hide\n                        else\n                            show\n                            switch costume to (join (letter (Clone#) of (item (Type 2) of [objects v])) [-2])\n                            go to x: (((((Type 2) - (1)) * (46)) - (228)) + (((Clone#) - (1)) * (5))) y: (-168)\n                        end\n                    end\n                end\n            else\n                if <(Type 2) = [5]> then\n                    switch costume to (rotate - v)\n                else\n                    if <(Type 2) = [6]> then\n                        switch costume to (rotate + v)\n                    else\n                        switch costume to (cancel v)\n                    end\n                end\n                go to x: ((((Type 2) - (1)) * (46)) - (212)) y: (-160)\n                show\n                forever\n                    if <(Selected object) = [0]> then\n                        hide\n                    else\n                        show\n                        if <touching (mouse-pointer v)?> then\n                            if <mouse down?> then\n                                if <(Type 2) = [4]> then\n                                    change [object direction v] by (-15)\n                                else\n                                    if <(Type 2) = [5]> then\n                                        change [object direction v] by (15)\n                                    else\n                                        set [selected object v] to [0]\n                                    end\n                                end\n                            end\n                        end\n                        wait until <not <mouse down?>>\n                        if <(Type 2) = [5]> then\n                            if <key (z v) pressed?> then\n                                change [object direction v] by (-15)\n                                wait until <not <key (z v) pressed?>>\n                            end\n                        else\n                            if <(Type 2) = [6]> then\n                                if <key (x v) pressed?> then\n                                    change [object direction v] by (15)\n                                    wait until <not <key (x v) pressed?>>\n                                end\n                            else\n                                if <key (c v) pressed?> then\n                                    set [selected object v] to [0]\n                                    wait until <not <key (c v) pressed?>>\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    else\n        if <(Type) = [3]> then\n            show\n            if <(Type 2) = [1]> then\n                go to x: (194) y: (-160)\n                forever\n                    if <touching (mouse-pointer v)?> then\n                        switch costume to (speed boost2 v)\n                        if <mouse down?> then\n                            if <(Speed boost) = [1]> then\n                                if <(Coins) > [39]> then\n                                    set [speed boost v] to [1.25]\n                                    change [coins v] by (-40)\n                                end\n                            end\n                        end\n                    else\n                        switch costume to (speed boost v)\n                    end\n                    wait until <not <mouse down?>>\n                end\n            else\n                go to x: (222) y: (-160)\n                forever\n                    if <touching (mouse-pointer v)?> then\n                        switch costume to (jump boost2 v)\n                        if <mouse down?> then\n                            if <(Jump boost) = [1]> then\n                                if <(Coins) > [39]> then\n                                    set [jump boost v] to [1.15]\n                                    change [coins v] by (-40)\n                                end\n                            end\n                        end\n                    else\n                        switch costume to (jump boost v)\n                    end\n                    wait until <not <mouse down?>>\n                end\n            end\n        else\n            if <(Type) = [4]> then\n                show\n                if <(Type 2) = [1]> then\n                    go to x: (134) y: (-152)\n                    switch costume to (skip level v)\n                    forever\n                        if <touching (mouse-pointer v)?> then\n                            if <mouse down?> then\n                                if <(Level) < [27]> then\n                                    if <(Coins) > [79]> then\n                                        broadcast (Skip level v)\n                                        change [coins v] by (-80)\n                                    end\n                                end\n                            end\n                        end\n                        wait until <not <mouse down?>>\n                        if <key (n v) pressed?> then\n                            if <(Level) < [27]> then\n                                if <(Coins) > [79]> then\n                                    broadcast (Skip level v)\n                                    change [coins v] by (-80)\n                                end\n                            end\n                            wait until <not <key (n v) pressed?>>\n                        end\n                    end\n                else\n                    go to x: (134) y: (-168)\n                    switch costume to (respawn v)\n                    forever\n                        if <touching (mouse-pointer v)?> then\n                            if <mouse down?> then\n                                broadcast (Respawn v)\n                            end\n                        end\n                        wait until <not <mouse down?>>\n                        if <key (r v) pressed?> then\n                            broadcast (Respawn v)\n                            wait until <not <key (r v) pressed?>>\n                        end\n                    end\n                end\n            else\n                if <(Type) = [5]> then\n                    if <(Type 2) = [1]> then\n                        go to x: (-208) y: (166)\n                        switch costume to (level v)\n                        show\n                    else\n                        if <(Type 2) = [2]> then\n                            forever\n                                if <(length of (Level)) < (Clone#)> then\n                                    hide\n                                else\n                                    show\n                                    switch costume to (join (letter (Clone#) of (Level)) [-1])\n                                    go to x: ((((Clone#) - (1)) * (12)) - (174)) y: (166)\n                                end\n                            end\n                        end\n                    end\n                else\n                    if <(Type) = [6]> then\n                        if <(Type 2) = [1]> then\n                            set [shop open? v] to [0]\n                            show\n                            switch costume to (shop v)\n                            go to x: (0) y: (167)\n                            forever\n                                if <touching (mouse-pointer v)?> then\n                                    if <mouse down?> then\n                                        if <(Shop open?) = [0]> then\n                                            set [shop open? v] to [1]\n                                            set [selected object v] to [0]\n                                            go to x: (-206) y: (167)\n                                            switch costume to (back v)\n                                        else\n                                            set [shop open? v] to [0]\n                                            go to x: (0) y: (167)\n                                            switch costume to (shop v)\n                                        end\n                                    end\n                                end\n                                wait until <not <mouse down?>>\n                            end\n                        else\n                            if <(Type 2) = [2]> then\n                                switch costume to (shop2 v)\n                                go [backward v] (1) layers\n                                go to x: (0) y: (0)\n                                forever\n                                    if <(Shop open?) = [1]> then\n                                        show\n                                    else\n                                        hide\n                                    end\n                                end\n                            else\n                                if <(Type 2) = [3]> then\n                                    switch costume to (join [Skin ] (Clone#))\n                                    go to x: ((((Clone#) - (1)) * (60)) - (210)) y: (20)\n                                    forever\n                                        if <(Shop open?) = [1]> then\n                                            show\n                                            if <touching (mouse-pointer v)?> then\n                                                if <mouse down?> then\n                                                    if < (Unlocked skins) contains (Clone#)?> then\n                                                        set [skin v] to (Clone#)\n                                                    end\n                                                end\n                                            end\n                                            wait until <not <mouse down?>>\n                                        else\n                                            hide\n                                        end\n                                    end\n                                else\n                                    if <(Type 2) = [4]> then\n                                        switch costume to (selected skin v)\n                                        forever\n                                            go to x: ((((Skin) - (1)) * (60)) - (210)) y: (4)\n                                            if <(Shop open?) = [1]> then\n                                                show\n                                            else\n                                                hide\n                                            end\n                                        end\n                                    else\n                                        if <(Type 2) = [5]> then\n                                            if <(Clone#) < [3]> then\n                                                switch costume to (30 v)\n                                            else\n                                                if <(Clone#) = [3]> then\n                                                    switch costume to (40 v)\n                                                else\n                                                    if <(Clone#) = [4]> then\n                                                        switch costume to (50 v)\n                                                    else\n                                                        if <(Clone#) = [5]> then\n                                                            switch costume to (60 v)\n                                                        else\n                                                            if <(Clone#) = [6]> then\n                                                                switch costume to (140 v)\n                                                            else\n                                                                if <(Clone#) = [7]> then\n                                                                    switch costume to (200 v)\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                            go to x: ((((Clone#) - (1)) * (60)) - (150)) y: (4)\n                                            forever\n                                                if <(Shop open?) = [1]> then\n                                                    if <not < (Unlocked skins) contains ((Clone#) + (1))?>> then\n                                                        show\n                                                        if <touching (mouse-pointer v)?> then\n                                                            if <mouse down?> then\n                                                                if <(Coins) > ((costume [name v]) - (1))> then\n                                                                    set [unlocked skins v] to (join (Unlocked skins) ((Clone#) + (1)))\n                                                                    change [coins v] by (() - (costume [name v]))\n                                                                    set [skin v] to ((Clone#) + (1))\n                                                                end\n                                                            end\n                                                        end\n                                                        wait until <not <mouse down?>>\n                                                    else\n                                                        hide\n                                                    end\n                                                else\n                                                    hide\n                                                end\n                                            end\n                                        else\n                                            if <(Type 2) = [6]> then\n                                                switch costume to (join [Object ] (Clone#))\n                                                go to x: ((((Clone#) - (1)) * (72)) - (204)) y: (-72)\n                                                forever\n                                                    if <(Shop open?) = [1]> then\n                                                        show\n                                                    else\n                                                        hide\n                                                    end\n                                                end\n                                            else\n                                                if <(Type 2) = [7]> then\n                                                    if <(Clone#) = [1]> then\n                                                        switch costume to (60 v)\n                                                    else\n                                                        switch costume to (50 v)\n                                                    end\n                                                    go to x: ((((Clone#) - (1)) * (72)) - (204)) y: (-82)\n                                                    forever\n                                                        if <(Shop open?) = [1]> then\n                                                            show\n                                                            if <touching (mouse-pointer v)?> then\n                                                                if <mouse down?> then\n                                                                    if <(Coins) > ((costume [name v]) - (1))> then\n                                                                        replace item (Clone#) of [objects v] with ((item (Clone#) of [objects v]) + (1))\n                                                                        change [coins v] by (() - (costume [name v]))\n                                                                    end\n                                                                end\n                                                            end\n                                                            wait until <not <mouse down?>>\n                                                        else\n                                                            hide\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    else\n                        if <(Type) = [7]> then\n                            if <(Type 2) = [1]> then\n                                go to x: (224) y: (167)\n                                switch costume to (coin v)\n                                show\n                            else\n                                if <(Type 2) = [2]> then\n                                    forever\n                                        if <(length of (Coins)) < (Clone#)> then\n                                            hide\n                                        else\n                                            show\n                                            switch costume to (join (letter (Clone#) of (Coins)) [-1])\n                                            go to x: (((((Clone#) - (1)) * (12)) + (204)) - (((length of (Coins)) * (12)) - (12))) y: (166)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Clones\nhide\nset [type v] to [0]\nset [selected object v] to [0]\ndelete all of [objects v]\nrepeat (3)\n    add [0] to [objects v]\nend\nrepeat (7)\n    set [type 2 v] to [0]\n    change [type v] by (1)\n    if <(Type) = [2]> then\n        create clone of (_myself_ v)\n        repeat (3)\n            set [clone# v] to [0]\n            change [type 2 v] by (1)\n            repeat (4)\n                create clone of (_myself_ v)\n                change [clone# v] by (1)\n            end\n        end\n        set [clone# v] to [0]\n        change [type 2 v] by (1)\n        create clone of (_myself_ v)\n        repeat (3)\n            change [type 2 v] by (1)\n            create clone of (_myself_ v)\n        end\n    else\n        if <<(Type) = [3]> or <(Type) = [4]>> then\n            repeat (2)\n                change [type 2 v] by (1)\n                create clone of (_myself_ v)\n            end\n        else\n            if <<(Type) = [5]> or <(Type) = [7]>> then\n                repeat (2)\n                    set [clone# v] to [0]\n                    change [type 2 v] by (1)\n                    if <(Type 2) = [1]> then\n                        create clone of (_myself_ v)\n                    else\n                        repeat (5)\n                            change [clone# v] by (1)\n                            create clone of (_myself_ v)\n                        end\n                    end\n                end\n            else\n                if <(Type) = [6]> then\n                    repeat (7)\n                        set [clone# v] to [0]\n                        change [type 2 v] by (1)\n                        if <(Type 2) = [3]> then\n                            repeat (8)\n                                change [clone# v] by (1)\n                                create clone of (_myself_ v)\n                            end\n                        else\n                            if <(Type 2) = [5]> then\n                                repeat (7)\n                                    change [clone# v] by (1)\n                                    create clone of (_myself_ v)\n                                end\n                            else\n                                if <<(Type 2) = [6]> or <(Type 2) = [7]>> then\n                                    repeat (3)\n                                        change [clone# v] by (1)\n                                        create clone of (_myself_ v)\n                                    end\n                                else\n                                    create clone of (_myself_ v)\n                                end\n                            end\n                        end\n                    end\n                else\n                    create clone of (_myself_ v)\n                end\n            end\n        end\n    end\nend\n\n@LFF\n\nwhen flag clicked\nshow\nforever\n    go to x: (-274) y: (138)\n    set [ghost v] effect to (100)\n    wait (pick random (20) to (80)) seconds\n    repeat until <(round (x position)) = [-190]>\n        change x by (((-190) - (x position)) / (8))\n        change [ghost v] effect by (-1.8)\n    end\n    set [ghost v] effect to (25)\n    wait (3) seconds\n    repeat until <(round (x position)) = [-274]>\n        change x by (((-274) - (x position)) / (8))\n        change [ghost v] effect by (3)\n    end\n    set [ghost v] effect to (100)\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\n\n
日本語説明は下です↓(モバイル対応！読んだ方が得です)\n\nThis game is a scroll platformer.\nIt can be operated with the arrow keys, WASD key, and tap. Please enjoy the game.\n\nこのゲームはスクロールプラットフォーマーです。\n矢印キー､WASDキー､タップで操作できます。\nクリアを目指して頑張って下さい。\n難易度★★★☆☆