- Lava Dash II - Scrolling Platformer

Instructions: - Lava Dash II - Scrolling Platformer\n=========================================\nArrow keys to play (down arrow key to crouch)

@Stage\n\nwhen I receive [end v]\nwait (1) seconds\nbroadcast (clear v)\n\nwhen flag clicked\nforever\n    set volume to (40) %\n    play sound [lost-sky-dreams-ncs-release v] until done\nend\n\n@blank\n\n@effect\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nif <(☁ BEST) > (SCORE)> then\n    set [☁ best v] to (SCORE)\nend\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\nend\n\nwhen flag clicked\nset [score v] to [0]\nrepeat (50)\n    turn right (0) degrees\nend\nforever\n    wait (1) seconds\n    change [score v] by (1)\nend\n\n@Player\n\ndefine Go (direction) (speed)\nif <(ded) = [0]> then\n    change x by (speed)\n    set [sthoppp v] to [0]\n    set [slope v] to [0]\n    repeat until <<(slope) = [8]> or <<not <touching (platformer v)?>> and <not <touching (bricks v)?>>>>\n        change y by (1)\n        change [slope v] by (1)\n        set [touched? v] to [1]\n    end\n    if <(slope) = [8]> then\n        change x by ((0) - (speed))\n        change y by ((0) - (slope))\n        if <(sthoppp) = [1]> then\n            change x by ((scroll xvel) * (-1))\n        end\n    end\n    if <(ded) = [0]> then\n        if <(x position) < [0]> then\n            if <[15] > (scroll x)> then\n                set [sthoppp v] to [1]\n                if <not <(slope) = [8]>> then\n                    if <key (down arrow v) pressed?> then\n                        change [scroll xvel v] by (0.5)\n                    else\n                        change [scroll xvel v] by (1)\n                    end\n                end\n            end\n        end\n        if <[0] < (x position)> then\n            if <(scroll x) > [-7560]> then\n                set [sthoppp v] to [1]\n                if <not <(slope) = [8]>> then\n                    if <key (down arrow v) pressed?> then\n                        change [scroll xvel v] by (-0.5)\n                    else\n                        change [scroll xvel v] by (-1)\n                    end\n                end\n            end\n        end\n    end\n    if <(slope) = [8]> then\n        set [scroll xvel v] to [0]\n    end\nend\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [play v]\nset [brightness v] effect to (100)\ngo to x: (0) y: (0)\nset [yvel v] to [0]\nshow\nset [xvel v] to [0]\nforever\n    change [yvel v] by (-0.8)\n    change y by (yvel)\n    set [touched? v] to [0]\n    touch ground <(yvel) > [0]>\nend\n\nwhen I receive [play v]\nforever\n    set [scroll yvel v] to ((scroll yvel) * (0.8))\n    change y by (scroll yvel)\n    change [scroll y v] by (scroll yvel)\n    if <<key (up arrow v) pressed?> and <(is it falling?) < [3]>> then\n        set [yvel v] to [12]\n    end\n    if <(scrolling mode?) = [1]> then\n        if <[70] < (y position)> then\n            change [scroll yvel v] by (-3)\n        end\n        if <(y position) < [-70]> then\n            change [scroll yvel v] by (5)\n        end\n        if <<(scroll y) > [50]> and <(y position) < [-70]>> then\n            set [scroll yvel v] to [0]\n        end\n    end\n    if <touching (flag v)?> then\n        stop [other scripts in sprite v]\n        broadcast (next v)\n        broadcast (play v)\n        start sound [select v]\n        hide\n        go to x: (0) y: (0)\n    end\nend\n\nwhen I receive [play v]\nforever\n    set rotation style [left-right v]\n    set [xvel v] to [0]\n    set [ded v] to [0]\n    if <(ded) = [0]> then\n        if <not <<key (left arrow v) pressed?> and <key (right arrow v) pressed?>>> then\n            if <key (right arrow v) pressed?> then\n                if <key (down arrow v) pressed?> then\n                    Go [90] [3]\n                else\n                    Go [90] [6]\n                end\n                set [xvel v] to [6]\n                point in direction (90)\n            end\n            if <key (left arrow v) pressed?> then\n                if <key (down arrow v) pressed?> then\n                    Go [90] [-3]\n                else\n                    Go [90] [-6]\n                end\n                set [xvel v] to [-6]\n                point in direction (-90)\n            end\n        end\n    end\n    if <<touching (platformer v)?> or <touching (bricks v)?>> then\n        set [xvel v] to ((xvel) * (-1))\n        change x by (xvel)\n        if <key (up arrow v) pressed?> then\n            set [yvel v] to [14]\n        end\n        set [touched? v] to [1]\n    end\nend\n\ndefine touch ground <up?>\nchange [is it falling? v] by (1)\nrepeat until <<not <touching (platformer v)?>> and <not <touching (bricks v)?>>>\n    if <up?> then\n        change y by (-5)\n        set [touched? v] to [1]\n    else\n        change y by (1)\n        set [is it falling? v] to [0]\n        set [touched? v] to [1]\n    end\n    set [yvel v] to [0]\n    set [touched? v] to [1]\nend\n\nwhen I receive [play v]\ngo to x: (item (1) of [save x v]) y: (item (1) of [save y v])\nforever\n    change [scroll x v] by (scroll xvel)\n    change [e v] by (scroll xvel)\n    change [ee v] by (scroll xvel)\nend\n\nwhen I receive [play v]\nset [die? v] to [0]\nset [scroll x v] to (item (1) of [save scroll x v])\nset [scroll y v] to (item (1) of [save scroll y v])\nforever\n    if <[-204] > (y position)> then\n        start sound [Crunch v]\n        die\n    end\n    if <touching (obstacle v)?> then\n        start sound [Crunch v]\n        die\n    end\n    if <touching (lava v)?> then\n        start sound [Crunch v]\n        die\n    end\n    if <touching (fireball v)?> then\n        start sound [Crunch v]\n        die\n    end\n    if <touching (obstacle2 v)?> then\n        start sound [Crunch v]\n        die\n    end\n    if <touching (end flag v)?> then\n        start sound [Win v]\n        broadcast (end v)\n        wait (1) seconds\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\nwhen I receive [play v]\nset [brightness v] effect to (100)\ngo to x: (item (1) of [save x v]) y: (item (1) of [save y v])\nshow\nset [xvel v] to [0]\nset [yvel v] to [0]\nset size to (110) %\nrepeat (10)\n    change [brightness v] effect by (-10)\n    change size by (-1)\nend\nset [brightness v] effect to (10)\n\nwhen I receive [play v]\nset size to (110) %\nset [brightness v] effect to (100)\n\nwhen I receive [clicc v]\nbroadcast (play v)\n\nwhen I receive [play v]\nforever\n    if <<[1] > (yvel)> and <(yvel) > [-1]>> then\n        if <(touched?) = [1]> then\n            set volume to (100) %\n            start sound [ hit v]\n            wait until <not <<[1] > (yvel)> and <(yvel) > [-1]>>>\n        end\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <<key (up arrow v) pressed?> and <(is it falling?) < [3]>> then\n        set volume to (100) %\n        start sound [ hit v]\n        wait until <not <<key (up arrow v) pressed?> and <(is it falling?) < [3]>>>\n    end\nend\n\nwhen flag clicked\ndelete all of [save scroll x v]\ndelete all of [save x v]\ndelete all of [save y v]\ndelete all of [save scroll y v]\ninsert [0] at (1) of [save scroll x v] \ninsert [0] at (1) of [save x v] \ninsert [0] at (1) of [save y v] \ninsert [0] at (1) of [save scroll y v] \n\nwhen I receive [play v]\nforever\n    set [scroll xvel v] to ((scroll xvel) * (0.857))\n    set [nani v] to <(yvel) > [0.1]>\nend\n\nwhen flag clicked\nset [score v] to [0]\n\nwhen I receive [next v]\nset [scrolling mode? v] to [0]\n\nwhen flag clicked\nset [scrolling mode? v] to [1]\n\nwhen I receive [next v]\ndelete all of [save scroll x v]\ndelete all of [save x v]\ndelete all of [save y v]\ndelete all of [save scroll y v]\ninsert [0] at (1) of [save scroll x v] \ninsert [0] at (1) of [save x v] \ninsert [0] at (1) of [save y v] \ninsert [0] at (1) of [save scroll y v] \n\nwhen I receive [oof v]\nset volume to (0) %\n\ndefine die\nhide\nset [brightness v] effect to (100)\nbroadcast (particles v)\nrepeat (10)\n    set [scroll xvel v] to [0]\n    set [scroll yvel v] to [0]\n    set [ded v] to [1]\nend\nset [ded v] to [1]\nset [scroll xvel v] to (((item (1) of [save scroll x v]) - (scroll x)) / (5))\nset [scroll yvel v] to (((item (1) of [save scroll y v]) - (scroll y)) / (5))\nrepeat (35)\n    set [scroll xvel v] to (((item (1) of [save scroll x v]) - (scroll x)) / (5))\n    set [scroll yvel v] to (((item (1) of [save scroll y v]) - (scroll y)) / (5))\n    set [ded v] to [1]\nend\nbroadcast (restart v)\n\nwhen flag clicked\nset [ghost v] effect to (0)\n\nwhen I receive [play v]\nforever\n    set [scrolling mode? v] to [1]\n    if <touching (checkpoints v)?> then\n        insert (scroll x) at (1) of [save scroll x v] \n        insert [0] at (1) of [save x v] \n        insert ((y position) + (50)) at (1) of [save y v] \n        insert (scroll y) at (1) of [save scroll y v] \n    end\nend\n\nwhen flag clicked\nrepeat (50)\n    turn right (0) degrees\nend\nbroadcast (play v)\n\nwhen I receive [play v]\nforever\n    change x by (scroll xvel)\n    if <key (right arrow v) pressed?> then\n        switch costume to (right v)\n    end\n    if <key (left arrow v) pressed?> then\n        switch costume to (right v)\n    end\n    if <<not <key (left arrow v) pressed?>> and <not <key (right arrow v) pressed?>>> then\n        switch costume to (huh v)\n    end\n    if <key (down arrow v) pressed?> then\n        switch costume to (huh2 v)\n    end\nend\n\nwhen I receive [particles v]\nswitch costume to (particles v)\nfaster particle effect\n\nwhen I start as a clone\nset [brightness v] effect to (10)\nswitch costume to (particles v)\nset size to (100) %\nshow\nset rotation style [don't rotate v]\nset [ghost v] effect to (0)\nrepeat (pick random (1) to (5))\n    move (10) steps\nend\nrepeat (pick random (1) to (5))\n    move (8) steps\nend\nrepeat (pick random (1) to (5))\n    move (5) steps\nend\nrepeat (pick random (1) to (5))\n    move (3) steps\nend\nrepeat (pick random (1) to (5))\n    move (2) steps\nend\nrepeat (pick random (1) to (5))\n    move (1) steps\nend\ndelete this clone\n\nwhen I start as a clone\nrepeat (20)\n    change [ghost v] effect by (8)\n    change size by (-3)\nend\n\nwhen I start as a clone\nforever\n    change y by (scroll yvel)\n    change x by (scroll xvel)\nend\n\nwhen I receive [restart v]\nbroadcast (play v)\n\ndefine faster particle effect\nrepeat (20)\n    point in direction (pick random (180) to (-180))\n    create clone of (_myself_ v)\nend\n\nwhen I receive [play v]\nforever\n    if <<(scroll x) > [15]> and <(x position) < [0]>> then\n        set [scroll xvel v] to [0]\n    end\n    if <<[-7560] > (scroll x)> and <[0] < (x position)>> then\n        set [scroll xvel v] to [0]\n    end\nend\n\n@Platformer\n\nwhen I receive [play v]\nbroadcast (clear v)\nhide\nwait (0) seconds\ncreate [17] platformer\n\ndefine create (#) platformer\nswitch costume to (costume1 v)\nrepeat (#)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I start as a clone\nforever\n    go to x: ((((costume [number v]) - (1)) * (480)) + (scroll x)) y: (scroll y)\n    if <<[582] > (x position)> and <(x position) > [-582]>> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [clear v]\ndelete this clone\n\n@light\n\nwhen I receive [play v]\nforever\n    go to [back v] layer\n    go to (player v)\n    if <(ded) = [0]> then\n        show\n    else\n        hide\n    end\n    set size to ((([cos v] of ((tick) * (8)) ) * (10)) + (75)) %\nend\n\nwhen I receive [play v]\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-1)\nend\nset [ghost v] effect to (90)\n\nwhen flag clicked\nset [tick v] to [0]\nforever\n    change [tick v] by (1)\nend\n\n@Background\n\nwhen I receive [play v]\nforever\n    go to [back v] layer\n    go to x: ((((scroll x) / (5)) mod (480)) + (-480)) y: (0)\n    set [brightness v] effect to (-15)\nend\n\n@obstacle\n\nwhen I receive [play v]\nhide\nwait (0) seconds\ncreate [10] obstacles\n\nwhen I receive [clear v]\ndelete this clone\n\nwhen I start as a clone\ngo to [back v] layer\ngo [forward v] (4) layers\nforever\n    if <<[582] > (x position)> and <(x position) > [-582]>> then\n        show\n    else\n        hide\n    end\n    if <(costume [number v]) = [1]> then\n        go to x: ((545) + (scroll x)) y: ((100) + (scroll y))\n        turn left (3) degrees\n    end\n    if <(costume [number v]) = [2]> then\n        go to x: ((1100) + (scroll x)) y: ((80) + (scroll y))\n        turn left (2) degrees\n    end\n    if <(costume [number v]) = [3]> then\n        go to x: ((1300) + (scroll x)) y: ((80) + (scroll y))\n        turn left (2) degrees\n    end\n    if <(costume [number v]) = [4]> then\n        go to x: ((3191) + (scroll x)) y: ((-50) + (scroll y))\n        turn left (2) degrees\n    end\n    if <(costume [number v]) = [5]> then\n        go to x: ((3327) + (scroll x)) y: ((-50) + (scroll y))\n        turn left (2) degrees\n    end\n    if <(costume [number v]) = [6]> then\n        go to x: ((3464) + (scroll x)) y: ((-50) + (scroll y))\n        turn left (2) degrees\n    end\n    if <(costume [number v]) = [7]> then\n        go to x: (((5935) + (scroll x)) + (([cos v] of ((tick) * (2)) ) * (150))) y: ((20) + (scroll y))\n        turn left (2) degrees\n    end\n    if <(costume [number v]) = [8]> then\n        go to x: ((6330) + (scroll x)) y: ((0) + (scroll y))\n        turn left (2) degrees\n    end\n    if <(costume [number v]) = [9]> then\n        go to x: ((6600) + (scroll x)) y: ((-15) + (scroll y))\n        turn left (2) degrees\n    end\n    if <(costume [number v]) = [10]> then\n        go to x: ((7100) + (scroll x)) y: ((7) + (scroll y))\n        turn left (2) degrees\n    end\nend\n\ndefine create (#) obstacles\nswitch costume to (costume1 v)\nrepeat (#)\n    create clone of (_myself_ v)\n    next costume\nend\n\n@lava\n\nwhen flag clicked\nshow\nset [ghost v] effect to (10)\nforever\n    go to x: ((([cos v] of (((tick) / (20)) * (20)) ) * (150)) + (-150)) y: (((([cos v] of (((tick) / (5)) * (8)) ) * (20)) + (-50)) + (scroll y))\nend\n\n@Checkpoints\n\nwhen I receive [clear v]\ndelete this clone\n\nwhen I receive [play v]\nhide\nwait (0) seconds\ncreate [7] obstacles\n\ndefine create (#) obstacles\npoint in direction (0)\nrepeat (#)\n    turn right (1) degrees\n    switch costume to (costume1 v)\n    create clone of (_myself_ v)\n    switch costume to (costume2 v)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [back v] layer\ngo [forward v] (4) layers\nforever\n    set rotation style [don't rotate v]\n    if <<[582] > (x position)> and <(x position) > [-582]>> then\n        show\n    else\n        hide\n    end\n    if <touching (player v)?> then\n        set [active checkpoint id? v] to (direction)\n    end\n    if <<(costume [number v]) = [2]> or <(costume [number v]) = [3]>> then\n        if <(active checkpoint ID?) = (direction)> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume3 v)\n        end\n    end\n    if <(direction) = [1]> then\n        go to x: ((870) + (scroll x)) y: ((5) + (scroll y))\n    end\n    if <(direction) = [2]> then\n        go to x: ((1500) + (scroll x)) y: ((5) + (scroll y))\n    end\n    if <(direction) = [3]> then\n        go to x: ((2304) + (scroll x)) y: ((-2) + (scroll y))\n    end\n    if <(direction) = [4]> then\n        go to x: ((3006) + (scroll x)) y: ((-2) + (scroll y))\n    end\n    if <(direction) = [5]> then\n        go to x: ((4292) + (scroll x)) y: ((4) + (scroll y))\n    end\n    if <(direction) = [6]> then\n        go to x: ((5567) + (scroll x)) y: ((-55) + (scroll y))\n    end\n    if <(direction) = [7]> then\n        go to x: ((6793) + (scroll x)) y: ((-57) + (scroll y))\n    end\nend\n\nwhen flag clicked\nset [active checkpoint id? v] to [0]\n\n@fireball\n\nwhen I receive [play v]\nhide\nwait (0) seconds\ncreate [9] obstacles\n\nwhen I receive [clear v]\ndelete this clone\n\nwhen I start as a clone\ngo to [back v] layer\ngo [forward v] (4) layers\nforever\n    set rotation style [don't rotate v]\n    if <<[582] > (x position)> and <(x position) > [-582]>> then\n        show\n    else\n        hide\n    end\n    if <(direction) = [1]> then\n        set to [1880] [-60] and this [0]\n    end\n    if <(direction) = [2]> then\n        set to [1830] [-60] and this [90]\n    end\n    if <(direction) = [3]> then\n        set to [1780] [-60] and this [180]\n    end\n    if <(direction) = [4]> then\n        set to [2430] [-60] and this [180]\n    end\n    if <(direction) = [5]> then\n        set to [2585] [-60] and this [90]\n    end\n    if <(direction) = [6]> then\n        set to [2740] [-60] and this [0]\n    end\n    if <(direction) = [7]> then\n        set to [5218] [-200] and this [180]\n    end\n    if <(direction) = [8]> then\n        set to [5355] [-200] and this [90]\n    end\n    if <(direction) = [9]> then\n        set to [5495] [-200] and this [0]\n    end\nend\n\ndefine create (#) obstacles\nswitch costume to (costume1 v)\npoint in direction (0)\nrepeat (#)\n    turn right (1) degrees\n    create clone of (_myself_ v)\nend\n\ndefine set to (x) (y) and this (tick variable)\ngo to x: ((x) + (scroll x)) y: (((y) + (scroll y)) + (([cos v] of (((tick) * (4)) + (tick variable)) ) * (200)))\nif < (([cos v] of (((tick) * (4)) + ((tick variable) + (90))) ) * (200)) contains [-]?> then\n    switch costume to (costume2 v)\nelse\n    switch costume to (costume1 v)\nend\n\n@obstacle2\n\nwhen I receive [play v]\nhide\nwait (0) seconds\ncreate [5] obstacles\n\nwhen I receive [clear v]\ndelete this clone\n\nwhen I start as a clone\ngo to [back v] layer\ngo [forward v] (2) layers\nforever\n    if <<[582] > (x position)> and <(x position) > [-582]>> then\n        show\n    else\n        hide\n    end\n    if <(costume [number v]) = [1]> then\n        go to x: ((2082) + (scroll x)) y: ((240) + (scroll y))\n        point in direction ((([cos v] of ((tick) * (3)) ) * (50)) + (90))\n    end\n    if <(costume [number v]) = [2]> then\n        go to x: ((4600) + (scroll x)) y: ((176) + (scroll y))\n        point in direction ((([cos v] of ((tick) * (3)) ) * (50)) + (90))\n    end\n    if <(costume [number v]) = [3]> then\n        go to x: ((4750) + (scroll x)) y: ((176) + (scroll y))\n        point in direction ((([cos v] of ((tick) * (3)) ) * (50)) + (90))\n    end\n    if <(costume [number v]) = [4]> then\n        go to x: ((4900) + (scroll x)) y: ((176) + (scroll y))\n        point in direction ((([cos v] of ((tick) * (3)) ) * (50)) + (90))\n    end\n    if <(costume [number v]) = [5]> then\n        go to x: ((7350) + (scroll x)) y: ((92) + (scroll y))\n        point in direction ((([cos v] of ((tick) * (3)) ) * (50)) + (90))\n    end\nend\n\ndefine create (#) obstacles\nswitch costume to (costume1 v)\nrepeat (#)\n    create clone of (_myself_ v)\n    next costume\nend\n\n@Graphics\n\nwhen I receive [play v]\nbroadcast (clear v)\nhide\nwait (0) seconds\ncreate [17] platformer\n\ndefine create (#) platformer\nswitch costume to (costume1 v)\nrepeat (#)\n    create clone of (_myself_ v)\n    next costume\nend\n\nwhen I start as a clone\nforever\n    go to x: ((((costume [number v]) - (1)) * (480)) + (scroll x)) y: (scroll y)\n    go to [back v] layer\n    go [forward v] (1) layers\n    if <<[582] > (x position)> and <(x position) > [-582]>> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [clear v]\ndelete this clone\n\n@END FLAG\n\nwhen I receive [clear v]\ndelete this clone\n\nwhen I receive [play v]\nhide\nwait (0) seconds\ncreate [1] obstacles\n\ndefine create (#) obstacles\npoint in direction (0)\nrepeat (#)\n    turn right (1) degrees\n    switch costume to (costume1 v)\n    create clone of (_myself_ v)\n    switch costume to (costume2 v)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [back v] layer\ngo [forward v] (4) layers\nforever\n    set rotation style [don't rotate v]\n    if <<[582] > (x position)> and <(x position) > [-582]>> then\n        show\n    else\n        hide\n    end\n    if <touching (player v)?> then\n        set [active checkpoint id? v] to (direction)\n    end\n    if <<(costume [number v]) = [2]> or <(costume [number v]) = [3]>> then\n        if <(active checkpoint ID?) = (direction)> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume3 v)\n        end\n    end\n    if <(direction) = [1]> then\n        go to x: ((7750) + (scroll x)) y: ((-27) + (scroll y))\n    end\nend\n\nwhen flag clicked\nset [active checkpoint id? v] to [0]\n\n@the endd\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\ngo to x: (-464) y: (0)\nshow\nrepeat (50)\n    change x by (((0) - (x position)) / (5))\nend\n\n@Visuals\n\ndefine Write (text)\nset [scroll y v] to [1]\nrepeat (length of (text))\n    switch costume to (letter (scroll y) of (text))\n    create clone of (_myself_ v)\n    change [scroll y v] by (1)\n    change x by (12)\n    if <(x position) > [219]> then\n        change y by (-20)\n        set x to (-220)\n    end\nend\nhide\n\nwhen I start as a clone\nset size to (50) %\nshow\nwait (0) seconds\ndelete this clone\n\nwhen I receive [end v]\nshow\nforever\n    set size to (100) %\n    go to x: (([x position v] of [the endd v]) - (30)) y: (34)\n    set [brightness v] effect to (0)\n    Write (SCORE)\n    go to x: (([x position v] of [the endd v]) - (41)) y: (-5)\n    set [brightness v] effect to (0)\n    Write (☁ BEST)\nend\n\n@hmm\n\nwhen flag clicked\nhide\nforever\n    go to x: (pick random (-600) to (600)) y: (pick random (250) to (-130))\n    create clone of (_myself_ v)\n    wait (0.2) seconds\nend\n\nwhen I start as a clone\nshow\nforever\n    change x by ((size) / (50))\n    change y by (((size) / (45)) * (-1))\n    change x by ((scroll xvel) * (2))\n    change y by ((scroll yvel) * (2))\nend\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nset size to (pick random (100) to (250)) %\nrepeat (50)\n    change size by (-1)\n    change [ghost v] effect by (-0.1)\nend\nrepeat (50)\n    change size by (-1)\n    change [ghost v] effect by (0.1)\nend\ndelete this clone\n\n@tn\n\nwhen flag clicked\nshow\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\nrepeat (50)\n    turn right (0) degrees\nend\nrepeat (50)\n    change x by (((480) - (x position)) / (5))\n    change [ghost v] effect by (5)\nend\nforever\n    go to x: (0) y: (0)\n    show\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\n