Adventure - A Platformer | #all #games

Instructions: Hello Guys, I Finally Present My First Platformer For The Adventure Series\n\n\nINSTRUCTIONS :-\n* [Arrow Keys/Tap] move player\n* Bounce On Trampolines\n* Avoid Obstacles\n* Kill Enemies\n* Have Fun Watching The Peace Grassland!\n* Like And Star This Project : D\n\nSHOUTOUTS:-\nCool Person @-LightCode--\n\nCREDITS:-\nThanks @GravityV for engine\n@GravityV For Some Game Art\nThe Rest Is By Me

@Stage\n\nwhen flag clicked\nset volume to (100) %\nforever\n    play sound [Alone For Now v] until done\nend\n\n@Time\n\nwhen flag clicked\nforever\n    set [magma v] to [0]\n    repeat (10)\n        change [magma v] by (1)\n    end\n    repeat (20)\n        change [magma v] by (-1)\n    end\n    repeat (10)\n        change [magma v] by (1)\n    end\nend\n\nwhen I start as a clone\nset size to (50) %\ngo to [front v] layer\nshow\nforever\n    switch costume to (letter ((((x position) - (X of time)) / (Width)) + (1)) of (Time))\n    if <(letter ((((x position) - (X of time)) / (Width)) + (1)) of (Time)) = []> then\n        hide\n    else\n        show\n        go to [front v] layer\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag clicked v]\nset [time yes/no v] to [Yes]\nforever\n    if <(Time yes/no) = [Yes]> then\n        change [time v] by (1)\n        set [brightness v] effect to (25)\n        wait (0.5) seconds\n    end\nend\n\nwhen I receive [green flag clicked v]\nset [time v] to [0]\nset [x of time v] to [0]\nset [the time v] to [1]\nset [maximum length v] to [5]\nset [width v] to [22]\ngo to x: (X of time) y: (140)\nrepeat (Maximum length)\n    set [the time v] to (Time)\n    create clone of (_myself_ v)\n    change x by (Width)\nend\n\nwhen flag clicked\nwait (2.5) seconds\nbroadcast (Green Flag clicked v)\n\nwhen I receive [green flag clicked v]\nset [the time v] to [0]\nset [time v] to [0]\n\nwhen I receive [yay! v]\nset [time yes/no v] to [No]\nset [brightness v] effect to (100)\n\nwhen I receive [end of levels v]\nstop [other scripts in sprite v]\n\n@Water\n\nwhen I receive [position v]\nposition (round ((Water: x) - (SCROLLX))) (round (((y) - (SCROLLY)) + (([cos v] of ((timer) * (40)) ) * (20))))\ngo to [back v] layer\n\ndefine position (x) (y)\nshow\nset size to (400) %\ngo to x: (x) y: (y)\nset size to (100) %\n\ndefine clone at (x) (y) (type)\nset [water: x v] to (x)\nset [y v] to (y)\nswitch costume to (type)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\nswitch costume to (costume4 v)\nclone at [-350] [-200] [1]\nclone at [550] [-100] [1]\nclone at [550] [-200] [2]\nclone at [670] [-100] [1]\nclone at [670] [-200] [2]\nclone at [2250] [0] [1]\nclone at [2250] [-100] [2]\nclone at [2373] [0] [1]\nclone at [2373] [-100] [2]\nclone at [2850] [0] [1]\nclone at [2850] [-100] [2]\nclone at [2972] [0] [1]\nclone at [2972] [-100] [2]\nclone at [3140] [0] [1]\nclone at [3140] [-100] [2]\nclone at [3260] [0] [1]\nclone at [3260] [-100] [2]\nclone at [3800] [0] [1]\nclone at [3800] [-100] [2]\nclone at [3900] [0] [1]\nclone at [3900] [-100] [2]\nclone at [4160] [0] [1]\nclone at [4160] [-100] [2]\nclone at [4280] [0] [1]\nclone at [4280] [-100] [2]\nclone at [4400] [0] [1]\nclone at [4400] [-100] [2]\nclone at [4520] [0] [1]\nclone at [4520] [-100] [2]\nclone at [4638] [0] [1]\nclone at [4638] [-100] [2]\nclone at [4757] [0] [1]\nclone at [4757] [-100] [2]\nclone at [4875] [0] [1]\nclone at [4875] [-100] [2]\nclone at [4993] [0] [1]\nclone at [4993] [-100] [2]\nclone at [5112] [0] [1]\nclone at [5112] [-100] [2]\nset [water: x v] to [-9999999999999999]\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@Stairs\n\nwhen flag clicked\nhide\nclone at [4080] [1300]\nclone at [4080] [1420]\nclone at [4380] [1600]\nclone at [4380] [1720]\nset [stairs: x v] to [-99999999999999]\n\ndefine clone at (x) (y)\nset [stairs: x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [position v]\nshow\nset size to (400) %\ngo to x: ((Stairs: x) - (SCROLLX)) y: ((y) - (SCROLLY))\nset size to (100) %\ngo to [back v] layer\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@Platform\n\nwhen I receive [position v]\nposition (round ((Platform: x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\ndefine clone at (x) (y)\nset [platform: x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (costume4 v)\nset [ghost v] effect to (0)\nclone at [-527] [20]\nclone at [0] [0]\nclone at [500] [0]\nclone at [970] [0]\nclone at [1450] [0]\nclone at [1952] [0]\nclone at [2600] [0]\nclone at [3600] [0]\nclone at [4200] [0]\nclone at [5298] [0]\nclone at [4353] [400]\nset [platform: x v] to [-9999999999999999]\n\n@Thum\n\nwhen flag clicked\ngo to x: (0) y: (0)\nrepeat (10)\n    change [ghost v] effect by (10)\n    reset timer\nend\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.0001)\nshow\nset size to (150) %\ngo to [front v] layer\nrepeat until <(size) < [100.3]>\n    change size by (((100) - (size)) / (8))\n    change [ghost v] effect by (-15)\nend\n\n@Platform Art\n\nwhen I receive [position v]\nposition (round ((Platform Art: x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(round (x)) = (round (x position))> and <(round (y)) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\ndefine clone at (x) (y)\nset [platform art: x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nnext costume\n\nwhen flag clicked\nswitch costume to (costume4 v)\nclone at [-527] [20]\nclone at [0] [0]\nclone at [500] [0]\nclone at [970] [0]\nclone at [1450] [0]\nclone at [1952] [0]\nclone at [2600] [0]\nclone at [3600] [0]\nclone at [4200] [0]\nclone at [5298] [0]\nset [platform art: x v] to [-9999999999999999]\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@Notifacation\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen flag clicked\nshow\ngo to x: (0) y: (50)\nhide\nwait (pick random (5) to (10)) seconds\nshow\nrepeat until <(y position) < [6]>\n    change y by (((5) - (y position)) / (6))\nend\nwait (3.5) seconds\nrepeat until <(y position) > [49.5]>\n    change y by (((y position) + (5)) / (5))\nend\nhide\nforever\n    switch costume to (pick random (1) to (7))\n    wait (pick random (14) to (26)) seconds\n    show\n    repeat until <(y position) < [6]>\n        change y by (((5) - (y position)) / (6))\n    end\n    wait (3.5) seconds\n    repeat until <(y position) > [49.5]>\n        change y by (((y position) + (5)) / (5))\n    end\n    hide\nend\n\n@Moving Platforms\n\nwhen flag clicked\nhide\nclone at [3050] [181] [1]\nset [moving platforms: x v] to [-99999999999999999999]\n\nwhen I receive [position v]\nshow\nif <(costume [number v]) = [1]> then\n    set size to (400) %\n    go to x: (round (((Moving Platforms: x) - (SCROLLX)) + (([sin v] of ((days since 2000) * (6000000)) ) * (150)))) y: (round ((y) - (SCROLLY)))\n    set size to (100) %\nend\nif <(costume [number v]) = [2]> then\n    set size to (400) %\n    go to x: (round ((Moving Platforms: x) - (SCROLLX))) y: (round (((y) - (SCROLLY)) + (([sin v] of ((days since 2000) * (6000000)) ) * (300))))\n    set size to (100) %\n    if <touching (player v)?> then\n        broadcast (moving platform detection v)\n    end\nend\n\ndefine clone at (x) (y) (type)\nset [moving platforms: x v] to (x)\nset [y v] to (y)\nswitch costume to (type)\ncreate clone of (_myself_ v)\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@messages\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\n\nwhen I receive [conneecting v]\ngo to [front v] layer\nswitch costume to (connecting v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [connected v]\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (connected v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nbroadcast (lf v)\n\nwhen I receive [fail v]\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (fail v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [lf v]\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nswitch costume to (lf v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (4) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [win v]\nhide variable [collected v]\ngo to [front v] layer\nswitch costume to (won v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [continue v]\nhide variable [@time@ v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (lf v)\n\n@player\n\nwhen flag clicked\nshow\nset [res.x v] to [-141]\nset [res.y v] to [0]\ninit\nforever\n    game tick\nend\n\ndefine init\nset [in air? v] to [1]\nset [playerx v] to (RES.X)\nset [playery v] to (RES.Y)\nset [scrollx v] to ((playerX) + (100))\nset [scrolly v] to (playerY)\nset [sx v] to [0]\nset [sy v] to [0]\nposition player\nbroadcast (POSITION v)\n\ndefine change player x by (val)\nchange [playerx v] by (val)\nposition player\nif <<touching (platform v)?> or <touching (moving platforms v)?>> then\n    repeat (12)\n        change [playery v] by (1)\n        position player\n        if <not <<touching (platform v)?> or <touching (moving platforms v)?>>> then\n            stop [this script v]\n        end\n    end\n    change [playery v] by (-12)\n    repeat (200)\n        if <(val) < [0]> then\n            change [playerx v] by (1)\n            position player\n        else\n            change [playerx v] by (-1)\n            position player\n        end\n        set [sx v] to [0]\n        if <not <<touching (platform v)?> or <touching (moving platforms v)?>>> then\n            stop [this script v]\n        end\n    end\n    if <<touching (platform v)?> or <touching (moving platforms v)?>> then\n        start sound [Low Squeak2 v]\n        broadcast (die v)\n        init\n    end\nend\n\ndefine change player y by (val)\nchange [playery v] by (val)\nposition player\nif <<touching (platform v)?> or <touching (moving platforms v)?>> then\n    repeat (200)\n        if <(val) > [0]> then\n            change [playery v] by (-1)\n            position player\n            set [in air? v] to [1]\n        else\n            change [playery v] by (1)\n            position player\n            set [in air? v] to [0]\n        end\n        set [sy v] to [0]\n        if <not <<touching (platform v)?> or <touching (moving platforms v)?>>> then\n            stop [this script v]\n        end\n    end\n    if <<touching (platform v)?> or <touching (moving platforms v)?>> then\n        start sound [Low Squeak2 v]\n        broadcast (die v)\n        init\n    end\nelse\n    if <touching (water v)?> then\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            change [sy v] by (1)\n        else\n            change [sy v] by (-0.1)\n        end\n    else\n        change [sy v] by (-1.2)\n    end\n    position player\n    set [in air? v] to [1]\nend\n\ndefine position player\ngo to x: ((playerX) - (SCROLLX)) y: ((playerY) - (SCROLLY))\n\ndefine game tick\nmanager mode\nswitch costume to (hitbox v)\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [sx v] by (-1.4)\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    change [sx v] by (1.4)\nend\nchange player x by (round (sx))\nposition player\nif <touching (water v)?> then\n    set [sx v] to ((sx) * (0.5))\nelse\n    set [sx v] to ((sx) * (0.75))\nend\nif <touching (bouncy v)?> then\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        set [sy v] to [25]\n        set [in air? v] to [1]\n    else\n        set [sy v] to [15]\n        set [in air? v] to [1]\n    end\n    broadcast (boing v)\nelse\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        if <touching (stairs v)?> then\n            set [sy v] to [5]\n            set [in air? v] to [1]\n        else\n            if <(in air?) = [0]> then\n                set [sy v] to [15]\n                set [in air? v] to [1]\n            end\n        end\n    end\nend\nif <(sy) < [-30]> then\n    set [sy v] to [-30]\nend\nif <(sy) > [30]> then\n    set [sy v] to [30]\nend\nchange player y by (round (sy))\nposition player\nchange [scrollx v] by (round (((playerX) - (SCROLLX)) / (5)))\nchange [scrolly v] by (round (((playerY) - (SCROLLY)) / (5)))\nif <(SCROLLX) < [-400]> then\n    set [scrollx v] to [-400]\nend\nif <(SCROLLX) > [5118]> then\n    set [scrollx v] to [5118]\nend\nif <(SCROLLY) < [-40]> then\n    set [scrolly v] to [-40]\nend\nposition player\nbroadcast (POSITION v)\nif <<(playerY) < [-220]> or <touching (danger v)?>> then\n    start sound [Low Boing v]\n    broadcast (die v)\n    init\nend\ncostume\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen flag clicked\ngo to [front v] layer\nset volume to (100) %\nforever\n    if <touching (water v)?> then\n        start sound [Small_Splash_Audio v]\n        wait until <not <touching (water v)?>>\n    end\nend\n\ndefine manager mode\nif <(username) = [Mahdi-Animations]> then\n    if <key (0 v) pressed?> then\n        wait until <not <key (0 v) pressed?>>\n        repeat until <key (0 v) pressed?>\n            if <<key (up arrow v) pressed?> or <key (down arrow v) pressed?>> then\n                if <key (up arrow v) pressed?> then\n                    set [sy v] to [50]\n                end\n                if <key (down arrow v) pressed?> then\n                    set [sy v] to [-50]\n                end\n            else\n                set [sy v] to [0]\n            end\n            if <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> then\n                if <key (left arrow v) pressed?> then\n                    set [sx v] to [-50]\n                end\n                if <key (right arrow v) pressed?> then\n                    set [sx v] to [50]\n                end\n            else\n                set [sx v] to [0]\n            end\n            change [playerx v] by (round (sx))\n            change [playery v] by (round (sy))\n            change [scrollx v] by (round (((playerX) - (SCROLLX)) / (5)))\n            change [scrolly v] by (round (((playerY) - (SCROLLY)) / (5)))\n            if <(SCROLLX) < [-400]> then\n                set [scrollx v] to [-400]\n            end\n            if <(SCROLLX) > [5118]> then\n                set [scrollx v] to [5118]\n            end\n            if <(SCROLLY) < [-40]> then\n                set [scrolly v] to [-40]\n            end\n            position player\n            broadcast (POSITION v)\n        end\n        wait until <not <key (0 v) pressed?>>\n        set [sx v] to [0]\n        set [sy v] to [0]\n    end\nend\n\nwhen I receive [kill enemy v]\nset [sy v] to [15]\n\nwhen I receive [touched enemy v]\nstart sound [Low Squeak2 v]\nbroadcast (die v)\ninit\n\nwhen I receive [moving platform detection v]\nswitch costume to (hitbox v)\nif <(sy) > [0]> then\n    change player y by [10]\nelse\n    change player y by [-10]\nend\ncostume\n\nwhen I receive [talk v]\nthink (@USERNAME@) for (4.5) seconds\n\nwhen flag clicked\nforever\n    if <<<mouse down?> and <touching (mouse-pointer v)?>> or <key (t v) pressed?>> then\n        wait until <not <<mouse down?> or <key (t v) pressed?>>>\n        broadcast (chat v) and wait\n    end\nend\n\ndefine costume\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    switch costume to (player_up v)\nelse\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        switch costume to (player_left v)\n    else\n        if <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n            switch costume to (player_right v)\n        else\n            switch costume to (player_center v)\n        end\n    end\nend\n\n@Enemies\n\nwhen I receive [position v]\nshow\nset size to (400) %\ngo to x: (((Enemies: x) - (SCROLLX)) + (([cos v] of ((timer) * (100)) ) * (100))) y: ((y) - (SCROLLY))\nset size to (100) %\n\ndefine clone at (x) (y)\nset [enemies: x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\nclone at [3584] [138]\nset [enemies: x v] to [-99999999999999]\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        if <([sy v] of [player v]) < [-5]> then\n            broadcast (kill enemy v)\n            start sound [Low Whoosh v]\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            delete this clone\n        else\n            broadcast (touched enemy v)\n        end\n    end\nend\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@Danger\n\nwhen flag clicked\nhide\nset [clone# v] to [1]\nclone at [0] [-70] [3]\nclone at [410] [-60] [1]\nclone at [906] [-30] [1]\nclone at [1100] [-30] [3]\nclone at [1479] [90] [1]\nclone at [1710] [140] [1]\nclone at [2249] [-220] [1]\nclone at [2368] [142] [3]\nclone at [2891] [-130] [1]\nclone at [3073] [-130] [1]\nclone at [3256] [-130] [1]\nclone at [5255] [240] [2]\nset [danger: x v] to [-999999999999]\n\ndefine clone at (x) (y) (type)\ngo to [back v] layer\ngo [forward v] (1) layers\nswitch costume to (type)\nset [danger: x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nchange [clone# v] by (1)\n\ndefine position (x) (y)\nshow\nset size to (400) %\ngo to x: (x) y: (y)\nset size to (100) %\n\nwhen I receive [position v]\nposition (round ((Danger: x) - (SCROLLX))) (round ((y) - (SCROLLY)))\nif <(costume [number v]) = [1]> then\n    point in direction ((90) - (([sin v] of ((timer) * (150)) ) * (40)))\nelse\n    point in direction (90)\nend\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@buttons\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I start as a clone\nshow\nforever\n    go to [front v] layer\n    if <(clone#) = [1]> then\n        switch costume to (yes v)\n        go to x: (-104) y: (-144)\n    end\n    if <(clone#) = [2]> then\n        switch costume to (no v)\n        go to x: (104) y: (-144)\n    end\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (20)\n        set size to (110) %\n        if <mouse down?> then\n            if <(clone#) = [1]> then\n                broadcast (continue v)\n                broadcast (del clones v) and wait\n            else\n                set [@my player #@ v] to [0]\n                hide variable [@time@ v]\n                hide variable [☁ @highscore@ v]\n                broadcast (stop v)\n                broadcast (del clones v) and wait\n            end\n        end\n    else\n        set [brightness v] effect to (0)\n        set size to (100) %\n    end\nend\n\ndefine set up clones\nset [clone# v] to [1]\nrepeat (2)\n    create clone of (_myself_ v)\n    change [clone# v] by (1)\nend\n\nwhen I receive [win v]\nset up clones\n\nwhen I receive [del clones v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I start as a clone\nshow\nforever\n    wait until <touching (mouse-pointer v)?>\n    start sound [Tap Conga v]\n    wait until <not <touching (mouse-pointer v)?>>\nend\n\nwhen I receive [stop v]\nwait (0.1) seconds\nstop [all v]\n\n@bouncy\n\nwhen flag clicked\nhide\nclone at [320] [-57]\nclone at [1397] [-25]\nclone at [4102] [143]\nset [bouncy: x v] to [-99999999999999]\n\ndefine clone at (x) (y)\nswitch costume to (bouncy1 v)\nset [bouncy: x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [position v]\nposition (round ((bouncy: x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n\ndefine position (x) (y)\nshow\nset size to (400) %\ngo to x: (x) y: (y)\nset size to (100) %\n\nwhen I receive [boing v]\nstart sound [Basketball Bounce v]\nswitch costume to (bouncy2 v)\nwait (0.08) seconds\nswitch costume to (bouncy1 v)\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\n@Checkpoints\n\ndefine clone at (x) (y) (type)\nset [checkpoints: x v] to (x)\nset [y v] to (y)\nswitch costume to (type)\nset [type v] to (type)\ncreate clone of (_myself_ v)\n\nwhen I receive [position v]\nposition (round ((Checkpoints: x) - (SCROLLX))) (round ((y) - (SCROLLY)))\n\ndefine position (x) (y)\nshow\nset size to (400) %\ngo to x: (x) y: (y)\nset size to (100) %\n\nwhen flag clicked\nset [@time@ v] to []\nhide\nclone at [1155] [20] [1]\nclone at [2750] [175] [1]\nclone at [3761] [175] [1]\nclone at [5220] [265] [3]\nset [checkpoints: x v] to [-99999999999]\nhide variable [@time@ v]\nhide variable [checkpoints: ☁ @highscore@ v]\nwait until <<mouse down?> or <key (any v) pressed?>>\nreset timer\n\nwhen I start as a clone\nforever\n    if <(type) = [1]> then\n        if <touching (player v)?> then\n            switch costume to (checkpoint2 v)\n            set [res.x v] to (Checkpoints: x)\n            set [res.y v] to (y)\n            start sound [Tennis Hit v]\n            broadcast (die v)\n            stop [this script v]\n        end\n    end\n    if <(type) = [3]> then\n        if <touching (player v)?> then\n            set [@time@ v] to (timer)\n            switch costume to (checkpoint2 v)\n            set [res.x v] to (Checkpoints: x)\n            set [res.y v] to (y)\n            start sound [win sound 1-3 v]\n            broadcast (die v)\n            wait (3) seconds\n            broadcast (win v) and wait\n            show variable [@time@ v]\n            show variable [checkpoints: ☁ @highscore@ v]\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [die v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen I receive [win v]\nif <(@TIME@) < (Checkpoints: ☁ @HIGHSCORE@)> then\n    repeat (10)\n        set [checkpoints: ☁ @highscore@ v] to (@TIME@)\n    end\nend\n\ndefine reset highscore to (val) <lock>\nif <lock> then\n    set [checkpoints: ☁ @highscore@ v] to (val)\nend\n\n