Kingdom Hassle - A Scrolling Platformer 


@Stage\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\nshow variable [mouse v]\nwait (4) seconds\nhide variable [mouse v]\n\nwhen I receive [title v]\nset volume to (100) %\nforever\n    play sound [Cheer up PSG 8-bit Loop_v2 v] until done\nend\n\n@player\n\nwhen flag clicked\nbroadcast (TITLE v)\n\nwhen I receive [green flag v]\nset size to (100) %\nhide\ngo to x: (0) y: (0)\nset rotation style [left-right v]\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    broadcast (Invincibility v)\n    Game On\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(EXIT) = [win]> then\n        Game - Win\n    else\n        Game - Die\n    end\nend\n\ndefine Game On\nset [gamemode v] to [game]\nset [x v] to [-200]\nset [y v] to [-50]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [invincibility v] to [no]\nset [health v] to [3]\nshow\nswitch costume to (costume1 v)\nset size to (260) %\npoint in direction (90)\n\ndefine Tick\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    if <not <touching (ladder v)?>> then\n        Change Player x by [-8]\n        point in direction (-90)\n    else\n        Change Player x by [-4]\n    end\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    if <not <touching (ladder v)?>> then\n        Change Player x by [8]\n        point in direction (90)\n    else\n        Change Player x by [4]\n    end\nend\nif <touching (ladder v)?> then\n    set [sy v] to [0]\n    if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n        change [sy v] by (-5)\n    end\nend\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    if <not <touching (ladder v)?>> then\n        if <(in air) < [4]> then\n            set [sy v] to [16]\n        end\n        if <(in air) < [1]> then\n            start sound [Jump v]\n        end\n    else\n        change [sy v] by (5)\n    end\nend\nif <not <touching (ladder v)?>> then\n    change [sy v] by (-3)\nend\nChange Player y by (sy)\nTest - Die\nTest - Win\nif <(y) > [-30]> then\n    set [scroll y v] to (y)\nelse\n    set [scroll y v] to [-30]\nend\nif <<(x) > [0]> and <[960] > (x)>> then\n    set [scroll x v] to (x)\nend\nPosition\nif <(y) < [-175]> then\n    set [exit v] to [die]\nend\nif <not <touching (ladder v)?>> then\n    if <(sy) = [0]> then\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n            switch costume to (animation)\n        else\n            switch costume to (3 v)\n        end\n    end\n    if <(sy) > [0]> then\n        switch costume to (jump2 v)\n    end\n    if <(sy) < [0]> then\n        switch costume to (jump3 v)\n    end\nelse\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<key (down arrow v) pressed?> or <key (s v) pressed?>>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>>> then\n        switch costume to (animation)\n    else\n        switch costume to (climb1 and 3 v)\n    end\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nif <not <<touching (ladder v)?> and <key (up arrow v) pressed?>>> then\n    repeat until <not <touching (ground v)?>>\n        if <(sy) > [0]> then\n            change [y v] by (-1)\n        else\n            change [y v] by (1)\n            set [in air v] to [0]\n        end\n        Position\n        set [sy v] to [0]\n    end\nelse\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\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 (-8)\n    repeat until <<not <touching (ground v)?>> or <(EXIT) > []>>\n        if <(x) < [-300]> then\n            set [exit v] to [die]\n        end\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game - Die\nstart sound [Pew v]\nswitch costume to (1 v)\nset [exit v] to []\nrepeat (5)\n    hide\n    wait (.1) seconds\n    show\n    wait (.1) seconds\nend\nhide\nwait (.5) seconds\n\ndefine Test - Die\nif <(HEALTH) < [1]> then\n    set [exit v] to [die]\nend\n\ndefine Game - Win\nstart sound [Connect v]\nset [exit v] to []\nrepeat until <(x position) > [230]>\n    change x by (4)\n    switch costume to (animation)\nend\nhide\nchange [level v] by (1)\nwait (1) seconds\n\ndefine Test - Win\nif <<(x) > [1100]> and <<(y) = [-110]> or <(y) = [-109]>>> then\n    set [exit v] to [win]\nend\n\ndefine Invincibility (length of invincibility)\nset [invincibility v] to [yes]\nwait (.3) seconds\nrepeat (length of invincibility)\n    set [ghost v] effect to (90)\n    wait (.1) seconds\n    set [ghost v] effect to (0)\n    wait (.2) seconds\nend\nset [invincibility v] to [no]\n\nwhen I receive [invincibility v]\nInvincibility [5]\n\nwhen I receive [play game v]\nforever\n    if <(INVINCIBILITY) = [no]> then\n        if <touching (danger v)?> then\n            broadcast (Invincibility v)\n            broadcast (-1 HEALTH v)\n            start sound [pop v]\n            change [health v] by (-1)\n            wait until <<not <touching (danger v)?>> or <(INVINCIBILITY) = [no]>>\n        end\n    end\nend\n\nwhen I receive [title v]\nforever\n    if <not <touching (ladder v)?>> then\n        set [animation v] to [2]\n        wait (.1) seconds\n        set [animation v] to [4]\n        wait (.1) seconds\n        set [animation v] to [4]\n        wait (.1) seconds\n        set [animation v] to [1]\n        wait (.1) seconds\n    else\n        set [animation v] to [climb1 and 3]\n        wait (.1) seconds\n        set [animation v] to [climb2]\n        wait (.1) seconds\n        set [animation v] to [climb1 and 3]\n        wait (.1) seconds\n        set [animation v] to [climb4]\n        wait (.1) seconds\n    end\nend\n\nwhen I receive [title v]\nset [gamemode v] to [title]\nshow\nset size to (800) %\ngo to x: (-253) y: (-45)\nset rotation style [left-right v]\npoint in direction (90)\nrepeat until <not <(GAMEMODE) = [title]>>\n    go to x: (-253) y: (-45)\n    repeat until <<(x position) > [-100]> or <not <(GAMEMODE) = [title]>>>\n        switch costume to (animation)\n        move (5) steps\n    end\n    point in direction (-90)\n    repeat until <<[-250] > (x position)> or <not <(GAMEMODE) = [title]>>>\n        switch costume to (animation)\n        move (5) steps\n    end\n    go to x: (261) y: (-45)\n    repeat until <<[100] > (x position)> or <not <(GAMEMODE) = [title]>>>\n        switch costume to (animation)\n        move (5) steps\n    end\n    point in direction (90)\n    repeat until <<(x position) > [250]> or <not <(GAMEMODE) = [title]>>>\n        switch costume to (animation)\n        move (5) steps\n    end\nend\npoint towards (sprite1 v)\n\nwhen I receive [starting... v]\nset rotation style [left-right v]\npoint towards (sprite1 v)\nglide (.5) secs to x: (0) y: (-45)\npoint in direction (90)\nset rotation style [all around v]\nrepeat (5)\n    change y by (10)\nend\nwait (.1) seconds\nrepeat (10)\n    change y by (-30)\nend\nhide\n\nwhen I receive [starting... v]\nwait (.5) seconds\nrepeat until <not <(GAMEMODE) = [game]>>\n    change x by (4)\n    turn right (2) degrees\nend\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@Ground\n\nwhen I receive [title v]\nshow\nset size to (500) %\nswitch costume to (title v)\ngo to x: (0) y: (100)\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    switch costume to (sprute-costume5 v)\n    Clone at x: [-1440] y: [-360]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [480] y: [0]\n        Clone at x: [480] y: [0]\n        Clone at x: [480] y: [0]\n        switch costume to (sprute-costume5 v)\n        Clone at x: [-1440] y: [-360]\n        Clone at x: [480] y: [0]\n        Clone at x: [480] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [480] y: [0]\n            Clone at x: [480] y: [0]\n            Clone at x: [480] y: [0]\n            switch costume to (sprute-costume5 v)\n            Clone at x: [-1440] y: [-360]\n            Clone at x: [480] y: [0]\n            Clone at x: [480] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (n/a v)\n                Clone at x: [480] y: [0]\n                Clone at x: [480] y: [0]\n                Clone at x: [480] y: [0]\n                switch costume to (sprute-costume5 v)\n                Clone at x: [-1440] y: [-360]\n                Clone at x: [480] y: [0]\n            end\n        end\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nClone at x: [480] y: [0]\n\nwhen I receive [green flag v]\nhide\nset size to (100) %\nset rotation style [don't rotate v]\npoint in direction (90)\ngo to x: (0) y: (0)\n\n@Collectables\n\ndefine Collect\nstart sound [Collect v]\nswitch costume to (costume2 v)\nchange [var v] by (1)\ndelete this clone\n\nwhen I start as a clone\nrepeat (3)\n    change [y v] by (-1)\nend\nforever\n    repeat (10)\n        change [y v] by (.5)\n    end\n    repeat (10)\n        change [y v] by (-.5)\n    end\nend\n\nwhen I receive [title v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\nif <touching (player v)?> then\n    Collect\nend\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [setup v]\nhide\nset [var v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (costume1 v)\n    Clone at x: [-50] y: [-110]\n    Clone at x: [-25] y: [-80]\n    Clone at x: [10] y: [-55]\n    Clone at x: [40] y: [-55]\n    Clone at x: [75] y: [-80]\n    Clone at x: [100] y: [-110]\n    Clone at x: [260] y: [-110]\n    Clone at x: [311] y: [-41]\n    Clone at x: [360] y: [-110]\n    Clone at x: [507] y: [-31]\n    Clone at x: [532] y: [-1]\n    Clone at x: [567] y: [24]\n    Clone at x: [592] y: [10]\n    Clone at x: [604] y: [-23]\n    Clone at x: [604] y: [-72]\n    Clone at x: [702] y: [-110]\n    Clone at x: [734] y: [-110]\n    Clone at x: [766] y: [-110]\n    Clone at x: [798] y: [-110]\n    Clone at x: [830] y: [-110]\n    Clone at x: [766] y: [-10]\n    Clone at x: [766] y: [20]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (costume1 v)\n        Clone at x: [-65] y: [-72]\n        Clone at x: [94] y: [-72]\n        Clone at x: [-30] y: [-30]\n        Clone at x: [18] y: [-14]\n        Clone at x: [66] y: [-30]\n        Clone at x: [430] y: [25]\n        Clone at x: [462] y: [25]\n        Clone at x: [670] y: [-72]\n        Clone at x: [863] y: [-110]\n        Clone at x: [1025] y: [-110]\n        Clone at x: [1057] y: [-110]\n        Clone at x: [1089] y: [-110]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (costume1 v)\n            Clone at x: [30] y: [-17]\n            Clone at x: [30] y: [-57]\n            Clone at x: [30] y: [-97]\n            Clone at x: [-64] y: [-110]\n            Clone at x: [-32] y: [-110]\n            Clone at x: [0] y: [-110]\n            Clone at x: [195] y: [-110]\n            Clone at x: [163] y: [-110]\n            Clone at x: [509] y: [-78]\n            Clone at x: [541] y: [-46]\n            Clone at x: [573] y: [-14]\n            Clone at x: [703] y: [23]\n            Clone at x: [764] y: [58]\n            Clone at x: [830] y: [-14]\n            Clone at x: [1020] y: [-110]\n            Clone at x: [1052] y: [-110]\n            Clone at x: [1084] y: [-110]\n        end\n    end\nend\nset [x v] to [-99999]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [green flag v]\nhide\nset size to (100) %\ngo to [front v] layer\nset rotation style [don't rotate v]\npoint in direction (90)\ngo to x: (0) y: (0)\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@chest\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nTest - Chest\n\nwhen I receive [setup v]\nset rotation style [left-right v]\npoint in direction (-90)\nhide\ngo [backward v] (50) layers\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (sprute-costume5 v)\n    Clone at x: [940] y: [-116]\n    Clone at x: [-150] y: [-116]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (sprute-costume5 v)\n        Clone at x: [-110] y: [-116]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (sprute-costume5 v)\n            Clone at x: [100] y: [-116]\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Test - Chest\nif <not <(costume [number v]) = [3]>> then\n    if <touching (player v)?> then\n        switch costume to (sprute-costume2 v)\n        if <key (e v) pressed?> then\n            start sound [chest v]\n            switch costume to (sunduk_open v)\n            broadcast (CHEST OPEN v)\n        end\n    else\n        switch costume to (sprute-costume5 v)\n    end\nend\n\nwhen I receive [title v]\nhide\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@danger\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (sprute-costume8 v)\n    Clone at x: [-2] y: [-148]\n    Clone at x: [28] y: [-148]\n    Clone at x: [500] y: [-116]\n    Clone at x: [532] y: [-116]\n    Clone at x: [564] y: [-116]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (sprute-costume8 v)\n        Clone at x: [-44] y: [-116]\n        Clone at x: [-12] y: [-116]\n        Clone at x: [20] y: [-116]\n        Clone at x: [52] y: [-116]\n        Clone at x: [308] y: [-116]\n        Clone at x: [340] y: [-116]\n        Clone at x: [372] y: [-116]\n        Clone at x: [404] y: [-116]\n        Clone at x: [436] y: [-116]\n        Clone at x: [468] y: [-116]\n        Clone at x: [500] y: [-116]\n        Clone at x: [532] y: [-116]\n        Clone at x: [564] y: [-116]\n        Clone at x: [628] y: [-116]\n        Clone at x: [884] y: [-116]\n        Clone at x: [916] y: [-116]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (sprute-costume8 v)\n            Clone at x: [-76] y: [-52]\n            Clone at x: [-44] y: [-52]\n            Clone at x: [-12] y: [-52]\n            Clone at x: [52] y: [-52]\n            Clone at x: [84] y: [-52]\n            Clone at x: [116] y: [-52]\n            Clone at x: [244] y: [-116]\n            Clone at x: [276] y: [-116]\n            Clone at x: [308] y: [-116]\n            Clone at x: [372] y: [-116]\n            Clone at x: [692] y: [77]\n            Clone at x: [884] y: [-52]\n            Clone at x: [916] y: [-84]\n            Clone at x: [948] y: [-116]\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [title v]\nhide\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@Ladder\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (sprute-costume2 v)\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (sprute-costume2 v)\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (sprute-costume2 v)\n            Clone at x: [-139] y: [-116]\n            Clone at x: [-139] y: [-84]\n            Clone at x: [-139] y: [-52]\n            Clone at x: [-139] y: [-20]\n            Clone at x: [-139] y: [12]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (sprute-costume2 v)\n                Clone at x: [468] y: [-116]\n                Clone at x: [468] y: [-84]\n                Clone at x: [468] y: [-52]\n                Clone at x: [468] y: [-20]\n                Clone at x: [468] y: [10]\n                Clone at x: [468] y: [42]\n                Clone at x: [468] y: [74]\n                Clone at x: [500] y: [-116]\n                Clone at x: [500] y: [-84]\n                Clone at x: [500] y: [-52]\n                Clone at x: [500] y: [-20]\n                Clone at x: [500] y: [10]\n                Clone at x: [500] y: [42]\n                Clone at x: [500] y: [74]\n                Clone at x: [532] y: [-116]\n                Clone at x: [532] y: [-84]\n                Clone at x: [532] y: [-52]\n                Clone at x: [532] y: [-20]\n                Clone at x: [532] y: [10]\n                Clone at x: [532] y: [42]\n                Clone at x: [532] y: [74]\n                Clone at x: [564] y: [-116]\n                Clone at x: [564] y: [-84]\n                Clone at x: [564] y: [-52]\n                Clone at x: [564] y: [-20]\n                Clone at x: [564] y: [10]\n                Clone at x: [564] y: [42]\n                Clone at x: [564] y: [74]\n                Clone at x: [596] y: [-116]\n                Clone at x: [596] y: [-84]\n                Clone at x: [596] y: [-52]\n                Clone at x: [596] y: [-20]\n                Clone at x: [596] y: [10]\n                Clone at x: [596] y: [42]\n                Clone at x: [596] y: [74]\n            else\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [title v]\nhide\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@Sprite1\n\nwhen I receive [play game v]\nshow\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [title v]\nhide\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@background\n\nwhen I receive [title v]\nhide\n\nwhen I receive [setup v]\nhide\ngo to [back v] layer\nset [brightness v] effect to (-10)\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (fence v)\n    Clone at x: [123] y: [-116]\n    Clone at x: [155] y: [-116]\n    Clone at x: [187] y: [-116]\n    Clone at x: [692] y: [-52]\n    Clone at x: [724] y: [-52]\n    switch costume to (tree v)\n    Clone at x: [442] y: [-20]\n    Clone at x: [788] y: [-52]\n    switch costume to (grass v)\n    Clone at x: [468] y: [-52]\n    switch costume to (box v)\n    Clone at x: [994] y: [-116]\n    Clone at x: [1026] y: [-116]\n    Clone at x: [1018] y: [-84]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (grass v)\n        Clone at x: [-76] y: [-84]\n        Clone at x: [84] y: [-84]\n        switch costume to (tree v)\n        Clone at x: [153] y: [-116]\n        switch costume to (box v)\n        Clone at x: [433] y: [13]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (box v)\n            Clone at x: [148] y: [43]\n            switch costume to (tree v)\n            Clone at x: [-105] y: [43]\n            switch costume to (fence v)\n            Clone at x: [212] y: [-84]\n            switch costume to (grass v)\n            Clone at x: [436] y: [-116]\n            Clone at x: [468] y: [-116]\n            switch costume to (tree v)\n            Clone at x: [666] y: [-20]\n            Clone at x: [730] y: [-20]\n            switch costume to (box v)\n            Clone at x: [1018] y: [-116]\n            Clone at x: [1050] y: [-116]\n            Clone at x: [1038] y: [-84]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (grass/dirt v)\n                Clone at x: [-190] y: [-60]\n                switch costume to (dirt v)\n                Clone at x: [-140] y: [-60]\n                switch costume to (box v)\n                Clone at x: [-90] y: [-60]\n                switch costume to (fence v)\n                Clone at x: [-40] y: [-60]\n                switch costume to (ladder v)\n                Clone at x: [10] y: [-60]\n                switch costume to (spike v)\n                Clone at x: [60] y: [-60]\n                switch costume to (chest v)\n                Clone at x: [110] y: [-60]\n                switch costume to (coin v)\n                Clone at x: [160] y: [-60]\n                switch costume to (tree v)\n                Clone at x: [210] y: [-60]\n                switch costume to (grass v)\n                Clone at x: [260] y: [-60]\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@foreground\n\nwhen I receive [title v]\nhide\n\nwhen I receive [setup v]\nhide\ngo to [front v] layer\nset [brightness v] effect to (5)\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (grass v)\n    Clone at x: [-101] y: [-116]\n    Clone at x: [-69] y: [-116]\n    switch costume to (tree v)\n    Clone at x: [410] y: [-116]\n    switch costume to (grass v)\n    Clone at x: [268] y: [-117]\n    Clone at x: [300] y: [-117]\n    Clone at x: [332] y: [-117]\n    switch costume to (fence v)\n    Clone at x: [110] y: [-117]\n    Clone at x: [142] y: [-117]\n    Clone at x: [174] y: [-117]\n    switch costume to (grass v)\n    Clone at x: [692] y: [-117]\n    Clone at x: [724] y: [-117]\n    Clone at x: [756] y: [-117]\n    Clone at x: [788] y: [-117]\n    Clone at x: [820] y: [-117]\n    switch costume to (box v)\n    Clone at x: [1007] y: [-117]\n    Clone at x: [1039] y: [-117]\n    Clone at x: [1031] y: [-90]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (grass v)\n        Clone at x: [692] y: [-117]\n        Clone at x: [724] y: [-117]\n        Clone at x: [756] y: [-117]\n        switch costume to (tree v)\n        Clone at x: [837] y: [-117]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (grass v)\n            Clone at x: [-76] y: [-117]\n            Clone at x: [-44] y: [-117]\n            Clone at x: [1010] y: [-117]\n            Clone at x: [1042] y: [-117]\n            Clone at x: [1074] y: [-117]\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@cloud\n\nwhen I start as a clone\ngo to [back v] layer\nswitch costume to (pick random (1) to (3))\nset size to (pick random (150) to (300)) %\nset [ghost v] effect to (70)\npoint in direction (pick random (-1) to (1))\nset [cloud speed v] to (pick random (-0.5) to (-1))\nforever\n    change [x v] by (CLOUD SPEED)\n    if <(x) < [-300]> then\n        delete this clone\n    end\nend\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nposition ((x) - ((SCROLL X) / (5))) ((y) - ((SCROLL Y) / (5)))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\ngo to [back v] layer\nClone at x: [-160] y: [93]\nClone at x: [-110] y: [15]\nClone at x: [0] y: [40]\nClone at x: [130] y: [130]\nClone at x: [190] y: [22]\nClone at x: [292] y: [89]\nClone at x: [315] y: [-20]\nClone at x: [422] y: [80]\nClone at x: [542] y: [29]\nClone at x: [700] y: [100]\nClone at x: [750] y: [0]\nClone at x: [845] y: [68]\nClone at x: [890] y: [-48]\nClone at x: [1025] y: [120]\nClone at x: [1081] y: [-11]\nset [x v] to [-999999999]\n\nwhen I receive [play game v]\nforever\n    wait (pick random (1) to (2)) seconds\n    Clone at x: [1200] y: ((pick random (-1) to (5)) * (30))\nend\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@counter\n\nwhen I start as a clone\nshow\nchange [clones v] by (1)\nset [id v] to (Clones)\nchange x by (([abs v] of (id) ) * (-14))\nforever\n    switch costume to (join [n] (letter (((length of (Var)) + (1)) - (id)) of (Var)))\n    if <(length of (Var)) < (id)> then\n        change [clones v] by (-1)\n        delete this clone\n    end\nend\n\nwhen I receive [tick v]\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Test - Counter\nif <(length of (Var)) > (Clones)> then\n    create clone of (_myself_ v)\nend\n\nTest - Counter\n\nwhen I receive [title v]\nhide\n\nwhen I receive [green flag v]\ngo to [front v] layer\nset rotation style [don't rotate v]\npoint in direction (90)\nset size to (220) %\ngo to x: (-150) y: (110)\nhide\nset [var v] to [0]\nset [clones v] to [0]\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@Health\n\nwhen I receive [-1 health v]\nnext costume\n\nwhen I receive [title v]\nhide\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\nswitch costume to (0 v)\nnext costume\nshow\ngo to x: (-200) y: (110)\n\nwhen I receive [green flag v]\nset size to (500) %\ngo to [front v] layer\nswitch costume to (costume3 v)\nset rotation style [don't rotate v]\npoint in direction (90)\nset [id v] to [0]\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@back ground\n\nwhen I receive [tick v]\nposition ((x) - ((SCROLL X) / (10))) ((y) - ((SCROLL Y) / (10)))\ngo to [back v] layer\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [setup v]\nhide\nset [x v] to [110]\nset [y v] to [-40]\n\nwhen I receive [green flag v]\nhide\nset size to (200) %\nset rotation style [don't rotate v]\npoint in direction (90)\ngo to x: (0) y: (0)\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@thumbnail\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\n\nwhen I receive [setup v]\nset drag mode [not draggable v]\n\n@TITLE\n\nwhen I receive [title v]\nshow\ngo to x: (0) y: (100)\nglide (.5) secs to x: (0) y: (0)\nrepeat until <not <(GAMEMODE) = [title]>>\n    set y to ((0) + (([cos v] of (((timer) - (8)) * (1000)) ) * (2)))\nend\n\nwhen I receive [starting... v]\nglide (.5) secs to x: (0) y: (100)\nhide\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [title v]\nset drag mode [not draggable v]\n\n@Play\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to ((size) + (((100) - (size)) / (2))) %\n    else\n        set size to ((size) + (((80) - (size)) / (1.5))) %\n    end\nend\n\nwhen I receive [title v]\nshow\nset size to (100) %\ngo to x: (0) y: (-200)\nglide (.4) secs to x: (0) y: (0)\nrepeat until <not <(GAMEMODE) = [title]>>\n    point in direction ((90) + (([sin v] of ((timer) * (100)) ) * (5)))\nend\n\nwhen this sprite clicked\nset [gamemode v] to [game]\nbroadcast (STARTING... v)\nwait (1.5) seconds\nset [gamemode v] to [play]\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen I receive [play game v]\nhide\n\nwhen I receive [starting... v]\nglide (.4) secs to x: (0) y: (-200)\nhide\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        start sound [click2 v]\n        wait until <not <touching (mouse-pointer v)?>>\n        start sound [click3 v]\n    end\nend\n\nwhen I receive [title v]\nset drag mode [not draggable v]\n\n