Cloud Platformer Chase V.2
@Stage\n\nwhen I receive [start game v]\nswitch backdrop to (backdrop1 v)\nforever\n    play sound [Dark Mysterious Music - Entering The Light v] until done\nend\n\nwhen flag clicked\nset [level v] to [1]\nswitch backdrop to (backdrop2 v)\n\nwhen flag clicked\nset volume to (100) %\nforever\n    if <(level) = [7]> then\n        repeat (10)\n            change volume by (-10)\n        end\n        stop all sounds\n    end\nend\n\n@Player\n\nbroadcast (nextlevel v)\nwait (1) seconds\ngo to x: (-219) y: (2)\nset [speedx v] to [0]\nset [speedy v] to [0]\n\nwhen I receive [start game v]\nset size to (100) %\nshow\ngo to x: (-219) y: (-70)\nforever\n    change [speedy v] by (-0.5)\n    if <<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>>> then\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> then\n            change [speedx v] by (1)\n            switch costume to (right v)\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n            change [speedx v] by (-1)\n            switch costume to (left v)\n        end\n    else\n        switch costume to (normal v)\n    end\n    set [speedx v] to ((speedX) * (0.9))\n    change x by (speedX)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change y by (1)\n                            if <touching (level v)?> then\n                                change y by (-6)\n                                change x by ((speedX) * (-1))\n                                if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> then\n                                    set [speedy v] to [8]\n                                    if <(speedX) > [0]> then\n                                        set [speedx v] to [-8]\n                                    else\n                                        set [speedx v] to [8]\n                                    end\n                                else\n                                    set [speedx v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (SpeedY)\n    if <touching (level v)?> then\n        change y by ((SpeedY) * (-1))\n        set [speedy v] to [0]\n    end\n    change y by (-0.5)\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> and <touching (level v)?>> then\n        set [speedy v] to [8]\n    end\n    change y by (0.5)\n    if <(x position) = [243]> then\n        broadcast (nextlevel v)\n        wait (1) seconds\n        go to x: (-219) y: (-70)\n        set [speedx v] to [0]\n        set [speedy v] to [0]\n    end\n    if <(level) = [7]> then\n        set [delete the fog v] to [1]\n        go to x: (-210) y: (-100)\n        switch costume to (right v)\n        glide (3) secs to x: (-102) y: (-98)\n        broadcast (cutscene 2 v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nhide\n\n@level\n\nwhen I receive [nextlevel v]\nwait (0.3) seconds\nnext costume\n\nwhen I receive [start game v]\nshow\nset [delete the smoke v] to [0]\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nshow\nforever\n    set [level v] to (costume [number v])\n    if <<(level) = [5]> or <(level) = [3]>> then\n        set [delete the smoke v] to [0]\n    else\n        set [delete the smoke v] to [1]\n    end\nend\n\nwhen flag clicked\nhide\n\n@Grass\n\nwhen I receive [nextlevel v]\nwait (0.3) seconds\nnext costume\n\nwhen I receive [start game v]\nshow\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nshow\n\nwhen flag clicked\nhide\n\n@Fog Overlay\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen flag clicked\nhide\n\n@Fog thingies\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (pick random (1) to (4))\ngo to x: (-4000) y: (0)\nshow\nrepeat (850)\n    change x by (1)\nend\ndelete this clone\n\nwhen I receive [start game v]\nset [delete the fog v] to [0]\nhide\nforever\n    create clone of (_myself_ v)\n    wait (pick random (20) to (25)) seconds\nend\n\nwhen I start as a clone\nforever\n    if <(delete the fog) = [1]> then\n        delete this clone\n    end\nend\n\n@Decor\n\nwhen flag clicked\nhide\n\nwhen I receive [nextlevel v]\nwait (0.3) seconds\nnext costume\n\nwhen I receive [start game v]\nshow\nswitch costume to (1 v)\ngo to x: (0) y: (0)\ngo to [back v] layer\nshow\n\n@rain\n\nwhen I start as a clone\ngo [forward v] (5) layers\nshow\nswitch costume to (costume1 v)\nchange [ghost v] effect by (pick random (0) to (20))\nset [speed v] to (pick random (-12) to (-15))\nif <(speed) > [4]> then\n    set size to (pick random (110) to (130)) %\nend\ngo to x: (pick random (224) to (-224)) y: (167)\nrepeat until <<touching (level v)?> or <touching (_edge_ v)?>>\n    change y by (speed)\nend\nrepeat (3)\n    next costume\n    wait (0.001) seconds\nend\ndelete this clone\n\nwhen I receive [start game v]\nset [stop rain sounds v] to [0]\nforever\n    play sound [Rain Sound Effect Short \(2 minutes\) ♪ v] until done\n    if <(stop rain sounds) = [1]> then\n        stop [this script v]\n    end\nend\n\nwhen I receive [start game v]\nset volume to (100) %\nhide\nclear graphic effects\nforever\n    wait (pick random (0) to (0.001)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I receive [cutscene 2 v]\nset [stop rain sounds v] to [1]\n\n@black screen\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\ngo to [front v] layer\n\nwhen I receive [nextlevel v]\ngo to [front v] layer\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (0.3) seconds\nSmooth Glide x: (455) y: (0) speed: (3)\nwait (0.01) seconds\nhide\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\ndefine Smooth Glide x: (x) y: (y) speed: (speed)\nrepeat until <<(round (x position)) = (round (x))> and <(round (y position)) = (round (y))>>\n    change x by (((round (x)) - (round (x position))) / (speed))\n    change y by (((round (y)) - (round (y position))) / (speed))\nend\ngo to x: (x) y: (y)\n\n@Truck\n\nwhen flag clicked\nhide\n\n@Smoke for truck\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nforever\n    if <(level) = [5]> then\n        go to x: (194) y: (86)\n        create clone of (_myself_ v)\n        wait (pick random (0) to (0.1)) seconds\n    end\n    if <(level) = [3]> then\n        go to x: (156) y: (-14)\n        create clone of (_myself_ v)\n        wait (pick random (0) to (0.1)) seconds\n    end\nend\n\nwhen I start as a clone\nshow\nset [speed v] to (pick random (1) to (2.5))\npoint in direction (pick random (-20) to (20))\nrepeat until <touching (_edge_ v)?>\n    move (speed) steps\nend\nrepeat (15)\n    move (speed) steps\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(delete the smoke) = [1]> then\n        delete this clone\n    end\nend\n\n@beginning cutscene\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I start as a clone\nforever\n    if <(delete this clone cutscene beginning) = [1]> then\n        delete this clone\n    end\nend\n\nwhen flag clicked\nrepeat until <(click) = [1]>\n    if <key (space v) pressed?> then\n        set [delete this clone cutscene beginning v] to [1]\n    end\nend\n\nwhen flag clicked\nwait until <(delete this clone cutscene beginning) = [1]>\nswitch costume to (costume11 v)\nshow\ngo to [front v] layer\nset [ghost v] effect to (100)\nrepeat (10)\n    change volume by (-10)\n    change [ghost v] effect by (-10)\nend\nstop all sounds\nbroadcast (Start Game v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\ngo to [front v] layer\nset [click v] to [0]\nset [delete this clone cutscene beginning v] to [0]\nset volume to (100) %\nclear graphic effects\nstart sound [moosic v]\nhide\ncreate clone of (_myself_ v)\nswitch costume to (costume1 v)\ncreate clone of (_myself_ v)\nwait (5) seconds\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nwait (5) seconds\nswitch costume to (costume3 v)\ncreate clone of (_myself_ v)\nwait (5) seconds\nswitch costume to (costume4 v)\ncreate clone of (_myself_ v)\nwait (1.5) seconds\nswitch costume to (costume5 v)\ncreate clone of (_myself_ v)\nwait (1.5) seconds\nswitch costume to (costume6 v)\ncreate clone of (_myself_ v)\nwait (3) seconds\nswitch costume to (costume7 v)\ncreate clone of (_myself_ v)\nwait (1.5) seconds\nswitch costume to (costume8 v)\ncreate clone of (_myself_ v)\nwait (1.5) seconds\nswitch costume to (costume9 v)\ncreate clone of (_myself_ v)\nwait (2) seconds\nswitch costume to (costume10 v)\ncreate clone of (_myself_ v)\nwait (3) seconds\nset [click v] to [1]\nset [delete this clone cutscene beginning v] to [1]\n\n@Text\n\nwhen flag clicked\nhide\n\nwhen I receive [nextlevel v]\nwait (0.3) seconds\nset [ghost v] effect to (100)\nnext costume\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\n\nwhen I receive [start game v]\nshow\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\n\n@Space to skip\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nwait (2) seconds\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait until <(delete this clone cutscene beginning) = [1]>\nhide\n\n@Smoke for truck 2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nforever\n    if <(level) = [5]> then\n        go to x: (40) y: (-17)\n        create clone of (_myself_ v)\n        wait (pick random (0) to (0.1)) seconds\n    end\nend\n\nwhen I start as a clone\nshow\nset [speed v] to (pick random (1) to (2.5))\npoint in direction (pick random (-20) to (20))\nrepeat until <touching (_edge_ v)?>\n    move (speed) steps\nend\nrepeat (15)\n    move (speed) steps\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(delete the smoke) = [1]> then\n        delete this clone\n    end\nend\n\n@Demon\n\nwhen flag clicked\nset [level v] to [0]\nhide\nforever\n    if <(level) = [6]> then\n        switch costume to (costume1 v)\n        go to x: (-37) y: (-19)\n        show\n        wait (1) seconds\n        repeat until <touching (_edge_ v)?>\n            move (10) steps\n        end\n        repeat (4)\n            move (10) steps\n        end\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [7]> then\n        show\n        switch costume to (costume2 v)\n        go to x: (-37) y: (-19)\n        wait (10) seconds\n        hide\n        stop [this script v]\n    end\nend\n\n@love and fav\n\nwhen flag clicked\nhide\n\nwhen I receive [cutscene 2 v]\nset volume to (100) %\ngo to [front v] layer\nwait (1) seconds\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (100)\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n