100% Pen Platformer v2.0

Instructions: -------------------------------------------------------------------------\nPlease ❤️ and ⭐! And if you want more projects, then don't forget to follow me.\n-------------------------------------------------------------------------\nInstructions:\n➥Move the player with wasd and arrow keys (mobile          \n   friendly)\n➥Don't touch the lava (orange)\n➥Purple is bouncy\n➥Try to beat the high score. My high score is 11\n   seconds.\n-------------------------------------------------------------------------\nImportant Notes:\n➥If you are a new Scratcher and beat the high score, \n   then it won't be changed into your time because \n   you don't have cloud variables and have to wait \n   about two weeks, maybe more or less.\n➥If it's too laggy, try turbowarb: \n    https://turbowarp.org/530638751\n-------------------------------------------------------------------------\nAbout:\n➥This is a project for the contest. After it has finished, I \n    will upload a new project called F.U.T.U.R.E - you \n    can try the beta version: \n    https://scratch.mit.edu/projects/634120519/\n-------------------------------------------------------------------------\nTags:\n#All #Games #Frontpage #Trending #Pen #Platformer  #Dani #LetsgetThisOnTrending #Art #Music #Stories #Action #Game #Wolfnet #Contest #Entry #Wolfnettest \n-------------------------------------------------------------------------

@Stage\n\nwhen flag clicked\nask [What's your name?] and wait\nset [your name: v] to (answer)\nbroadcast (answered name v)\nstop [this script v]\n\n@Lag Reducer\n\n@RenderFigur1\n\ndefine Render\ndelete all of [platform-type v]\ndelete all of [platform-height v]\ndelete all of [platform-length v]\ndelete all of [platform-x v]\ndelete all of [platform-y v]\nRender Grid\nPlatforms\nLava\nGravitiy\nBouncy\nWin\nDraw Player // Width: (Player width) X: (Player X) Y: (Player Y) Size: [10]\nbroadcast (tick v)\n\ndefine Draw Player // Width: (width) X: (x) Y: (y) Size: (size)\nset pen color to (#61ce1c)\nLine // X: ((x) - (width)) Y: ((y) + (width)) X2: ((x) + (width)) Y2: ((y) + (width)) Size: (size)\nLine // X: ((x) + (width)) Y: ((y) + (width)) X2: ((x) + (width)) Y2: ((y) - (width)) Size: (size)\nLine // X: ((x) + (width)) Y: ((y) - (width)) X2: ((x) - (width)) Y2: ((y) - (width)) Size: (size)\nLine // X: ((x) - (width)) Y: ((y) - (width)) X2: ((x) - (width)) Y2: ((y) + (width)) Size: (size)\n\ndefine Line // X: (x) Y: (y) X2: (x2) Y2: (y2) Size: (size)\nset pen size to (size)\npen up\ngo to x: ((x) - (Cam X)) y: ((y) - (Cam Y))\npen down\ngo to x: ((x2) - (Cam X)) y: ((y2) - (Cam Y))\npen up\n\ndefine Physics // Move Speed: (speed) Jump Height: (jump)\ngo to x: ((Player X) - (Cam X)) y: ((Player Y) - (Cam Y))\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<(mouse x) > ((x position) + (10))> and <mouse down?>>> then\n    change [xvel v] by (speed)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(mouse x) < ((x position) - (10))> and <mouse down?>>> then\n    change [xvel v] by ((0) - (speed))\nend\nset [xvel v] to ((xvel) * (0.9))\nif <([abs v] of (xvel) ) > [0.9]> then\n    Change X // Change: (round (xvel))\nend\nchange [yvel v] by (-2)\nif <(in air) < [6]> then\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > (x position)> and <mouse down?>>> then\n        set [yvel v] to (jump)\n    end\nend\nif <[collisions v] contains [b]?> then\n    set [yvel v] to [30]\nend\nChange Y // Change: (yvel)\nif <<<[collisions v] contains [l]?> or <(Player Y) < [-300]>> or <(Player Y) > [800]>> then\n    set [dead v] to [1]\nend\nchange [cam x v] by (((Player X) - (Cam X)) / (5))\nchange [cam y v] by (((Player Y) - (Cam Y)) / (5))\nCollisions // Width: (Collision Width)\nif <[collisions v] contains [w]?> then\n    set [win v] to [1]\nend\n\ndefine Change X // Change: (change)\nchange [player x v] by (change)\nCollisions // Width: (Collision Width)\nif <[collisions v] contains [p]?> then\n    repeat (8)\n        change [player y v] by (1)\n        Collisions // Width: (Collision Width)\n        if <not <[collisions v] contains [p]?>> then\n            stop [this script v]\n        end\n    end\n    change [player y v] by (-8)\n    repeat until <not <[collisions v] contains [p]?>>\n        Collisions // Width: (Collision Width)\n        if <(change) > [0]> then\n            change [player x v] by (-1)\n        else\n            change [player x v] by (1)\n        end\n    end\nend\n\nwhen I receive [reset v]\nReset\n\ndefine Render Grid\nset pen color to (#171717)\nset pen size to (10)\ngo to x: (((-240) - (((Cam X) * (0.5)) mod (Grid Length))) + (() mod (Grid Length))) y: (-180)\nrepeat (13)\n    pen down\n    set y to (180)\n    pen up\n    change x by (40)\n    set y to (-180)\nend\ngo to x: (-240) y: (((-180) - (((Cam Y) * (0.5)) mod (Grid Length))) + (() mod (Grid Length)))\nrepeat (10)\n    pen down\n    set x to (240)\n    pen up\n    change y by (40)\n    set x to (-240)\nend\n\ndefine Draw Platform // X: (x) Y: (y) Length: (length) Height: (height)\nadd (x) to [platform-x v]\nadd (y) to [platform-y v]\nadd ([abs v] of (length) ) to [platform-length v]\nadd ([abs v] of (height) ) to [platform-height v]\nadd [p] to [platform-type v]\nset pen color to (#00a9ff)\nset pen (brightness v) to (60)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 2)\nset pen color to (#009dff)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 1)\n\ndefine Platforms\nDraw Platform // X: [2] Y: [-40] Length: ((2) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [182] Y: [0] Length: ((2) * (Grid Length)) Height: ((2) * (Grid Length))\nDraw Platform // X: [362] Y: [40] Length: ((2) * (Grid Length)) Height: ((3) * (Grid Length))\nDraw Platform // X: [800] Y: [120] Length: ((2) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [1120] Y: [-40] Length: ((4) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [1860] Y: [-40] Length: ((3) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [2120] Y: [-40] Length: ((3) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [2300] Y: [100] Length: ((1) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [2100] Y: [150] Length: ((1) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [2300] Y: [250] Length: ((1) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [2100] Y: [350] Length: ((1) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [2300] Y: [450] Length: ((1) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [2500] Y: [450] Length: ((1) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [2780] Y: [450] Length: ((1) * (Grid Length)) Height: ((0.5) * (Grid Length))\nDraw Platform // X: [-550] Y: [-40] Length: ((3) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [-1000] Y: [-40] Length: ((3) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [-1180] Y: [300] Length: ((1) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Platform // X: [775] Y: [860] Length: ((49) * (Grid Length)) Height: ((1) * (Grid Length))\n\ndefine Change Y // Change: (change)\nif <(Reverse?) = [0]> then\n    change [player y v] by (change)\nelse\n    change [player y v] by ((0) - (change))\nend\nchange [in air v] by (1)\nCollisions // Width: (Collision Width)\nrepeat until <not <[collisions v] contains [p]?>>\n    Collisions // Width: (Collision Width)\n    set [yvel v] to [0]\n    if <(Reverse?) = [1]> then\n        if <((0) - (change)) > [0]> then\n            change [player y v] by (-1)\n            set [in air v] to [0]\n        else\n            change [player y v] by (1)\n        end\n    else\n        if <(change) > [0]> then\n            change [player y v] by (-1)\n        else\n            change [player y v] by (1)\n            set [in air v] to [0]\n        end\n    end\nend\n\ndefine Collisions // Width: (width)\ndelete all of [collisions v]\nset [i v] to [0]\nrepeat (length of [platform-x v])\n    change [i v] by (1)\n    if <not <(Player X) > (((item (i) of [platform-x v]) + (item (i) of [platform-length v])) + (width))>> then\n        if <not <(Player Y) > (((item (i) of [platform-y v]) + (item (i) of [platform-height v])) + (width))>> then\n            if <not <(Player X) < (((item (i) of [platform-x v]) - (item (i) of [platform-length v])) - (width))>> then\n                if <not <(Player Y) < (((item (i) of [platform-y v]) - (item (i) of [platform-height v])) - (width))>> then\n                    add (item (i) of [platform-type v]) to [collisions v]\n                end\n            end\n        end\n    end\nend\n\ndefine Loop\nerase all\nRender\nPhysics // Move Speed: [1.5] Jump Height: [16]\n\ndefine Draw Bounce // X: (x) Y: (y) Length: (length) Height: (height)\nadd (x) to [platform-x v]\nadd (y) to [platform-y v]\nadd ([abs v] of (length) ) to [platform-length v]\nadd ([abs v] of (height) ) to [platform-height v]\nadd [b] to [platform-type v]\nset pen color to (#ff0061)\nset pen (brightness v) to (80)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 2)\nset pen color to (#ff006e)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 1)\n\ndefine Draw Lava // X: (x) Y: (y) Length: (length) Height: (height)\nadd (x) to [platform-x v]\nadd (y) to [platform-y v]\nadd ([abs v] of (length) ) to [platform-length v]\nadd (([abs v] of (height) ) + ((0) - (pen tick))) to [platform-height v]\nadd [l] to [platform-type v]\nset pen color to (#ff8800)\nset pen (brightness v) to (60)\nLine // X: ((x) - (length)) Y: ((y) + ((height) + ((0) - (pen tick)))) X2: ((x) + (length)) Y2: ((y) + ((height) + ((0) - (pen tick)))) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) + ((height) + ((0) - (pen tick)))) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + ((height) + ((0) - (pen tick)))) Size: (Size 2)\nset pen color to (#ff7b00)\nLine // X: ((x) - (length)) Y: ((y) + ((height) + ((0) - (pen tick)))) X2: ((x) + (length)) Y2: ((y) + ((height) + ((0) - (pen tick)))) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) + ((height) + ((0) - (pen tick)))) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + ((height) + ((0) - (pen tick)))) Size: (Size 1)\n\nwhen I receive [scripts v]\nforever\n    change [pen tick v] by (1)\n    if <(pen tick) > [20]> then\n        repeat until <(pen tick) < [1]>\n            change [pen tick v] by (-1)\n        end\n    end\nend\n\nwhen I receive [scripts v]\nforever\n    set [reverse? v] to [0]\n    wait until <not <[collisions v] contains [r]?>>\n    wait until <[collisions v] contains [r]?>\n    set [reverse? v] to [1]\n    wait until <not <[collisions v] contains [r]?>>\n    wait until <[collisions v] contains [r]?>\n    set [reverse? v] to [0]\nend\n\ndefine Draw Gravity Switch // X: (x) Y: (y) Length: (length) Height: (height)\nadd (x) to [platform-x v]\nadd (y) to [platform-y v]\nadd (length) to [platform-length v]\nadd (height) to [platform-height v]\nadd [r] to [platform-type v]\nset pen color to (#2aff00)\nset pen (brightness v) to (60)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 2)\nset pen color to (#2aff00)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 1)\n\ndefine Lava\nDraw Lava // X: [700] Y: [-40] Length: ((6) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Lava // X: [1560] Y: [-40] Length: ((4) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Lava // X: [2640] Y: [450] Length: ((2) * (Grid Length)) Height: ((0.5) * (Grid Length))\n\ndefine Reset\ndelete all of [platform-type v]\ndelete all of [platform-height v]\ndelete all of [platform-length v]\ndelete all of [platform-x v]\ndelete all of [platform-y v]\ndelete all of [collisions v]\nset [reverse? v] to [0]\nset [dead v] to [0]\nset [collision width v] to [23]\nset [grid length v] to [40]\nset [cam x v] to [0]\nset [cam y v] to [0]\nset [player x v] to [0]\nset [player y v] to [50]\nset [xvel v] to [0]\nset [yvel v] to [0]\nset [player width v] to [15]\nset [win v] to [0]\n\ndefine Bouncy\nDraw Bounce // X: [1340] Y: [-40] Length: ((1) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Bounce // X: [1500] Y: [100] Length: ((1) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Bounce // X: [1660] Y: [240] Length: ((1) * (Grid Length)) Height: ((1) * (Grid Length))\n\ndefine Win\nDraw Win // X: [2880] Y: [550] Length: ((0.5) * (Grid Length)) Height: ((0.5) * (Grid Length))\n\ndefine Draw Win // X: (x) Y: (y) Length: (length) Height: (height)\nadd (x) to [platform-x v]\nadd (y) to [platform-y v]\nadd ([abs v] of (length) ) to [platform-length v]\nadd ([abs v] of (height) ) to [platform-height v]\nadd [w] to [platform-type v]\nset pen color to (#ff00e9)\nset pen (brightness v) to (60)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 2)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 2)\nset pen color to (#ff00e7)\nLine // X: ((x) - (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) + (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) + (height)) X2: ((x) + (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) + (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) - (height)) Size: (Size 1)\nLine // X: ((x) - (length)) Y: ((y) - (height)) X2: ((x) - (length)) Y2: ((y) + (height)) Size: (Size 1)\n\nwhen [timer v] > (0.01)\nerase all\nset [player x v] to [0]\nset [player y v] to [25]\nset [cam x v] to [0]\nset [cam y v] to [40]\nset [player width v] to [15]\nRender Grid\nPlatforms\nLava\nGravitiy\nBouncy\nWin\nDraw Player // Width: (Player width) X: (Player X) Y: (Player Y) Size: [10]\nbroadcast (tn v)\n\ndefine Gravitiy\nDraw Gravity Switch // X: [-1180] Y: [-40] Length: ((1) * (Grid Length)) Height: ((1) * (Grid Length))\nDraw Gravity Switch // X: [2800] Y: [860] Length: ((1) * (Grid Length)) Height: ((1) * (Grid Length))\n\nwhen flag clicked\nforever\n    if <touching color (#ff7b00)?> then\n        broadcast (kill v)\n    end\nend\n\nwhen I receive [answered name v]\nwait (0.1) seconds\nbroadcast (Scripts v)\nbroadcast (reset v) and wait\nforever\n    Loop\n    if <(Dead) = [1]> then\n        stop [other scripts in sprite v]\n        broadcast (Scripts v)\n        broadcast (reset v) and wait\n    end\n    if <[1] = (win)> then\n        repeat until <<(round (item (item # of [w] in [platform-type v]) of [platform-x v])) = (round (Player X))> and <(round (item (item # of [w] in [platform-type v]) of [platform-y v])) = (round (Player Y))>>\n            change [player x v] by (((item (item # of [w] in [platform-type v]) of [platform-x v]) - (Player X)) / (5))\n            change [player y v] by (((item (item # of [w] in [platform-type v]) of [platform-y v]) - (Player Y)) / (5))\n            set [cam x v] to (Player X)\n            set [cam y v] to (Player Y)\n            change [player width v] by (-0.3)\n            erase all\n            Render\n        end\n        set [win text v] to [You Win!]\n        broadcast (win v) and wait\n        stop [this script v]\n    end\nend\n\n@Timer\n\nwhen flag clicked\nset [your name: v] to []\nset [your time: v] to [0]\nhide variable [your time: v]\nbroadcast (asking name v)\n\nwhen I receive [answered name v]\nshow variable [your time: v]\nforever\n    wait (0.01) seconds\n    change [your time: v] by (0.1)\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite v]\nif <(Your Time:) < (☁ Highscore)> then\n    set [☁ highscore v] to (Your Time:)\nend\n\nwhen I receive [scripts v]\nforever\n    reset timer\nend\n\nwhen I receive [hide v]\nhide variable [your time: v]\n\n@Screens\n\nwhen flag clicked\nshow\nswitch costume to (kostüm2 v)\nshow list [collisions v]\n\nwhen I receive [win v]\nswitch costume to (win screen v)\nshow\ngo to [front v] layer\n\nwhen I receive [answered name v]\nhide\n\nwhen I receive [hide v]\nswitch costume to (kostüm2 v)\n\n@Button\n\nwhen flag clicked\nhide\nhide variable [☁ highscore v]\n\nwhen I receive [win v]\nshow\nforever\n    go to x: (0) y: (-100)\n    go to [front v] layer\n    go [forward v] (100) layers\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        show variable [☁ highscore v]\n        hide\n        broadcast (hide v)\n    end\nend\n\n@Music/Sounds\n\nwhen flag clicked\nplay sound [Rock Angel v] until done\nforever\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse x) > ((x position) + (10))> and <mouse down?>>>> then\n        play sound [Jump v] until done\n        wait (0.5) seconds\n    end\nend\n\nwhen I receive [answered name v]\nset volume to (0) %\nstop all sounds\nset volume to (100) %\nforever\n    play sound [RE_RUN v] until done\nend\n\nset [☁ highscore v] to [30]\n\n@Particles\n\nwhen flag clicked\nset [counter v] to [0]\nhide\ngo to [front v] layer\ngo [forward v] (100) layers\ngo to x: (100) y: (280)\nforever\n    cloning\nend\n\nwhen I start as a clone\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    if <<(y position) = [-172]> or <<(x position) < [-200]> or <(x position) > [200]>>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [answered name v]\nstop [other scripts in sprite v]\ndeleting (counter)\n\ndefine cloning\nwait (0.2) seconds\nchange [counter v] by (1)\nset x to (pick random (-200) to (200))\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [color v] effect to (pick random (40) to (100))\nset [ghost v] effect to (100)\nforever\n    change y by (-2)\nend\n\ndefine deleting (number)\nrepeat (number)\n    delete this clone\nend\n\n@Particles 2\n\nwhen flag clicked\nset [counter v] to [0]\nhide\ngo to [front v] layer\ngo [forward v] (100) layers\ngo to x: (100) y: (280)\nforever\n    cloning\nend\n\nwhen I start as a clone\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    if <<(y position) = [-172]> or <<(x position) < [-200]> or <(x position) > [200]>>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [answered name v]\nstop [other scripts in sprite v]\ndeleting (counter)\n\ndefine cloning\nwait (0.2) seconds\nchange [counter v] by (1)\nset x to (pick random (-200) to (200))\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [color v] effect to (pick random (40) to (100))\nset [ghost v] effect to (100)\nforever\n    change y by (-2)\nend\n\ndefine deleting (number)\nrepeat (number)\n    delete this clone\nend\n\n