Sonic Vortex #Games #Platformer #All #Mobile

Instructions: Finally finished my best sonic project ever!\n\nWE ARE PAST 100 STARS AND HEARTS OMG THIS GAME GOT SO POPULAR IN 4 DAYS!!! THANK YOU ALL! THIS GAME EVEN WAS #1 ON SONIC TRENDING!\n\nThis is my first ever game with @griffpatch's platformer engine! shout outs to @NightCat28 for the modified engine which i updated to fit my needs\nNow with 40+ hours of work!\n\n IMPORTANT: press T to show/hide your saved data code \nto restore saved data put in your code in load game \n\nControls\n\n-for PC mode use the arrows to toggle between options and space to select it\nfor Mobile mode, tap to select the option you want and tap again to select it\n\n-PC Mode (preferred mode): 3 way past cool levels (from easy to Hard difficulty) and 2 insanely hard levels\nleft/right arrows to move and the space bar to jump OR \n use A and D keys to move and W to jump \nT to show/hide the code\n\n-Mobile mode (decent but pc mode recommended): 3 Way past cool levels (from easy to Hard difficulty) \n\nhold in the left/right direction to move left/right and hold in the up direction to jump. It's better to swipe Up to jump though\n\nwhile mobile mode is an option, its probably the hardest way to play this game \n

@Stage\n\nwhen backdrop switches to [title v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [EchoNotGecko - Can You Feel The Sunshine v] until done\nend\n\nwhen flag clicked\nhide variable [hanging on tails v]\nhide variable [can you hurt him? v]\nhide variable [left collision v]\nhide variable [right collision v]\nhide variable [shadow attack v]\nhide variable [which attack v]\nhide variable [boss health v]\nhide variable [zone 2 set v]\nhide variable [zone 3 set v]\nhide variable [zone 4 set v]\nhide variable [zone 5 set v]\nhide variable [lvl v]\nhide variable [top collision v]\nhide variable [level select v]\nhide variable [spin attack v]\nhide variable [how many levels unlocked? v]\nhide variable [mode clicked v]\nhide variable [touching ground v]\nhide variable [pc mode on? v]\nhide variable [level complete v]\nhide variable [first time playing? v]\nhide variable [zone5 alr v]\nhide variable [zone1 alr v]\nhide variable [zone2 alr v]\nhide variable [background scrollx v]\nhide variable [zone4 alr v]\nhide variable [zone3 alr v]\nhide variable [stop moving v]\nhide variable [mobile mode on? v]\nswitch backdrop to (begin cutscene v)\n\nwhen backdrop switches to [mode select v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [EchoNotGecko - Mania Save Select v] until done\nend\n\nwhen backdrop switches to [beginning of game cutscene v]\nstop [other scripts in sprite v]\nset volume to (100) %\nstop all sounds\nforever\n    play sound [07 - Hard Boiled Heavies Mischief Theme \(Cutscene\) v] until done\nend\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    if <(first time playing?) = [yes]> then\n        stop [this script v]\n    end\n    if <(first time playing?) = [no]> then\n        play sound [Double Take v] until done\n    end\nend\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nset volume to (100) %\nstop all sounds\nwait (5) seconds\nif <(LEVEL) = [GHZ]> then\n    switch backdrop to (green hills v)\nend\nif <(LEVEL) = [GHZ2]> then\n    switch backdrop to (green hills2 v)\nend\nif <(LEVEL) = [GHZ3]> then\n    switch backdrop to (green hillsboss v)\nend\n\nwhen backdrop switches to [green hills v]\nstop [other scripts in sprite v]\nset volume to (100) %\nstop all sounds\nforever\n    play sound [EchoNotGecko - door into summer fm v] until done\nend\n\nwhen I receive [victory v]\nset volume to (100) %\nstop all sounds\nstop [other scripts in sprite v]\nplay sound [46 - Act Clear.mp3 v] until done\n\nwhen I receive [game over v]\nset volume to (100) %\nstop [other scripts in sprite v]\nstop all sounds\n\nwhen backdrop switches to [green hills2 v]\nstop [other scripts in sprite v]\nstop all sounds\nset volume to (100) %\nforever\n    play sound [Tee Lopes - Door into Summer \(surpise song\).mp3 v] until done\nend\n\nwhen backdrop switches to [green hillsboss v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [Ruby Delusions Sonic Mania Remix.mp3 v] until done\nend\n\nwhen backdrop switches to [zone complete v]\nstop [other scripts in sprite v]\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nset volume to (100) %\nstop all sounds\nwait (5) seconds\nif <(LEVEL) = [LZ]> then\n    switch backdrop to (labyrinth v)\nend\nif <(LEVEL) = [LZ2]> then\n    switch backdrop to (labyrinth2 v)\nend\nif <(LEVEL) = [LZ3]> then\n    switch backdrop to (labyrinthboss v)\nend\n\nwhen backdrop switches to [labyrinth v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [labyrinth zone act 1 v] until done\nend\n\nwhen backdrop switches to [labyrinth2 v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [labyrinth zone act 2 v] until done\nend\n\nwhen backdrop switches to [labyrinthboss v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [Ruby Delusions Sonic Mania Remix.mp3 v] until done\nend\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nset volume to (100) %\nstop all sounds\nwait (5) seconds\nif <(LEVEL) = [SLZ]> then\n    switch backdrop to (starlight v)\nend\nif <(LEVEL) = [SLZ2]> then\n    switch backdrop to (starlight2 v)\nend\nif <(LEVEL) = [SLZ3]> then\n    switch backdrop to (starlight3 v)\nend\n\nwhen backdrop switches to [starlight v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [Starlight zone classic v] until done\nend\n\nwhen backdrop switches to [starlight2 v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [Starlight zone remix v] until done\nend\n\nwhen backdrop switches to [starlight3 v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [SHOWTIME!! With the Super Badnik v] until done\nend\n\nwhen backdrop switches to [death egg v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [Sonic Rocket music Gadget Base Act 2 \(Scrambled Egg Zone Act 2 mix\).mp3 v] until done\nend\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nset volume to (100) %\nstop all sounds\nwait (5) seconds\nif <(LEVEL) = [DEZ]> then\n    switch backdrop to (death egg v)\nend\nif <(LEVEL) = [DEZ2]> then\n    switch backdrop to (death eggboss v)\nend\n\nwhen backdrop switches to [death eggboss v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [SHOWTIME!! With the Super Badnik v] until done\nend\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nset volume to (100) %\nstop all sounds\nwait (5) seconds\nif <(LEVEL) = [GGZ]> then\n    switch backdrop to (gadget gauntlet v)\nend\nif <(LEVEL) = [GGZ2]> then\n    switch backdrop to (gadget gauntletboss v)\nend\n\nwhen backdrop switches to [gadget gauntlet v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [24 Tinkerbat Factory v] until done\nend\n\nwhen backdrop switches to [gadget gauntletboss v]\nstop [other scripts in sprite v]\nset volume to (100) %\nforever\n    play sound [Final Zone Boss - Sonic Generations Remix v] until done\nend\n\nwhen I receive [#1 victory v]\nset volume to (100) %\nstop all sounds\nstop [other scripts in sprite v]\nplay sound [Sonic 2 Ending \(Orchestrated\) v] until done\n\n@tilte\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [title v]\nhide\nswitch costume to (title v)\nset [ghost v] effect to (100)\nwait (1) seconds\ngo to x: (0) y: (0)\nshow\ngo [backward v] (100) layers\ngo [forward v] (1) layers\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    glide (1) secs to x: (0) y: (10)\n    glide (1) secs to x: (0) y: (-10)\nend\n\nwhen backdrop switches to [mode select v]\nstop [other scripts in sprite v]\nswitch costume to (mode select v)\ngo to x: (0) y: (135)\nshow\ngo [backward v] (100) layers\ngo [forward v] (1) layers\n\nwhen backdrop switches to [code v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nset [hide v] to [no]\nhide variable [hide v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\n\nif <not <(username) = [Blue_Jay3]>> then\n    stop [all v]\nend\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nswitch costume to (costume2 v)\nshow\ngo [forward v] (100) layers\ngo to x: (0) y: (-157)\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [beginning of game cutscene v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nhide\n\n@BG\n\nwhen flag clicked\nforever\n    set size to (100) %\nend\n\nwhen flag clicked\nset size to (100) %\ngo to x: (0) y: (0)\ngo [backward v] (99999) layers\nset [mobile mode on? v] to [no]\nset [pc mode on? v] to [no]\nhide\n\nwhen backdrop switches to [title v]\nset size to (100) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nset [color v] effect to (0)\ngo to [back v] layer\ngo [backward v] (99999) layers\nswitch costume to (vortex title v)\nshow\n\nwhen this sprite clicked\nif <(title screen?) = [yes]> then\n    if <(PC mode on?) = [no]> then\n        stop [other scripts in sprite v]\n        set [mobile mode on? v] to [yes]\n        set [pc mode on? v] to [no]\n        set [title screen? v] to [no]\n        broadcast (small text fader v)\n        wait (1) seconds\n        broadcast (screen transition V2 v) and wait\n    end\nend\n\nwhen backdrop switches to [mode select v]\nstop [other scripts in sprite v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nset size to (200) %\nset [color v] effect to (0)\ngo to [back v] layer\ngo [backward v] (99999) layers\nswitch costume to (costume1 v)\nshow\nforever\n    set size to (200) %\n    switch costume to (costume1 v)\n    wait (2) seconds\n    repeat (3)\n        next costume\n        wait (0.04) seconds\n    end\n    switch costume to (costume4 v)\n    wait (2) seconds\n    repeat (3)\n        switch costume to ((costume [number v]) - (1))\n        wait (0.04) seconds\n    end\nend\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\nif <(first time playing?) = [yes]> then\n    wait (0.1) seconds\n    switch backdrop to (beginning of game cutscene v)\nend\nif <(first time playing?) = [no]> then\n    forever\n        set size to (100) %\n        go to x: (0) y: (0)\n        set [ghost v] effect to (0)\n        set [color v] effect to (0)\n        go to [back v] layer\n        go [backward v] (99999) layers\n        switch costume to (vortex title v)\n        show\n    end\nend\n\nwhen backdrop switches to [beginning of game cutscene v]\nstop [other scripts in sprite v]\nset size to (100) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nset [color v] effect to (0)\ngo to [back v] layer\ngo [backward v] (99999) layers\nswitch costume to (world 1 v)\nshow\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hillsboss v]\nstop [other scripts in sprite v]\nset size to (100) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nset [color v] effect to (0)\ngo to [back v] layer\ngo [backward v] (99999) layers\nswitch costume to (world 1 v)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [ghost v] effect to (0)\n\nwhen backdrop switches to [zone complete v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth loading v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinthboss v]\nstop [other scripts in sprite v]\nset size to (100) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nset [color v] effect to (0)\ngo to [back v] layer\ngo [backward v] (99999) layers\nswitch costume to (labyrinth background v)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [ghost v] effect to (0)\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death eggboss v]\nstop [other scripts in sprite v]\nset size to (100) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nset [color v] effect to (0)\ngo to [back v] layer\ngo [backward v] (99999) layers\nswitch costume to (genesis 32x scd - sonic & knuckles - the doomsday zone\(1\) v)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [ghost v] effect to (0)\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntletboss v]\nstop [other scripts in sprite v]\nset size to (100) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nset [color v] effect to (64)\ngo to [back v] layer\ngo [backward v] (99999) layers\nswitch costume to (sky chase v)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nhide\n\nwhen I receive [#1 victory v]\nset size to (100) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nset [color v] effect to (64)\ngo to [back v] layer\ngo [backward v] (99999) layers\nswitch costume to (sky chase v)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [ghost v] effect to (0)\n\nwhen backdrop switches to [gadget gauntlet cutscene2 v]\nstop [other scripts in sprite v]\nhide\nwait (3) seconds\nset size to (190) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nset [color v] effect to (0)\ngo to [back v] layer\ngo [backward v] (99999) layers\nswitch costume to (tornado ending v)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (3) seconds\nswitch costume to (tornado ending2 v)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (3) seconds\nswitch costume to (tornado ending3 v)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (3) seconds\nswitch costume to (tornado ending4 v)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (3) seconds\nbroadcast (ending 3 v)\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [reset plats v]\nset size to (100) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nset [color v] effect to (0)\ngo to [back v] layer\ngo [backward v] (99999) layers\nshow\n\nwhen backdrop switches to [starlight3 v]\nstop [other scripts in sprite v]\nset size to (100) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nset [color v] effect to (0)\ngo to [back v] layer\ngo [backward v] (99999) layers\nswitch costume to (starlight the void v)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [ghost v] effect to (0)\n\nwhen backdrop switches to [gadget gauntlet cutscene3 v]\nstop [other scripts in sprite v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nset [color v] effect to (0)\ngo to [back v] layer\ngo [backward v] (99999) layers\nswitch costume to (background3 v)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [ghost v] effect to (0)\nforever\n    go to x: (0) y: (0)\n    glide (10) secs to x: (0) y: (400)\nend\n\nwhen I receive [#1 victory v]\nset size to (100) %\n\nwhen backdrop switches to [the end v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [code v]\nstop [other scripts in sprite v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nset size to (200) %\nset [color v] effect to (0)\ngo to [back v] layer\ngo [backward v] (99999) layers\nswitch costume to (costume1 v)\nshow\nforever\n    set size to (200) %\n    switch costume to (costume1 v)\n    wait (2) seconds\n    repeat (3)\n        next costume\n        wait (0.04) seconds\n    end\n    switch costume to (costume4 v)\n    wait (2) seconds\n    repeat (3)\n        switch costume to ((costume [number v]) - (1))\n        wait (0.04) seconds\n    end\nend\n\nchange size by (100)\n\nwhen backdrop switches to [gadget gauntlet cutscene4 v]\nstop [other scripts in sprite v]\nhide\n\n@special effects\n\nwhen flag clicked\nset size to (40) %\ngo to x: (183) y: (-159)\nswitch costume to (capcom v)\nset [color v] effect to (0)\nhide\nset [ghost v] effect to (100)\nwait (2) seconds\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [title v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [mode select v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth2 v]\ngo to x: (0) y: (0)\nset [color v] effect to (0)\nset [ghost v] effect to (0)\nswitch costume to (green v)\nset size to (300) %\nshow\nforever\n    go to [front v] layer\nend\n\nwhen I receive [game over v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [zone complete v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinthboss v]\ngo to x: (0) y: (0)\nset [color v] effect to (0)\nset [ghost v] effect to (0)\nswitch costume to (green v)\nset size to (300) %\nshow\nforever\n    go to [front v] layer\nend\n\n@screen transition\n\nwhen I receive [screen transition v]\nhide\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (3) seconds\nswitch backdrop to (title v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [screen transition v2 v]\nhide\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nswitch backdrop to (mode select v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [screen transition v3 v]\nhide\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nswitch backdrop to (begin game v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [screen transition v4 v]\nhide\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nswitch backdrop to (code v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [screen transition loading green hills v]\nhide\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nswitch backdrop to (green hills loading v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [screen transition zone complete! v]\nhide\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nswitch backdrop to (zone complete v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [screen transition loading labyrinth v]\nhide\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nswitch backdrop to (labyrinth loading v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [screen transition loading starlight  v]\nhide\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nswitch backdrop to (starlight loading v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [screen transition loading death egg v]\nhide\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nswitch backdrop to (death egg loading v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [screen transition gadget gauntlet v]\nhide\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nswitch backdrop to (gadget gauntlet loading v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [ending screen transition  v]\nhide\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nswitch backdrop to (gadget gauntlet cutscene v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [ending 2 v]\nhide\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (4) seconds\nswitch backdrop to (gadget gauntlet cutscene2 v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [ending 3 v]\nhide\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (4) seconds\nswitch backdrop to (gadget gauntlet cutscene3 v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [ending 4 v]\nhide\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nswitch backdrop to (gadget gauntlet cutscene4 v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [the end v]\nhide\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nwait (4) seconds\nswitch backdrop to (the end v)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\n\n@Code receiver \n\nwhen backdrop switches to [zone complete v]\nwait (1.5) seconds\nstart sound [checkpoint v]\nif <<(zone1 alr) = [no]> and <(LEVEL) = [GHZ3]>> then\n    if <not <(how many levels unlocked?) > [5]>> then\n        change [how many levels unlocked? v] by (1)\n    end\n    set [code v] to (pick random (5000) to (5011))\n    set [zone1 alr v] to [yes]\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<<(zone1 alr) = [yes]> and <(zone2 alr) = [no]>> and <(LEVEL) = [LZ3]>> then\n    if <not <(how many levels unlocked?) > [5]>> then\n        change [how many levels unlocked? v] by (1)\n    end\n    set [code v] to (pick random (7023) to (7033))\n    set [zone2 alr v] to [yes]\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<<(zone1 alr) = [yes]> and <(zone2 alr) = [yes]>> and <<(zone3 alr) = [no]> and <(LEVEL) = [SLZ3]>>> then\n    if <not <(how many levels unlocked?) > [5]>> then\n        change [how many levels unlocked? v] by (1)\n    end\n    set [code v] to (pick random (22000) to (22010))\n    set [zone3 alr v] to [yes]\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<<(zone1 alr) = [yes]> and <(zone2 alr) = [yes]>> and <<(zone3 alr) = [yes]> and <<(zone4 alr) = [no]> and <(LEVEL) = [DEZ2]>>>> then\n    if <not <(how many levels unlocked?) > [5]>> then\n        change [how many levels unlocked? v] by (1)\n    end\n    set [zone4 alr v] to [yes]\n    set [code v] to (pick random (10390) to (10400))\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<<(zone1 alr) = [yes]> and <(zone2 alr) = [yes]>> and <<(zone3 alr) = [yes]> and <<(zone4 alr) = [yes]> and <<(zone5 alr) = [no]> and <(LEVEL) = [GGZ2]>>>>> then\n    if <not <(how many levels unlocked?) > [5]>> then\n        change [how many levels unlocked? v] by (1)\n    end\n    set [code v] to (pick random (4500) to (4510))\n    set [zone5 alr v] to [yes]\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<<(zone1 alr) = [yes]> and <(zone2 alr) = [yes]>> and <<(zone3 alr) = [yes]> and <<(zone4 alr) = [yes]> and <(zone5 alr) = [yes]>>>> then\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<(zone5 alr) = [yes]> and <(LEVEL) = [GGZ2]>> then\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<(zone4 alr) = [yes]> and <(LEVEL) = [DEZ2]>> then\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<(zone3 alr) = [yes]> and <(LEVEL) = [SLZ3]>> then\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<(zone2 alr) = [yes]> and <(LEVEL) = [LZ3]>> then\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<(zone1 alr) = [yes]> and <(LEVEL) = [GHZ3]>> then\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\n\nwhen flag clicked\nhide variable [code v]\n\nwhen backdrop switches to [code v]\nask [What is your code?] and wait\nif <(answer) = [0]> then\n    start sound [checkpoint v]\n    set [how many levels unlocked? v] to [0]\n    set [code v] to [0]\n    set [zone1 alr v] to [no]\n    set [zone2 alr v] to [no]\n    set [zone3 alr v] to [no]\n    set [zone4 alr v] to [no]\n    set [first time playing? v] to [yes]\n    set [zone5 alr v] to [no]\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<<<<<<<<<<<(answer) = [5011]> or <(answer) = [5010]>> or <(answer) = [5009]>> or <(answer) = [5008]>> or <(answer) = [5007]>> or <(answer) = [5006]>> or <(answer) = [5004]>> or <(answer) = [5005]>> or <(answer) = [5002]>> or <(answer) = [5001]>> or <(answer) = [5000]>> or <(answer) = [5003]>> then\n    start sound [checkpoint v]\n    set [how many levels unlocked? v] to [1]\n    set [code v] to (pick random (5000) to (5011))\n    set [first time playing? v] to [no]\n    set [zone1 alr v] to [yes]\n    set [zone2 alr v] to [no]\n    set [zone3 alr v] to [no]\n    set [zone4 alr v] to [no]\n    set [zone5 alr v] to [no]\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<<<<<<<<<<(answer) = [7023]> or <(answer) = [7024]>> or <(answer) = [7025]>> or <(answer) = [7026]>> or <(answer) = [7027]>> or <(answer) = [7028]>> or <(answer) = [7029]>> or <(answer) = [7030]>> or <(answer) = [7031]>> or <(answer) = [7032]>> or <(answer) = [7033]>> then\n    start sound [checkpoint v]\n    set [how many levels unlocked? v] to [2]\n    set [code v] to (pick random (7023) to (7033))\n    set [zone1 alr v] to [yes]\n    set [first time playing? v] to [no]\n    set [zone2 alr v] to [yes]\n    set [zone3 alr v] to [no]\n    set [zone4 alr v] to [no]\n    set [zone5 alr v] to [no]\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<<<<<<<<<<(answer) = [22000]> or <(answer) = [22001]>> or <(answer) = [22002]>> or <(answer) = [22003]>> or <(answer) = [22004]>> or <(answer) = [22005]>> or <(answer) = [22006]>> or <(answer) = [22007]>> or <(answer) = [22008]>> or <(answer) = [22009]>> or <(answer) = [220010]>> then\n    start sound [checkpoint v]\n    set [how many levels unlocked? v] to [3]\n    set [code v] to (pick random (22000) to (22010))\n    set [zone1 alr v] to [yes]\n    set [first time playing? v] to [no]\n    set [zone2 alr v] to [yes]\n    set [zone3 alr v] to [yes]\n    set [zone4 alr v] to [no]\n    set [zone5 alr v] to [no]\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<<<<<<<<<<(answer) = [10390]> or <(answer) = [10391]>> or <(answer) = [10392]>> or <(answer) = [10393]>> or <(answer) = [10394]>> or <(answer) = [10396]>> or <(answer) = [10395]>> or <(answer) = [10397]>> or <(answer) = [10398]>> or <(answer) = [10399]>> or <(answer) = [10400]>> then\n    start sound [checkpoint v]\n    set [how many levels unlocked? v] to [5]\n    set [code v] to (pick random (10390) to (10400))\n    set [zone1 alr v] to [yes]\n    set [zone2 alr v] to [yes]\n    set [first time playing? v] to [no]\n    set [zone3 alr v] to [yes]\n    set [zone4 alr v] to [yes]\n    set [zone5 alr v] to [no]\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <<<<<<<<<<<(answer) = [4501]> or <(answer) = [4500]>> or <(answer) = [4502]>> or <(answer) = [4503]>> or <(answer) = [4504]>> or <(answer) = [4505]>> or <(answer) = [4506]>> or <(answer) = [4507]>> or <(answer) = [4508]>> or <(answer) = [4509]>> or <(answer) = [4510]>> then\n    start sound [checkpoint v]\n    set [how many levels unlocked? v] to [5]\n    set [code v] to (pick random (4500) to (4510))\n    set [zone1 alr v] to [yes]\n    set [zone2 alr v] to [yes]\n    set [zone3 alr v] to [yes]\n    set [zone4 alr v] to [yes]\n    set [first time playing? v] to [no]\n    set [zone5 alr v] to [yes]\n    wait (3) seconds\n    broadcast (screen transition V3 v)\n    stop [this script v]\nend\nif <not <<<<<(answer) = [0]> or <<<<<<<<<<<<(answer) = [5011]> or <(answer) = [5010]>> or <(answer) = [5009]>> or <(answer) = [5008]>> or <(answer) = [5007]>> or <(answer) = [5006]>> or <(answer) = [5004]>> or <(answer) = [5005]>> or <(answer) = [5002]>> or <(answer) = [5001]>> or <(answer) = [5000]>> or <(answer) = [5003]>>> or <<<<<<<<<<<(answer) = [7023]> or <(answer) = [7024]>> or <(answer) = [7025]>> or <(answer) = [7026]>> or <(answer) = [7027]>> or <(answer) = [7028]>> or <(answer) = [7029]>> or <(answer) = [7030]>> or <(answer) = [7031]>> or <(answer) = [7032]>> or <<<<<<<<<<<(answer) = [22000]> or <(answer) = [22001]>> or <(answer) = [22002]>> or <(answer) = [22003]>> or <(answer) = [22004]>> or <(answer) = [22005]>> or <(answer) = [22006]>> or <(answer) = [22007]>> or <(answer) = [22008]>> or <(answer) = [22009]>> or <(answer) = [220010]>>>> or <<<<<<<<<<<(answer) = [10390]> or <(answer) = [10391]>> or <(answer) = [10392]>> or <(answer) = [10393]>> or <(answer) = [10394]>> or <(answer) = [10396]>> or <(answer) = [10395]>> or <(answer) = [10397]>> or <(answer) = [10398]>> or <(answer) = [10399]>> or <(answer) = [10400]>>> or <<<<<<<<<<<(answer) = [4501]> or <(answer) = [4500]>> or <(answer) = [4502]>> or <(answer) = [4503]>> or <(answer) = [4504]>> or <(answer) = [4505]>> or <(answer) = [4506]>> or <(answer) = [4507]>> or <(answer) = [4508]>> or <(answer) = [4509]>> or <(answer) = [4510]>>>> then\n    play sound [S3K_B2 v] until done\n    broadcast (screen transition V2 v) and wait\n    stop [this script v]\nend\n\nset [how many levels unlocked? v] to [0]\nset [zone1 alr v] to [no]\nset [zone2 alr v] to [no]\nset [zone3 alr v] to [no]\nset [zone4 alr v] to [no]\nset [zone5 alr v] to [no]\nset [first time playing? v] to [yes]\nset [code v] to [0]\n\nset [zone1 alr v] to [no]\nset [zone2 alr v] to [no]\nset [zone3 alr v] to [no]\nset [zone4 alr v] to [no]\nset [zone5 alr v] to [no]\n\n@small texts\n\nwhen flag clicked\nset [clone identifier v] to [0]\nhide variable [clone identifier v]\nhide variable [clone id v]\nset [title screen? v] to [no]\nset [clone id v] to [0]\nset [level select v] to [no]\nset [mode clicked v] to [1]\nhide\n\nwhen backdrop switches to [title v]\nhide\nset size to (100) %\nset [ghost v] effect to (100)\nset [title screen? v] to [yes]\nwait (2) seconds\nswitch costume to (press space or tap v)\nset [brightness v] effect to (0)\ngo to x: (0) y: (-150)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    wait (1) seconds\n    repeat (10)\n        change [brightness v] effect by (10)\n    end\n    repeat (10)\n        change [brightness v] effect by (-10)\n    end\nend\n\nwhen I receive [small text fader v]\nstop [other scripts in sprite v]\nstart sound [Dialogue v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nif <<(PC mode on?) = [yes]> and <not <(Mobile mode on?) = [yes]>>> then\n    wait (1) seconds\n    broadcast (screen transition V2 v) and wait\nend\nif <<(Mobile mode on?) = [yes]> and <not <(PC mode on?) = [yes]>>> then\n    wait (1) seconds\n    broadcast (screen transition V2 v) and wait\nend\n\nwhen backdrop switches to [title v]\nwait (3) seconds\nforever\n    if <key (space v) pressed?> then\n        set [mobile mode on? v] to [no]\n        set [pc mode on? v] to [yes]\n        broadcast (small text fader v) and wait\n    end\nend\n\nwhen backdrop switches to [mode select v]\nstop [other scripts in sprite v]\nset [clone id v] to [0]\nset [ghost v] effect to (100)\nset [brightness v] effect to (0)\nwait (1) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nset [clone id v] to [2]\ncreate clone of (_myself_ v)\nshow\nset size to (300) %\nswitch costume to (play v)\nset [clone id v] to [0]\ngo to x: (0) y: (25)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I start as a clone\nif <(Clone ID) = [1]> then\n    go to x: (0) y: (-25)\n    switch costume to (load v)\n    show\n    set size to (300) %\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    forever\n        wait until <<(backdrop [number v]) = [4]> or <(backdrop [number v]) = [5]>>\n        set [clone id v] to [0]\n        delete this clone\n    end\nend\nif <(Clone ID) = [2]> then\n    go to x: (0) y: (-87)\n    switch costume to (code v)\n    show\n    set size to (300) %\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    forever\n        wait until <<(backdrop [number v]) = [4]> or <(backdrop [number v]) = [5]>>\n        set [clone id v] to [0]\n        delete this clone\n    end\nend\n\nwhen this sprite clicked\nif <(Mobile mode on?) = [yes]> then\n    if <(Clone ID) = [2]> then\n        if <not <(Mode clicked) = [3]>> then\n            set [mode clicked v] to [3]\n            stop [this script v]\n        end\n        if <(Mode clicked) = [3]> then\n            start sound [Dialogue v]\n            delete all of [your code v]\n            hide list [your code v]\n            add [This is your code. Be sure to write it down every time the code updates ] to [your code v]\n            add (code) to [your code v]\n            add [put the code in load game to retrieve your data \(if you have any\)] to [your code v]\n            wait (6) seconds\n            show list [your code v]\n            play sound [Dialogue v] until done\n        end\n    end\n    if <(Clone ID) = [1]> then\n        if <not <(Mode clicked) = [2]>> then\n            set [mode clicked v] to [2]\n            stop [this script v]\n        end\n        if <(Mode clicked) = [2]> then\n            broadcast (Screen transition V4 v)\n            stop [this script v]\n        end\n    end\n    if <not <(Mode clicked) = [1]>> then\n        set [mode clicked v] to [1]\n        stop [this script v]\n    end\n    if <(Mode clicked) = [1]> then\n        start sound [Dialogue v]\n        broadcast (screen transition V3 v) and wait\n        set [clone id v] to [0]\n        hide\n        stop [this script v]\n    end\nend\n\nwhen backdrop switches to [code v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\n\n@Portal\n\nwhen backdrop switches to [begin cutscene v]\nhide\nset [ghost v] effect to (100)\nset [clone id v] to [0]\nset [identified as clone v] to [0]\nswitch costume to (ruby 1 v)\nset size to (200) %\nshow\ngo to x: (0) y: (0)\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    repeat until <(Clone ID) = [1]>\n        if <(Clone ID) = [1]> then\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            hide\n            stop [this script v]\n        end\n        glide (1) secs to x: (0) y: (10)\n        if <(Clone ID) = [1]> then\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            hide\n            stop [this script v]\n        end\n        glide (1) secs to x: (0) y: (-10)\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    stop [this script v]\nend\n\nwhen flag clicked\nhide variable [clone id v]\nhide variable [identified as clone v]\nset [clone id v] to [0]\nset [identified as clone v] to [0]\nhide\n\nwhen backdrop switches to [begin cutscene v]\nplay sound [Sonic_Mania_Forces_Phantom_Ruby_Extended v] until done\nwait until <(Clone ID) = [1]>\nstop all sounds\n\nwhen I start as a clone\nset [identified as clone v] to [1]\nbroadcast (swirl v)\nif <(Clone ID) = [3]> then\n    hide\n    switch costume to (portal-0 v)\n    set [ghost v] effect to (100)\n    set size to (100) %\n    wait (1) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (3) seconds\n    start sound [RedCube_R v]\n    broadcast (ending 2 v)\n    repeat (30)\n        change size by (10)\n    end\n    set [identified as clone v] to [0]\n    set [clone id v] to [0]\n    delete this clone\nend\nif <(Clone ID) = [1]> then\n    hide\n    switch costume to (portal-0 v)\n    set [ghost v] effect to (100)\n    set size to (100) %\n    wait (1) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (3) seconds\n    start sound [RedCube_R v]\n    broadcast (screen transition v)\n    repeat (30)\n        change size by (10)\n    end\n    set [identified as clone v] to [0]\n    set [clone id v] to [0]\n    delete this clone\nend\nif <(Clone ID) = [2]> then\n    hide\n    switch costume to (portal-0 v)\n    set [ghost v] effect to (100)\n    set size to (100) %\n    wait (1) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (3) seconds\n    start sound [Attack3_R v]\n    repeat (30)\n        change size by (5)\n    end\n    start sound [Wind-Mark_DiAngelo-1940285615 v]\n    wait until <(first time playing?) = [no]>\n    set [identified as clone v] to [0]\n    set [clone id v] to [0]\n    stop all sounds\n    wait (2) seconds\n    delete this clone\nend\n\nwhen I receive [swirl v]\nif <(identified as clone) = [1]> then\n    if <(Clone ID) = [1]> then\n        repeat until <not <(Clone ID) = [1]>>\n            swirl\n        end\n    end\n    if <(Clone ID) = [2]> then\n        repeat until <not <(Clone ID) = [2]>>\n            swirl\n        end\n    end\n    if <(Clone ID) = [3]> then\n        repeat until <not <(Clone ID) = [3]>>\n            swirl\n        end\n    end\nend\n\nwhen backdrop switches to [begin cutscene v]\nwait (5) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [beginning of game cutscene v]\nhide\nset [ghost v] effect to (100)\nswitch costume to (ruby 1 v)\nset size to (120) %\nshow\ngo to x: (0) y: (0)\nwait (3) seconds\nstart sound [Attack6_L v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (4) seconds\nset [clone id v] to [2]\ncreate clone of (_myself_ v)\n\ndefine swirl\nswitch costume to (portal-0 v)\nwait (0) seconds\nswitch costume to (portal-1 v)\nwait (0) seconds\nswitch costume to (portal-2 v)\nwait (0) seconds\nswitch costume to (portal-3 v)\nwait (0) seconds\nswitch costume to (portal-4 v)\nwait (0) seconds\nswitch costume to (portal-5 v)\nwait (0) seconds\nswitch costume to (portal-6 v)\nwait (0) seconds\nswitch costume to (portal-7 v)\nwait (0) seconds\nswitch costume to (portal-8 v)\nwait (0) seconds\nswitch costume to (portal-9 v)\nwait (0) seconds\nswitch costume to (portal-10 v)\nwait (0) seconds\nswitch costume to (portal-11 v)\nwait (0) seconds\nswitch costume to (portal-12 v)\nwait (0) seconds\nswitch costume to (portal-13 v)\nwait (0) seconds\nswitch costume to (portal-14 v)\nwait (0) seconds\nswitch costume to (portal-15 v)\nwait (0) seconds\n\nwhen backdrop switches to [beginning of game cutscene v]\nwait (1) seconds\nforever\n    repeat until <(Clone ID) = [2]>\n        if <(Clone ID) = [2]> then\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            hide\n            stop [this script v]\n        end\n        glide (1) secs to x: (0) y: (10)\n        if <(Clone ID) = [2]> then\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            hide\n            stop [this script v]\n        end\n        glide (1) secs to x: (0) y: (-10)\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    stop [this script v]\nend\n\nwhen backdrop switches to [begin game v]\nstop all sounds\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet cutscene v]\nset [clone id v] to [0]\nset [identified as clone v] to [0]\nhide\nset [ghost v] effect to (100)\nswitch costume to (ruby 1 v)\nset size to (100) %\nshow\ngo to x: (0) y: (0)\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    repeat until <(Clone ID) = [3]>\n        if <(Clone ID) = [3]> then\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            hide\n            stop [this script v]\n        end\n        glide (1) secs to x: (0) y: (10)\n        if <(Clone ID) = [3]> then\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            hide\n            stop [this script v]\n        end\n        glide (1) secs to x: (0) y: (-10)\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    stop [this script v]\nend\n\nwhen backdrop switches to [gadget gauntlet cutscene v]\nhide\nset [ghost v] effect to (100)\nswitch costume to (ruby 1 v)\nset size to (100) %\nshow\ngo to x: (0) y: (0)\nwait (3) seconds\nstart sound [Attack6_L v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (4) seconds\nset [clone id v] to [3]\ncreate clone of (_myself_ v)\n\nwhen backdrop switches to [gadget gauntlet cutscene2 v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [title v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nstop all sounds\n\n@cursor \n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [mode select v]\nset [mode clicked v] to [1]\nswitch costume to (cursor v)\ngo to x: (-16) y: (14)\ngo [backward v] (3) layers\ngo [forward v] (1) layers\nshow\nwait (1) seconds\nforever\n    if <<(Mobile mode on?) = [yes]> and <(PC mode on?) = [no]>> then\n        if <(Mode clicked) = [1]> then\n            go to x: (-16) y: (14)\n            wait until <<(Mode clicked) = [2]> or <(Mode clicked) = [3]>>\n            start sound [MenuCursor v]\n            if <(Mode clicked) = [3]> then\n                glide (0.1) secs to x: (-16) y: (-97)\n            end\n            if <(Mode clicked) = [2]> then\n                glide (0.1) secs to x: (-16) y: (-38)\n            end\n        end\n        if <(Mode clicked) = [2]> then\n            go to x: (-16) y: (-38)\n            wait until <<(Mode clicked) = [1]> or <(Mode clicked) = [3]>>\n            start sound [MenuCursor v]\n            if <(Mode clicked) = [3]> then\n                glide (0.1) secs to x: (-16) y: (-97)\n            end\n            if <(Mode clicked) = [1]> then\n                glide (0.1) secs to x: (-16) y: (14)\n            end\n        end\n        if <(Mode clicked) = [3]> then\n            go to x: (-16) y: (-97)\n            wait until <<(Mode clicked) = [2]> or <(Mode clicked) = [1]>>\n            start sound [MenuCursor v]\n            if <(Mode clicked) = [1]> then\n                glide (0.1) secs to x: (-16) y: (14)\n            end\n            if <(Mode clicked) = [2]> then\n                glide (0.1) secs to x: (-16) y: (-38)\n            end\n        end\n    end\n    if <<(PC mode on?) = [yes]> and <(Mobile mode on?) = [no]>> then\n        if <<key (down arrow v) pressed?> and <(Mode clicked) = [2]>> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-16) y: (-97)\n            set [mode clicked v] to [3]\n        end\n        if <<key (up arrow v) pressed?> and <(Mode clicked) = [3]>> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-16) y: (-38)\n            set [mode clicked v] to [2]\n        end\n        if <<key (up arrow v) pressed?> and <(Mode clicked) = [2]>> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-16) y: (14)\n            set [mode clicked v] to [1]\n        end\n        if <<key (down arrow v) pressed?> and <(Mode clicked) = [1]>> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-16) y: (-38)\n            set [mode clicked v] to [2]\n        end\n        if <<key (space v) pressed?> and <(Mode clicked) = [2]>> then\n            stop [other scripts in sprite v]\n            start sound [Dialogue v]\n            broadcast (Screen transition V4 v) and wait\n            set [clone id v] to [0]\n            hide\n            stop [this script v]\n        end\n        if <<key (space v) pressed?> and <(Mode clicked) = [1]>> then\n            stop [other scripts in sprite v]\n            start sound [Dialogue v]\n            broadcast (screen transition V3 v) and wait\n            set [clone id v] to [0]\n            hide\n            stop [this script v]\n        end\n        if <<key (space v) pressed?> and <(Mode clicked) = [3]>> then\n            start sound [Dialogue v]\n            delete all of [your code v]\n            hide list [your code v]\n            add [This is your code. Be sure to write it down every time the code updates ] to [your code v]\n            add (code) to [your code v]\n            add [put the code in load game to retrieve your data \(if you have any\)] to [your code v]\n            wait (6) seconds\n            show list [your code v]\n            play sound [Dialogue v] until done\n        end\n    end\nend\n\nplay sound [S3K_B2 v] until done\n\nwhen backdrop switches to [begin game v]\n\nwhen backdrop switches to [code v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nset [level v] to [GHZ]\nset [mode clicked v] to [1]\nswitch costume to (cursor2 v)\ngo to x: (-28) y: (126)\ngo [backward v] (3) layers\ngo [forward v] (1) layers\nshow\ngo to x: (-28) y: (126)\nwait (1) seconds\nforever\n    if <<(Mobile mode on?) = [yes]> and <(PC mode on?) = [no]>> then\n        if <(Mode clicked) = [1]> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-28) y: (126)\n            wait until <<(Mode clicked) = [2]> or <<(Mode clicked) = [3]> or <<(Mode clicked) = [4]> or <(Mode clicked) = [5]>>>>\n            if <<(Mode clicked) = [2]> and <(zone1 alr) = [yes]>> then\n                start sound [MenuCursor v]\n                glide (0.1) secs to x: (-27) y: (65)\n                wait until <<(Mode clicked) = [1]> or <<(Mode clicked) = [3]> or <<(Mode clicked) = [4]> or <(Mode clicked) = [5]>>>>\n            end\n            if <<<(Mode clicked) = [3]> and <(zone1 alr) = [yes]>> and <(zone2 alr) = [yes]>> then\n                start sound [MenuCursor v]\n                glide (0.1) secs to x: (-27) y: (8)\n                wait until <<(Mode clicked) = [1]> or <<(Mode clicked) = [2]> or <<(Mode clicked) = [4]> or <(Mode clicked) = [5]>>>>\n            end\n            if <<(Mode clicked) = [4]> and <<<(zone1 alr) = [yes]> and <(zone3 alr) = [yes]>> and <(zone2 alr) = [yes]>>> then\n                start sound [MenuCursor v]\n                glide (0.1) secs to x: (-27) y: (-50)\n                wait until <<(Mode clicked) = [1]> or <<(Mode clicked) = [2]> or <<(Mode clicked) = [3]> or <(Mode clicked) = [5]>>>>\n            end\n            if <<(Mode clicked) = [5]> and <<(zone4 alr) = [yes]> and <<<(zone1 alr) = [yes]> and <(zone3 alr) = [yes]>> and <(zone2 alr) = [yes]>>>> then\n                start sound [MenuCursor v]\n                glide (0.1) secs to x: (-27) y: (-94)\n                wait until <<(Mode clicked) = [1]> or <<(Mode clicked) = [2]> or <<(Mode clicked) = [3]> or <(Mode clicked) = [4]>>>>\n            end\n        end\n    end\n    if <<(PC mode on?) = [yes]> and <(Mobile mode on?) = [no]>> then\n        if <<key (up arrow v) pressed?> and <<(Mode clicked) = [2]> and <(zone1 alr) = [yes]>>> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-28) y: (126)\n            set [mode clicked v] to [1]\n        end\n        if <<key (up arrow v) pressed?> and <<(Mode clicked) = [5]> and <<(zone4 alr) = [yes]> and <<<(zone1 alr) = [yes]> and <(zone3 alr) = [yes]>> and <(zone2 alr) = [yes]>>>>> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-28) y: (-41)\n            set [mode clicked v] to [4]\n        end\n        if <<key (up arrow v) pressed?> and <<(Mode clicked) = [4]> and <<<(zone1 alr) = [yes]> and <(zone3 alr) = [yes]>> and <(zone2 alr) = [yes]>>>> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-28) y: (8)\n            set [mode clicked v] to [3]\n        end\n        if <<key (up arrow v) pressed?> and <<<(Mode clicked) = [3]> and <(zone1 alr) = [yes]>> and <(zone2 alr) = [yes]>>> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-28) y: (65)\n            set [mode clicked v] to [2]\n        end\n        if <<key (down arrow v) pressed?> and <<(Mode clicked) = [1]> and <(zone1 alr) = [yes]>>> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-28) y: (65)\n            set [mode clicked v] to [2]\n        end\n        if <<key (down arrow v) pressed?> and <<(Mode clicked) = [4]> and <<<(zone1 alr) = [yes]> and <(zone3 alr) = [yes]>> and <<(zone2 alr) = [yes]> and <(zone4 alr) = [yes]>>>>> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-27) y: (-94)\n            set [mode clicked v] to [5]\n        end\n        if <<key (down arrow v) pressed?> and <<(Mode clicked) = [3]> and <<<(zone1 alr) = [yes]> and <(zone3 alr) = [yes]>> and <(zone2 alr) = [yes]>>>> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-28) y: (-41)\n            set [mode clicked v] to [4]\n        end\n        if <<key (down arrow v) pressed?> and <<(Mode clicked) = [2]> and <<(zone1 alr) = [yes]> and <(zone2 alr) = [yes]>>>> then\n            start sound [MenuCursor v]\n            glide (0.1) secs to x: (-28) y: (8)\n            set [mode clicked v] to [3]\n        end\n        if <<key (space v) pressed?> and <<(Mode clicked) = [2]> and <(zone1 alr) = [yes]>>> then\n            stop [other scripts in sprite v]\n            start sound [Dialogue v]\n            set [level v] to [LZ]\n            broadcast (screen transition loading labyrinth v) and wait\n            set [clone id v] to [0]\n            hide\n            stop [this script v]\n        end\n        if <<key (space v) pressed?> and <(Mode clicked) = [1]>> then\n            stop [other scripts in sprite v]\n            start sound [Dialogue v]\n            set [level v] to [GHZ]\n            broadcast (screen transition loading green hills v) and wait\n            set [clone id v] to [0]\n            hide\n            stop [this script v]\n        end\n        if <<key (space v) pressed?> and <<(Mode clicked) = [3]> and <<(zone2 alr) = [yes]> and <(zone1 alr) = [yes]>>>> then\n            stop [other scripts in sprite v]\n            start sound [Dialogue v]\n            set [level v] to [SLZ]\n            broadcast (screen transition loading starlight  v) and wait\n            set [clone id v] to [0]\n            hide\n            stop [this script v]\n        end\n        if <<key (space v) pressed?> and <<(Mode clicked) = [4]> and <<(zone2 alr) = [yes]> and <<(zone1 alr) = [yes]> and <(zone3 alr) = [yes]>>>>> then\n            stop [other scripts in sprite v]\n            start sound [Dialogue v]\n            set [level v] to [DEZ]\n            broadcast (screen transition loading death egg v) and wait\n            set [clone id v] to [0]\n            hide\n            stop [this script v]\n        end\n        if <<key (space v) pressed?> and <<<(Mode clicked) = [5]> and <<(zone2 alr) = [yes]> and <<(zone1 alr) = [yes]> and <(zone3 alr) = [yes]>>>> and <(zone4 alr) = [yes]>>> then\n            stop [other scripts in sprite v]\n            start sound [Dialogue v]\n            set [level v] to [GGZ]\n            broadcast (screen transition gadget gauntlet v) and wait\n            set [clone id v] to [0]\n            hide\n            stop [this script v]\n        end\n    end\nend\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [beginning of game cutscene v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\n\ngo to x: (-16) y: (-38)\n\nglide (0.1) secs to x: (-16) y: (14)\n\n@ring effects\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\n\nwhen I start as a clone\nset size to (300) %\ngo to x: (pick random (400) to (-400)) y: (pick random (100) to (-100))\nrepeat (20)\n    next costume\n    move (10) steps\n    point towards (portal v)\n    change size by (-10)\nend\nhide\ndelete this clone\n\nwhen I receive [ring loss v]\nshow\ngo to [front v] layer\nset size to (300) %\ngo to x: (pick random (400) to (-400)) y: (pick random (100) to (-100))\nrepeat (10)\n    go to [front v] layer\n    create clone of (_myself_ v)\nend\nstart sound [ringloss v]\nrepeat (20)\n    next costume\n    move (10) steps\n    point towards (portal v)\n    change size by (-10)\nend\nhide\nwait (2) seconds\nset [first time playing? v] to [no]\nbroadcast (screen transition V3 v) and wait\n\n@eggman\n\nwhen backdrop switches to [starlight3 v]\nset [can you hurt him? v] to [no]\nwait (5) seconds\nforever\n    if <(shootem) = [yes]> then\n        repeat (10)\n            change [brightness v] effect by (10)\n        end\n        set [brightness v] effect to (0)\n        set [can you hurt him? v] to [yes]\n        wait (2) seconds\n        repeat (10)\n            change [brightness v] effect by (-10)\n        end\n        set [can you hurt him? v] to [no]\n        set [brightness v] effect to (-100)\n        wait (3) seconds\n    end\nend\n\nwhen backdrop switches to [starlight3 v]\nwait (3) seconds\nforever\n    broadcast (glow v) and wait\nend\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [beginning of game cutscene v]\ngo to x: (181) y: (-96)\npoint in direction (-90)\nset rotation style [left-right v]\ngo to [front v] layer\nshow\nswitch costume to (costume1 v)\nwait (2) seconds\nbroadcast (eggman cutscene laugh v) and wait\nbroadcast (fly away v)\nwait (0.8) seconds\npoint in direction (90)\nset rotation style [left-right v]\ngo to x: (183) y: (-84)\nglide (0.5) secs to x: (245) y: (14)\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [eggman cutscene laugh v]\nswitch costume to (costume1 v)\nwait (1) seconds\nrepeat (4)\n    next costume\n    wait (0) seconds\nend\nrepeat (4)\n    switch costume to (costume4 v)\n    wait (0) seconds\n    switch costume to (costume16 v)\n    wait (0) seconds\nend\nrepeat (4)\n    switch costume to (costume17 v)\n    wait (0) seconds\n    switch costume to (costume18 v)\n    wait (0) seconds\n    switch costume to (costume15 v)\n    wait (0) seconds\nend\nrepeat (3)\n    switch costume to ((costume [number v]) - (1))\nend\n\nwhen I receive [fly away v]\nswitch costume to (costume19 v)\nwait (0.4) seconds\nrepeat (8)\n    wait (0) seconds\n    next costume\nend\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hillsboss v]\nhide\nset [ghost v] effect to (0)\nwait (1) seconds\nswitch costume to (costume29 v)\nshow\ngo to [front v] layer\npoint in direction (-90)\nset rotation style [left-right v]\ngo to x: (248) y: (-6)\nforever\n    point in direction (-90)\n    set rotation style [left-right v]\n    glide (6) secs to x: (-209) y: (-6)\n    point in direction (90)\n    glide (6) secs to x: (210) y: (-6)\nend\n\nwhen backdrop switches to [green hillsboss v]\nhide\nset [brightness v] effect to (0)\nset [ghost v] effect to (0)\nwait (1) seconds\nshow\ngo to [front v] layer\npoint in direction (-90)\nset rotation style [left-right v]\ngo to x: (248) y: (-6)\nforever\n    if <<touching (bottom sense v)?> or <touching (sonic the hedgehog v)?>> then\n        broadcast (Bounce v)\n        broadcast (damage boss v) and wait\n    end\n    if <<touching (top sense2 v)?> and <(spin attack) = [yes]>> then\n        start sound [Damage v]\n        broadcast (damage boss v) and wait\n    end\n    if <(Boss health) < [1]> then\n        stop [other scripts in sprite v]\n        broadcast (eggman defeated v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (1) seconds\n        broadcast (Victory v)\n        stop [this script v]\n    end\nend\n\nwhen backdrop switches to [green hills loading v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [damage boss v]\nstart sound [Damage v]\nchange [boss health v] by (-1)\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen I receive [dead in game v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [zone complete v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinthboss v]\nhide\nset [ghost v] effect to (0)\nwait (1) seconds\nshow\ngo to [front v] layer\npoint in direction (-90)\nset rotation style [left-right v]\ngo to x: (248) y: (-71)\nforever\n    if <(Boss health) > [9]> then\n        point in direction (-90)\n        set [ghost v] effect to (0)\n        show\n        set rotation style [left-right v]\n        glide (3) secs to x: (-209) y: (-71)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (3) seconds\n        point in direction (90)\n        set [ghost v] effect to (0)\n        show\n        glide (3) secs to x: (210) y: (-71)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (3) seconds\n    end\n    if <(Boss health) < [10]> then\n        point in direction (-90)\n        set [ghost v] effect to (0)\n        show\n        set rotation style [left-right v]\n        glide (pick random (0.7) to (1)) secs to x: (-209) y: (-71)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (3) seconds\n        point in direction (90)\n        set [ghost v] effect to (0)\n        show\n        glide (pick random (0.7) to (1)) secs to x: (210) y: (-71)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (3) seconds\n    end\nend\n\nwhen backdrop switches to [labyrinthboss v]\nhide\nset [ghost v] effect to (0)\nwait (1) seconds\nshow\ngo to [front v] layer\nforever\n    switch costume to (costume11 v)\n    wait (0.1) seconds\n    switch costume to (costume12 v)\n    wait (0.1) seconds\nend\n\nwhen backdrop switches to [labyrinthboss v]\nshow variable [boss health v]\nset [boss health v] to [20]\nwait (1) seconds\nforever\n    if <<touching (sonic the hedgehog v)?> and <(spin attack) = [no]>> then\n        set [exit v] to [dead]\n    end\n    if <<<touching (bottom sense v)?> or <<touching (right sense v)?> or <touching (left sense v)?>>> and <(spin attack) = [yes]>> then\n        broadcast (Bounce v)\n        broadcast (damage boss v) and wait\n    end\n    if <<touching (top sense2 v)?> and <(spin attack) = [yes]>> then\n        start sound [Damage v]\n        broadcast (damage boss v) and wait\n    end\n    if <(Boss health) < [1]> then\n        stop [other scripts in sprite v]\n        broadcast (eggman defeated v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (1) seconds\n        broadcast (Victory v)\n        stop [this script v]\n    end\nend\n\nwhen backdrop switches to [starlight3 v]\nset [shootem v] to [no]\nswitch costume to (new piskel-2 v)\nrepeat (10)\n    set [ghost v] effect to (0)\n    set [brightness v] effect to (-100)\nend\nshow\ngo to x: (8) y: (100)\nrepeat (3)\n    repeat (10)\n        change [brightness v] effect by (10)\n    end\n    set [brightness v] effect to (0)\n    repeat (10)\n        change [brightness v] effect by (-10)\n    end\n    set [brightness v] effect to (-100)\nend\nset [brightness v] effect to (-100)\nwait (1) seconds\nforever\n    repeat until <(shootem) = [yes]>\n        glide (1) secs to x: (pick random (-200) to (200)) y: (100)\n        glide (1) secs to x: (pick random (-200) to (200)) y: (100)\n        glide (1) secs to x: (pick random (-200) to (200)) y: (100)\n    end\n    wait until <(shootem) = [no]>\nend\n\nwhen I receive [glow v]\nif <(shootem) = [no]> then\n    wait (pick random (1) to (2)) seconds\n    repeat (10)\n        change [brightness v] effect by (10)\n    end\n    set [brightness v] effect to (0)\n    repeat (10)\n        change [brightness v] effect by (-10)\n    end\n    set [brightness v] effect to (-100)\nend\n\nwhen backdrop switches to [starlight3 v]\nshow variable [boss health v]\nset [boss health v] to [20]\nwait (3) seconds\nforever\n    if <(can you hurt him?) = [yes]> then\n        if <<<touching (top sense2 v)?> or <touching (sonic the hedgehog v)?>> and <(spin attack) = [yes]>> then\n            start sound [Damage v]\n            broadcast (damage boss v) and wait\n        end\n    end\n    if <(Boss health) < [1]> then\n        stop [other scripts in sprite v]\n        broadcast (eggman defeated v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (1) seconds\n        broadcast (Victory v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [egghurt v]\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen backdrop switches to [gadget gauntletboss v]\ngo to x: (0) y: (0)\nshow\nset [brightness v] effect to (0)\nset [ghost v] effect to (100)\nswitch costume to (costume5 v)\nwait (4) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset [ghost v] effect to (0)\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nstart sound [Transform v]\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nforever\n    repeat until <(Boss health) < [26]>\n        switch costume to (costume5 v)\n        wait (0.5) seconds\n        switch costume to (costume6 v)\n        wait (0.5) seconds\n    end\n    repeat until <(Boss health) < [16]>\n        switch costume to (costume7 v)\n        wait (0.2) seconds\n        switch costume to (costume8 v)\n        wait (0.1) seconds\n    end\n    repeat until <(Boss health) = [0]>\n        switch costume to (costume13 v)\n        wait (0.1) seconds\n        switch costume to (costume14 v)\n        wait (0.1) seconds\n    end\n    if <(Boss health) = [0]> then\n        switch costume to (costume28 v)\n        stop [this script v]\n    end\nend\n\nwhen backdrop switches to [gadget gauntletboss v]\nshow variable [boss health v]\nset [boss health v] to [40]\nwait (5) seconds\nforever\n    if <<<touching (top sense2 v)?> or <touching (sonic the hedgehog v)?>> and <(spin attack) = [yes]>> then\n        start sound [Damage v]\n        broadcast (damage boss v) and wait\n    end\n    if <(Boss health) < [1]> then\n        stop [other scripts in sprite v]\n        broadcast (eggman defeated v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (1) seconds\n        hide variable [boss health v]\n        broadcast (#1 victory v)\n        stop [this script v]\n    end\nend\n\nwhen backdrop switches to [gadget gauntlet cutscene4 v]\nhide\nwait (4) seconds\npoint in direction (90)\nset rotation style [left-right v]\ngo to x: (-227) y: (-164)\nswitch costume to (costume29 v)\nshow\ngo to [front v] layer\nglide (4) secs to x: (-175) y: (-124)\nwait until <touching (portal2 v)?>\nstart sound [Damage v]\nglide (0.6) secs to x: (-173) y: (-190)\nhide\nwait (7) seconds\nbroadcast (the end v)\nstop [other scripts in sprite v]\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight3 v]\nset [shootem v] to [no]\nrepeat (10)\n    set [brightness v] effect to (-100)\nend\nforever\n    show\n    go to [front v] layer\nend\n\nwhen backdrop switches to [gadget gauntlet cutscene4 v]\nforever\n    set [ghost v] effect to (0)\n    go to [front v] layer\n    set [brightness v] effect to (0)\nend\n\n@level select as a sprite\n\nwhen flag clicked\nhide\nhide variable [clone id v]\nhide variable [zone1 set v]\n\nwhen backdrop switches to [begin game v]\nset [zone1 set v] to [no]\nset [zone 2 set v] to [no]\nset [zone 3 set v] to [no]\nset [zone 4 set v] to [no]\nset [zone 5 set v] to [no]\nset [clone identifier v] to [0]\nswitch costume to (green hills v)\ngo to x: (-39) y: (136)\nset size to (300) %\nif <(how many levels unlocked?) = [0]> then\n    set [clone id v] to [0]\n    go to x: (-39) y: (136)\n    set size to (300) %\n    hide\n    set [ghost v] effect to (100)\n    switch costume to (green hills v)\n    wait (0.5) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n        go to [front v] layer\n    end\n    set [zone1 set v] to [yes]\nend\nif <(how many levels unlocked?) = [1]> then\n    set [clone id v] to [1]\n    create clone of (_myself_ v)\n    set [clone id v] to [0]\n    go to x: (-39) y: (136)\n    set size to (300) %\n    hide\n    set [ghost v] effect to (100)\n    switch costume to (green hills v)\n    wait (0.5) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n        go to [front v] layer\n    end\n    set [zone1 set v] to [yes]\nend\nif <(how many levels unlocked?) = [2]> then\n    set [clone id v] to [1]\n    create clone of (_myself_ v)\n    set [clone id v] to [2]\n    create clone of (_myself_ v)\n    set [clone id v] to [0]\n    go to x: (-39) y: (136)\n    set size to (300) %\n    hide\n    set [ghost v] effect to (100)\n    switch costume to (green hills v)\n    wait (0.5) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n        go to [front v] layer\n    end\n    set [zone1 set v] to [yes]\nend\nif <<(Mobile mode on?) = [no]> and <(PC mode on?) = [yes]>> then\n    if <(how many levels unlocked?) = [4]> then\n        set [clone id v] to [1]\n        create clone of (_myself_ v)\n        set [clone id v] to [2]\n        create clone of (_myself_ v)\n        set [clone id v] to [3]\n        create clone of (_myself_ v)\n        set [clone id v] to [4]\n        create clone of (_myself_ v)\n        set [clone id v] to [0]\n        go to x: (-39) y: (136)\n        set size to (300) %\n        hide\n        set [ghost v] effect to (100)\n        switch costume to (green hills v)\n        wait (0.5) seconds\n        show\n        repeat (10)\n            change [ghost v] effect by (-10)\n            go to [front v] layer\n        end\n        set [zone1 set v] to [yes]\n    end\nend\nif <<(Mobile mode on?) = [no]> and <(PC mode on?) = [yes]>> then\n    if <(how many levels unlocked?) = [5]> then\n        set [clone id v] to [1]\n        create clone of (_myself_ v)\n        set [clone id v] to [2]\n        create clone of (_myself_ v)\n        set [clone id v] to [3]\n        create clone of (_myself_ v)\n        set [clone id v] to [4]\n        create clone of (_myself_ v)\n        set [clone id v] to [0]\n        go to x: (-39) y: (136)\n        set size to (300) %\n        hide\n        set [ghost v] effect to (100)\n        switch costume to (green hills v)\n        wait (0.5) seconds\n        show\n        repeat (10)\n            change [ghost v] effect by (-10)\n            go to [front v] layer\n        end\n        set [zone1 set v] to [yes]\n    end\nend\nif <<(Mobile mode on?) = [no]> and <(PC mode on?) = [yes]>> then\n    if <(how many levels unlocked?) = [3]> then\n        set [clone id v] to [1]\n        create clone of (_myself_ v)\n        set [clone id v] to [2]\n        create clone of (_myself_ v)\n        set [clone id v] to [3]\n        create clone of (_myself_ v)\n        set [clone id v] to [0]\n        go to x: (-39) y: (136)\n        set size to (300) %\n        hide\n        set [ghost v] effect to (100)\n        switch costume to (green hills v)\n        wait (0.5) seconds\n        show\n        repeat (10)\n            change [ghost v] effect by (-10)\n            go to [front v] layer\n        end\n        set [zone1 set v] to [yes]\n    end\nend\nif <<(Mobile mode on?) = [yes]> and <<<(how many levels unlocked?) = [3]> or <(how many levels unlocked?) = [4]>> or <(how many levels unlocked?) = [5]>>> then\n    set [clone id v] to [1]\n    create clone of (_myself_ v)\n    set [clone id v] to [2]\n    create clone of (_myself_ v)\n    set [clone id v] to [0]\n    go to x: (-39) y: (136)\n    set size to (300) %\n    hide\n    set [ghost v] effect to (100)\n    switch costume to (green hills v)\n    wait (0.5) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n        go to [front v] layer\n    end\n    set [zone1 set v] to [yes]\nend\n\nwhen this sprite clicked\nif <(Mobile mode on?) = [yes]> then\n    if <<(Clone ID) = [0]> and <(Mode clicked) = [1]>> then\n        start sound [Dialogue v]\n        set [level v] to [GHZ]\n        broadcast (screen transition loading green hills v) and wait\n    end\n    if <<(Clone ID) = [1]> and <(Mode clicked) = [2]>> then\n        start sound [Dialogue v]\n        set [level v] to [LZ]\n        broadcast (screen transition loading labyrinth v) and wait\n    end\n    if <<(Clone ID) = [3]> and <(Mode clicked) = [4]>> then\n        start sound [Dialogue v]\n        set [level v] to [DEZ]\n        broadcast (screen transition loading death egg v) and wait\n    end\n    if <<(Clone ID) = [4]> and <(Mode clicked) = [5]>> then\n        start sound [Dialogue v]\n        set [level v] to [GGZ]\n        broadcast (screen transition gadget gauntlet v) and wait\n    end\n    if <<(Clone ID) = [2]> and <(Mode clicked) = [3]>> then\n        start sound [Dialogue v]\n        set [level v] to [SLZ]\n        broadcast (screen transition loading starlight  v) and wait\n    end\n    if <<(Clone ID) = [1]> and <not <(Mode clicked) = [2]>>> then\n        set [mode clicked v] to [2]\n        stop [this script v]\n    end\n    if <<(Clone ID) = [0]> and <not <(Mode clicked) = [1]>>> then\n        set [mode clicked v] to [1]\n        stop [this script v]\n    end\n    if <<(Clone ID) = [2]> and <not <(Mode clicked) = [3]>>> then\n        set [mode clicked v] to [3]\n        stop [this script v]\n    end\n    if <<(Clone ID) = [3]> and <not <(Mode clicked) = [4]>>> then\n        set [mode clicked v] to [4]\n        stop [this script v]\n    end\nend\nif <<(Clone ID) = [4]> and <not <(Mode clicked) = [5]>>> then\n    set [mode clicked v] to [5]\n    stop [this script v]\nend\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [beginning of game cutscene v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [zone complete v]\nset [clone id v] to [0]\nset [ghost v] effect to (0)\nset size to (100) %\nswitch costume to (zone complete v)\ngo to x: (0) y: (0)\nset [brightness v] effect to (0)\ngo to [front v] layer\nshow\nwait (3) seconds\n\nwhen I start as a clone\nif <(Clone ID) = [1]> then\n    go to x: (-39) y: (74)\n    set size to (300) %\n    hide\n    set [ghost v] effect to (100)\n    switch costume to (labyrinth  v)\n    wait (0.5) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n        go to [front v] layer\n    end\n    set [zone 2 set v] to [yes]\n    wait until <<(backdrop [number v]) = [5]> or <<(backdrop [number v]) = [12]> or <<(backdrop [number v]) = [16]> or <<(backdrop [number v]) = [20]> or <(backdrop [number v]) = [23]>>>>>\n    delete this clone\nend\nif <(Clone ID) = [2]> then\n    go to x: (-61) y: (19)\n    set size to (300) %\n    hide\n    set [ghost v] effect to (100)\n    switch costume to (starlight  v)\n    wait (0.5) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n        go to [front v] layer\n    end\n    set [zone 3 set v] to [yes]\n    wait until <<(backdrop [number v]) = [5]> or <<(backdrop [number v]) = [12]> or <<(backdrop [number v]) = [16]> or <<(backdrop [number v]) = [20]> or <(backdrop [number v]) = [23]>>>>>\n    delete this clone\nend\nif <(Clone ID) = [3]> then\n    go to x: (-61) y: (-35)\n    set size to (300) %\n    hide\n    set [ghost v] effect to (100)\n    switch costume to (death egg v)\n    wait (0.5) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n        go to [front v] layer\n    end\n    set [zone 4 set v] to [yes]\n    wait until <<(backdrop [number v]) = [5]> or <<(backdrop [number v]) = [12]> or <<(backdrop [number v]) = [16]> or <<(backdrop [number v]) = [20]> or <(backdrop [number v]) = [23]>>>>>\n    delete this clone\nend\nif <(Clone ID) = [4]> then\n    go to x: (-10) y: (-87)\n    set size to (300) %\n    hide\n    set [ghost v] effect to (100)\n    switch costume to (gadget gauntlet   v)\n    wait (0.5) seconds\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n        go to [front v] layer\n    end\n    set [zone 5 set v] to [yes]\n    wait until <<(backdrop [number v]) = [5]> or <<(backdrop [number v]) = [12]> or <<(backdrop [number v]) = [16]> or <<(backdrop [number v]) = [20]> or <(backdrop [number v]) = [23]>>>>>\n    delete this clone\nend\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [the end v]\ngo [backward v] (99) layers\nswitch costume to (just abc's2 v)\nshow\ngo to x: (-17) y: (11)\nwait (10) seconds\nswitch backdrop to (zone complete v)\n\n@BG-2\n\nwhen flag clicked\ngo to x: (-1) y: (168)\nswitch costume to (costume1 v)\nhide\n\nwhen backdrop switches to [green hills loading v]\ngo to x: (0) y: (168)\npoint in direction (90)\nset rotation style [all around v]\nshow\nset [ghost v] effect to (0)\ncreate clone of (_myself_ v)\nforever\n    repeat until <<(backdrop [number v]) = [6]> or <<(backdrop [number v]) = [7]> or <(backdrop [number v]) = [8]>>>\n        switch costume to ((costume [number v]) - (1))\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    stop [this script v]\nend\n\nwhen I start as a clone\npoint in direction (-90)\nset rotation style [all around v]\ngo to x: (0) y: (-168)\nshow\nforever\n    repeat until <<<(backdrop [number v]) = [6]> or <(backdrop [number v]) = [7]>> or <<(backdrop [number v]) = [8]> or <<(backdrop [number v]) = [13]> or <<(backdrop [number v]) = [14]> or <<(backdrop [number v]) = [15]> or <<(backdrop [number v]) = [17]> or <<<(backdrop [number v]) = [18]> or <(backdrop [number v]) = [19]>> or <<(backdrop [number v]) = [21]> or <<(backdrop [number v]) = [22]> or <<(backdrop [number v]) = [24]> or <(backdrop [number v]) = [25]>>>>>>>>>>>\n        switch costume to ((costume [number v]) - (1))\n    end\n    hide\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen backdrop switches to [labyrinth loading v]\ngo to x: (0) y: (168)\npoint in direction (90)\nset rotation style [all around v]\nshow\nset [ghost v] effect to (0)\ncreate clone of (_myself_ v)\nforever\n    repeat until <<(backdrop [number v]) = [13]> or <<(backdrop [number v]) = [14]> or <(backdrop [number v]) = [15]>>>\n        switch costume to ((costume [number v]) - (1))\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    stop [this script v]\nend\n\nwhen backdrop switches to [starlight loading v]\ngo to x: (0) y: (168)\npoint in direction (90)\nset rotation style [all around v]\nshow\nset [ghost v] effect to (0)\ncreate clone of (_myself_ v)\nforever\n    repeat until <<(backdrop [number v]) = [17]> or <<(backdrop [number v]) = [19]> or <(backdrop [number v]) = [18]>>>\n        switch costume to ((costume [number v]) - (1))\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    stop [this script v]\nend\n\nwhen backdrop switches to [death egg loading v]\ngo to x: (0) y: (168)\npoint in direction (90)\nset rotation style [all around v]\nshow\nset [ghost v] effect to (0)\ncreate clone of (_myself_ v)\nforever\n    repeat until <<(backdrop [number v]) = [21]> or <(backdrop [number v]) = [22]>>\n        switch costume to ((costume [number v]) - (1))\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    stop [this script v]\nend\n\nwhen backdrop switches to [gadget gauntlet loading v]\ngo to x: (0) y: (168)\npoint in direction (90)\nset rotation style [all around v]\nshow\nset [ghost v] effect to (0)\ncreate clone of (_myself_ v)\nforever\n    repeat until <<(backdrop [number v]) = [24]> or <(backdrop [number v]) = [25]>>\n        switch costume to ((costume [number v]) - (1))\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    stop [this script v]\nend\n\n@Sprite1\n\nwhen backdrop switches to [begin game v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen flag clicked\nhide variable [lives v]\ngo to x: (-17) y: (-19)\nhide\n\nwhen backdrop switches to [green hills v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [green hills loading v]\nif <(LEVEL) = [GHZ]> then\n    set [lives v] to [3]\nend\n\nwhen backdrop switches to [green hills loading v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hills2 v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [green hillsboss v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [zone complete v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [labyrinth loading v]\nif <(LEVEL) = [LZ]> then\n    set [lives v] to [3]\nend\n\nwhen backdrop switches to [labyrinth2 v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [labyrinth loading v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight loading v]\nif <(LEVEL) = [SLZ]> then\n    set [lives v] to [3]\nend\n\nwhen backdrop switches to [starlight v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [starlight2 v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [starlight3 v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [death egg loading v]\nif <(LEVEL) = [DEZ]> then\n    set [lives v] to [3]\nend\n\nwhen backdrop switches to [death egg v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death eggboss v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [gadget gauntlet loading v]\nif <(LEVEL) = [DEZ]> then\n    set [lives v] to [3]\nend\n\nwhen backdrop switches to [gadget gauntlet v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [starlight loading v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinthboss v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [gadget gauntlet loading v]\nif <(LEVEL) = [GGZ]> then\n    set [lives v] to [3]\nend\n\nwhen backdrop switches to [gadget gauntlet loading v]\nhide variable [lives v]\nhide\n\nwhen backdrop switches to [gadget gauntletboss v]\nshow variable [lives v]\nshow\nrepeat (10)\n    go to [front v] layer\n    go to x: (-9) y: (-19)\nend\n\nwhen backdrop switches to [gadget gauntlet cutscene v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\n@red-text-game-over-png-transparent-4\n\nwhen flag clicked\nhide\n\nwhen I receive [game over v]\ngo to x: (0) y: (0)\nrepeat (1)\n    wait (2) seconds\n    repeat (15)\n        change [ghost v] effect by (10)\n    end\n    stop all sounds\n    show\n    start sound [Jun_Senoue_-_Game_Over_Sonic_the_Hedgehog_4_-_Episode_1_OST_Sound_track_\(Dydka v]\n    repeat (15)\n        change [ghost v] effect by (-7)\n        go to [front v] layer\n    end\nend\nwait (7) seconds\nhide\nrepeat (1)\n    broadcast (screen transition V3 v) and wait\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\n@left sense\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [tick v]\nif <(hide) = [no]> then\n    show\nend\ngo to (sonic the hedgehog v)\npoint in direction (0)\nset rotation style [all around v]\nset [ghost v] effect to (100)\nif <(stop moving) = [no]> then\n    if <touching (platforms v)?> then\n        go to (sonic the hedgehog v)\n        set [left collision v] to [1]\n    else\n        set [left collision v] to [0]\n    end\nelse\n    set [right collision v] to [0]\nend\n\nwhen backdrop switches to [begin game v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hills loading v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [zone complete v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death egg loading v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet cutscene v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet cutscene v]\nstop [other scripts in sprite v]\nhide\n\n@top Sense2\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [tick v]\nif <(hide) = [no]> then\n    show\nend\ngo to (sonic the hedgehog v)\nset [ghost v] effect to (100)\nif <(stop moving) = [no]> then\n    if <<<touching (platforms v)?> or <touching (eggman v)?>> and <not <(LEVEL) = [GGZ2]>>> then\n        set [top collision v] to [1]\n    else\n        set [top collision v] to [0]\n    end\nelse\n    set [right collision v] to [0]\nend\n\nwhen backdrop switches to [begin game v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hills loading v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [zone complete v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death egg loading v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet cutscene v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet cutscene v]\nstop [other scripts in sprite v]\nhide\n\nchange [-sy v] by (-21)\n\nwhen I receive [boss tick v]\nshow\ngo to (sonic the hedgehog v)\nset [ghost v] effect to (100)\nif <(stop moving) = [no]> then\n    if <<<touching (platforms v)?> or <touching (eggman v)?>> and <<not <(LEVEL) = [GGZ2]>> and <not <(LEVEL) = [SLZ3]>>>> then\n        set [top collision v] to [1]\n    else\n        set [top collision v] to [0]\n    end\nelse\n    set [right collision v] to [0]\nend\n\n@tails\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((enemy: -x) - (SCROLL X)) (enemy: -y)\n\nwhen I receive [set up v]\nhide\nset size to (100) %\nset [hanging on tails v] to [no]\nset [enemy: -x v] to [0]\nset [enemy: -y v] to [0]\nif <(LEVEL) = [LZ]> then\n    Clone at x - [2780] y - [-60] EV - [99999]\nelse\n    if <(LEVEL) = [SLZ]> then\n        Clone at x - [4000] y - [-40] EV - [99999]\n    else\n        if <(LEVEL) = [DEZ]> then\n            Clone at x - [2540] y - [-40] EV - [99999]\n        else\n            if <(LEVEL) = [GGZ]> then\n                Clone at x - [2000] y - [0] EV - [99999]\n            end\n        end\n    end\nend\nset [enemy: -x v] to [-99999]\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) EV - (ev)\nset [enemy: -x v] to (x)\nset [enemy: -y v] to (y)\nset [ev v] to (ev)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    repeat (EV)\n        wait until <touching (sonic the hedgehog v)?>\n        set [hanging on tails v] to [yes]\n        start sound [woosh1 v]\n        repeat (100)\n            point in direction (90)\n            set rotation style [left-right v]\n            change [enemy: -x v] by (50)\n        end\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nforever\n    Other\nend\n\ndefine Other\nnext costume\nwait (0.1) seconds\n\nif <(STAR?) = [OFF]> then\n    broadcast (Hurt v)\nend\n\ncreate clone of (stomp v)\n\nswitch backdrop to (death egg v)\n\nwait (1) seconds\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nrepeat (30)\n    point in direction (-90)\n    set rotation style [left-right v]\n    change [enemy: -x v] by (2)\nend\nwait (2) seconds\n\nwait (2) seconds\n\nwhen backdrop switches to [labyrinth v]\nforever\n    if <(y position) > [150]> then\n        change y by (-5)\n    end\nend\n\nwhen backdrop switches to [labyrinth v]\n\nwhen backdrop switches to [labyrinth v]\nforever\n    wait (0) seconds\n    next costume\nend\n\npoint in direction (90)\n\nchange [-sx v] by (4)\n\nswitch backdrop to (labyrinth v)\n\nif <key (up arrow v) pressed?> then\n    change y by (5)\nend\nif <key (down arrow v) pressed?> then\n    change y by (-5)\nend\n\ngo to x: <touching (sonic the hedgehog v)?> y: <touching (sonic the hedgehog v)?>\n\nrepeat until <(hanging on tails) = [no]>\n\n@Sprite13\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [starlight3 v]\nset [shootem v] to [no]\nhide\nforever\n    repeat until <(shootem) = [yes]>\n        hide\n        go to (eggman v)\n    end\n    show\n    if <<touching (sonic the hedgehog v)?> and <(spin attack) = [no]>> then\n        set [exit v] to [dead]\n    end\n    repeat (15)\n        if <<touching (sonic the hedgehog v)?> and <(spin attack) = [no]>> then\n            set [exit v] to [dead]\n        end\n        change y by (-20)\n    end\n    hide\n    wait (3) seconds\n    set [shootem v] to [no]\nend\n\nchange [boss health v] by (-10)\n\nwhen backdrop switches to [starlight3 v]\nset [shootem v] to [no]\nhide\nwait (4) seconds\nforever\n    if <(shootem) = [no]> then\n        play sound [charge v] until done\n        start sound [S3K_4E v]\n        set [shootem v] to [yes]\n    end\nend\n\nwhen backdrop switches to [zone complete v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\n\n@explodes\n\nwhen flag clicked\ngo to (eggman v)\nhide\n\nwhen backdrop switches to [green hillsboss v]\nset size to (300) %\nhide\nforever\n    go to (eggman v)\nend\n\nwhen I receive [eggman defeated v]\nstart sound [finalExplode v]\nshow\nswitch costume to (expboss_1 v)\nwait (0.02) seconds\nrepeat (5)\n    next costume\n    go to [front v] layer\n    wait (0.02) seconds\nend\nhide\n\nwhen I receive [dead in game v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [zone complete v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinthboss v]\nset size to (300) %\nhide\nforever\n    go to (eggman v)\nend\n\nwhen backdrop switches to [starlight3 v]\nset size to (300) %\nhide\nforever\n    go to (eggman v)\nend\n\nwhen backdrop switches to [death eggboss v]\nset size to (300) %\nhide\nforever\n    go to (shadow v)\nend\n\nwhen backdrop switches to [gadget gauntletboss v]\nset size to (300) %\nhide\nforever\n    go to (eggman v)\nend\n\n@goal\n\ndefine Clone at x - (x) y - (y)\nset [-x v] to (x)\nset [-y v] to (y)\n\nwhen I receive [set up v]\nswitch costume to (egghead2 v)\nhide\nset size to (120) %\nset [-x v] to [0]\nset [-y v] to [0]\nif <(LEVEL) = [GHZ]> then\n    Clone at x - [3320] y - [-95]\nelse\n    if <(LEVEL) = [GHZ2]> then\n        Clone at x - [3835] y - [-95]\n    else\n        if <(LEVEL) = [LZ]> then\n            Clone at x - [6722] y - [-75]\n        else\n            if <(LEVEL) = [LZ2]> then\n                Clone at x - [2300] y - [-75]\n            else\n                if <(LEVEL) = [SLZ]> then\n                    Clone at x - [5300] y - [-89]\n                else\n                    if <(LEVEL) = [SLZ2]> then\n                        Clone at x - [5700] y - [-89]\n                    else\n                        if <(LEVEL) = [DEZ]> then\n                            Clone at x - [7517] y - [-89]\n                        else\n                            if <(LEVEL) = [GGZ]> then\n                                Clone at x - [8797] y - [-89]\n                            end\n                        end\n                    end\n                end\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 [tick v]\nPosition ((-x) - (SCROLL X)) (-y)\nif <<(costume [number v]) = [1]> and <touching (sonic the hedgehog v)?>> then\n    set [exit v] to [Win]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [victory v]\nset [brightness v] effect to (0)\nswitch costume to (egghead2 v)\nwait (1) seconds\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nswitch costume to (costume2 v)\nwait (1) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen backdrop switches to [begin game v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hills loading v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death egg loading v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet loading v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\n@Sonic the hedgehog\n\nwhen I receive [play game v]\nforever\n    if <(y position) < [-150]> then\n        set [exit v] to [dead]\n        wait (5) seconds\n    end\nend\n\nwhen I receive [bounce v]\nset [-sy v] to [25]\n\nwhen flag clicked\nhide variable [player: -x v]\nhide variable [player: -y v]\nhide variable [points x v]\nhide variable [-sy v]\nhide variable [-sx v]\nhide variable [-y v]\nhide variable [-x v]\nset size to (100) %\nbroadcast (Green Flag v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset volume to (100) %\nset [ending action? v] to [0]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Set up v) and wait\n    Game on\n    broadcast (glitch detection v)\n    if <(backdrop [number v]) = [14]> then\n        broadcast (underwater v)\n    end\n    repeat until <(EXIT) > []>\n        broadcast (Tick v)\n        Tick\n    end\n    if <(EXIT) = [Win]> then\n        Game - Win\n    else\n        Game - Die\n    end\nend\n\ndefine Game on\nset [stop moving v] to [yes]\nset [ghost v] effect to (100)\nset [player: -x v] to [-150]\nif <<(LEVEL) = [GHZ]> or <<(LEVEL) = [GHZ2]> or <(LEVEL) = [GHZ3]>>> then\n    set [player: -y v] to [-100]\nend\nif <<(LEVEL) = [LZ]> or <<(LEVEL) = [LZ2]> or <(LEVEL) = [LZ3]>>> then\n    set [player: -y v] to [-80]\nend\nif <<(LEVEL) = [SLZ]> or <<(LEVEL) = [SLZ2]> or <(LEVEL) = [SLZ3]>>> then\n    set [player: -y v] to [-88]\nend\nif <<(LEVEL) = [DEZ]> or <(LEVEL) = [DEZ2]>> then\n    set [player: -y v] to [-97]\nend\nif <<(LEVEL) = [GGZ]> or <(LEVEL) = [GGZ2]>> then\n    set [player: -y v] to [-96]\nend\nset [-sx v] to [0]\nif <not <(backdrop [number v]) = [14]>> then\n    set [-sy v] to [0]\nend\nif <(backdrop [number v]) = [14]> then\n    set [-sy v] to [0]\nend\nset [-in air v] to [0]\nset [exit v] to []\nset [dead v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [flashing v] to [0]\nset size to (100) %\npoint in direction (90)\nset rotation style [left-right v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nshow\n\ndefine Tick\nif <(MOBILE MODE) = [ON]> then\n    set [-sx v] to ((-sx) * (0.7))\nelse\n    set [-sx v] to ((-sx) * (0.7))\n    if <(hanging on tails) = [yes]> then\n        set [hanging on tails v] to [no]\n        repeat (150)\n            change [-sx v] by (1)\n        end\n    end\n    if <<<<(touch left) = [1]> or <(touch up left) = [1]>> and <(Mobile mode on?) = [yes]>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <(PC mode on?) = [yes]>>> then\n        if <<not <(backdrop [number v]) = [8]>> and <<not <(backdrop [number v]) = [15]>> and <<not <(backdrop [number v]) = [19]>> and <<not <(backdrop [number v]) = [22]>> and <not <(backdrop [number v]) = [25]>>>>>> then\n            if <(hanging on tails) = [no]> then\n                if <(stop moving) = [no]> then\n                    if <not <(backdrop [number v]) = [14]>> then\n                        if <(stop moving) = [no]> then\n                            if <(left collision) = [0]> then\n                                if <(left collision) = [0]> then\n                                    if <(x position) > [-27]> then\n                                        change [background scrollx v] by (-1)\n                                    end\n                                end\n                                if <(left collision) = [0]> then\n                                    if <(stop moving) = [no]> then\n                                        change [-sx v] by (-4)\n                                        point in direction (-90)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                    if <(backdrop [number v]) = [14]> then\n                        if <(left collision) = [0]> then\n                            if <(stop moving) = [no]> then\n                                change [-sx v] by (-1)\n                                point in direction (-90)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    if <<<<(touch right) = [1]> or <(touch up right) = [1]>> and <(Mobile mode on?) = [yes]>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <(PC mode on?) = [yes]>>> then\n        if <<not <(backdrop [number v]) = [8]>> and <<not <(backdrop [number v]) = [15]>> and <<not <(backdrop [number v]) = [19]>> and <<not <(backdrop [number v]) = [22]>> and <not <(backdrop [number v]) = [25]>>>>>> then\n            if <(hanging on tails) = [no]> then\n                if <(stop moving) = [no]> then\n                    if <not <(backdrop [number v]) = [14]>> then\n                        if <(right collision) = [0]> then\n                            if <(right collision) = [0]> then\n                                if <(stop moving) = [no]> then\n                                    if <(x position) > [-1]> then\n                                        change [background scrollx v] by (1)\n                                    end\n                                end\n                            end\n                            if <(right collision) = [0]> then\n                                if <(stop moving) = [no]> then\n                                    change [-sx v] by (4)\n                                    point in direction (90)\n                                end\n                            end\n                        end\n                    end\n                    if <(backdrop [number v]) = [14]> then\n                        if <(right collision) = [0]> then\n                            if <(stop moving) = [no]> then\n                                change [-sx v] by (1)\n                                point in direction (90)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nif <([abs v] of (-sx) ) > [0.8]> then\n    Change Player X by (round (-sx))\nend\nif <(MOBILE MODE) = [ON]> then\nif <(-sy) > [-15]> then\n    if <not <(backdrop [number v]) = [14]>> then\n        if <(stop moving) = [no]> then\n            change [-sy v] by (-2)\n        end\n    end\n    if <(backdrop [number v]) = [14]> then\n        if <(-sy) > [3]> then\n            if <(stop moving) = [no]> then\n                change [-sy v] by (-0.5)\n            end\n        else\n            if <(stop moving) = [no]> then\n                change [-sy v] by (-2)\n            end\n        end\n    end\nend\nChange Player Y by (-sy)\nPosition\nchange [scroll x v] by (round (((Player: -x) - (SCROLL X)) / (3)))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nPosition\nSet Costume\n\ndefine Change Player Y by (sy)\nif <(hanging on tails) = [no]> then\n    if <(top collision) = [0]> then\n        if <(stop moving) = [no]> then\n            change [player: -y v] by (sy)\n        end\n    end\n    if <(top collision) = [0]> then\n        change [-in air v] by (1)\n    end\n    Position\n    repeat until <not <<touching (platforms v)?> or <touching (ghost plat v)?>>>\n        if <(sy) > [0]> then\n            if <(top collision) = [0]> then\n                if <(stop moving) = [no]> then\n                    change [player: -y v] by (-1)\n                end\n            end\n        else\n            if <(top collision) = [0]> then\n                if <(stop moving) = [no]> then\n                    change [player: -y v] by (1)\n                    set [-in air v] to [0]\n                end\n            end\n        end\n        Position\n        if <(top collision) = [0]> then\n            set [-sy v] to [0]\n        end\n    end\nend\n\ndefine Change Player X by (sx)\nif <<<(top collision) = [0]> and <(right collision) = [0]>> and <(left collision) = [0]>> then\n    if <(stop moving) = [no]> then\n        change [player: -x v] by (sx)\n    end\nend\nPosition\nif <<touching (ghost plat v)?> or <touching (platforms v)?>> then\n    if <(hanging on tails) = [no]> then\n        repeat (12)\n            if <(stop moving) = [no]> then\n                if <(top collision) = [0]> then\n                    change [player: -y v] by (2)\n                    Position\n                    if <not <touching (platforms v)?>> then\n                        stop [this script v]\n                    end\n                end\n            end\n        end\n        if <(stop moving) = [no]> then\n            if <(top collision) = [0]> then\n                if <(stop moving) = [no]> then\n                    change [player: -y v] by (-12)\n                end\n            end\n        end\n    end\n    if <(WALL JUMP?) = [ON]> then\n        if <<<key (space v) pressed?> or <key (w v) pressed?>> and <(PC mode on?) = [yes]>> then\n            if <(sx) > [0]> then\n                if <<<(left collision) = [0]> and <(right collision) = [0]>> and <(stop moving) = [no]>> then\n                    if <(stop moving) = [no]> then\n                        set [-sx v] to [-20]\n                    end\n                end\n            else\n                if <<<(left collision) = [0]> and <(right collision) = [0]>> and <(stop moving) = [no]>> then\n                    if <(stop moving) = [no]> then\n                        set [-sx v] to [20]\n                    end\n                end\n            end\n            set [-in air v] to [0]\n        else\n            set [-sx v] to [0]\n        end\n    else\n        if <not <(top collision) = [1]>> then\n            repeat until <not <touching (platforms v)?>>\n                if <(sx) > [0]> then\n                    if <(stop moving) = [no]> then\n                        change [player: -x v] by (-1)\n                    end\n                else\n                    if <(stop moving) = [no]> then\n                        change [player: -x v] by (1)\n                    end\n                end\n                Position\n            end\n        end\n    end\nend\n\ndefine Game - Die\nstart sound [SonicDash v]\nset [stop moving v] to [yes]\nswitch costume to (sonic die 1-disfraz1 v)\nrepeat (10)\n    change y by (10)\nend\nbroadcast (dead in game v)\nrepeat until <(y position) < [-175]>\n    change [-sy v] by (-1)\n    change y by (-sy)\nend\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nset [exit v] to []\nset [-sy v] to [15]\nchange [lives v] by (-1)\nhide\nwait (0.5) seconds\nif <(Lives) < [1]> then\n    broadcast (game over v) and wait\nend\n\ndefine Game - Win\nclear graphic effects\nbroadcast (Victory v) and wait\n\ndefine Set Costume\nif <(hanging on tails) = [no]> then\n    if <(backdrop [number v]) = [22]> then\n        if <(-sy) < [-4]> then\n            if <(costume [number v]) < [45]> then\n                switch costume to (129863-48 \(1\) v)\n                set [spin attack v] to [yes]\n            end\n            next costume\n            if <(costume [number v]) > [60]> then\n                switch costume to (129863-48 \(1\) v)\n                set [spin attack v] to [yes]\n            end\n        else\n            if <<(-sy) = [0]> or <<(-sy) < [3]> and <not <(-sy) < [-12]>>>> then\n                switch costume to (-walk)\n                set [spin attack v] to [no]\n                if <not <touching (platforms v)?>> then\n                    set [spin attack v] to [no]\n                end\n            else\n                if <(costume [number v]) < [45]> then\n                    switch costume to (129863-48 \(1\) v)\n                    set [spin attack v] to [yes]\n                end\n                next costume\n                if <(costume [number v]) > [60]> then\n                    switch costume to (129863-48 \(1\) v)\n                    set [spin attack v] to [yes]\n                end\n            end\n        end\n    end\n    if <not <(backdrop [number v]) = [22]>> then\n        if <<(-sy) < [0]> and <(backdrop [number v]) = [14]>> then\n            if <(costume [number v]) < [45]> then\n                switch costume to (129863-48 \(1\) v)\n                set [spin attack v] to [yes]\n            end\n            next costume\n            if <(costume [number v]) > [60]> then\n                switch costume to (129863-48 \(1\) v)\n                set [spin attack v] to [yes]\n            end\n        else\n            if <(costume [number v]) < [45]> then\n                switch costume to (129863-48 \(1\) v)\n                set [spin attack v] to [yes]\n            end\n            next costume\n            if <(costume [number v]) > [60]> then\n                switch costume to (129863-48 \(1\) v)\n                set [spin attack v] to [yes]\n            end\n        end\n        if <<(-sy) < [0 ]> or <<(-sy) < [0 ]> and <<<(touch up right) = [1]> or <(touch up) = [1]>> or <(touch up left) = [1]>>>> then\n            if <(costume [number v]) < [45]> then\n                switch costume to (129863-48 \(1\) v)\n                set [spin attack v] to [yes]\n            end\n            next costume\n            if <(costume [number v]) > [60]> then\n                switch costume to (129863-48 \(1\) v)\n                set [spin attack v] to [yes]\n            end\n        else\n            if <(costume [number v]) < [45]> then\n                switch costume to (129863-48 \(1\) v)\n                set [spin attack v] to [yes]\n            end\n            next costume\n            if <(costume [number v]) > [60]> then\n                switch costume to (129863-48 \(1\) v)\n                set [spin attack v] to [yes]\n            end\n        end\n    end\n    if <not <(backdrop [number v]) = [22]>> then\n        if <<(-sy) = [0]> or <<(-sy) < [3]> and <not <(-sy) < [-12]>>>> then\n            switch costume to (idle v)\n            set [spin attack v] to [no]\n        end\n        if <<<<<(touch left) = [1]> or <(touch right) = [1]>> and <not <<<(touch up right) = [1]> or <(touch up) = [1]>> or <(touch up left) = [1]>>>> and <(Mobile mode on?) = [yes]>> or <<<(-sy) = [0]> or <<(-sy) < [3]> and <not <(-sy) < [-12]>>>> and <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> and <(PC mode on?) = [yes]>>>> then\n            if <(stop moving) = [no]> then\n                switch costume to (-walk)\n                set [spin attack v] to [no]\n            end\n        end\n    end\nelse\n    switch costume to (sonic fall 1-disfraz1 v)\n    wait (0) seconds\n    switch costume to (sonic fall 2 v)\n    wait (0) seconds\nend\n\nwhen I receive [tick v]\nchange [-walk v] by (1)\nif <(-walk) > [29]> then\n    set [-walk v] to [22]\nend\n\ndefine Position\nif <<<not <(backdrop [number v]) = [8]>> and <not <(backdrop [number v]) = [15]>>> and <<not <(backdrop [number v]) = [19]>> and <not <<(backdrop [number v]) = [22]> or <(backdrop [number v]) = [25]>>>>> then\n    go to x: ((Player: -x) - (SCROLL X)) y: (Player: -y)\nend\nif <<(backdrop [number v]) = [8]> or <<(backdrop [number v]) = [15]> or <<(backdrop [number v]) = [19]> or <<(backdrop [number v]) = [22]> or <(backdrop [number v]) = [25]>>>>> then\n    set y to (Player: -y)\nend\n\nwhen I receive [hurt v]\nset [flashing v] to [1]\nset [exit v] to [Die]\nstop [this script v]\n\nwhen I receive [game over v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [end v]\nset volume to (0) %\nbroadcast (Credits v)\nforever\n    stop [other scripts in sprite v]\nend\n\nwhen backdrop switches to [green hills v]\nbroadcast (Play Game v)\nwait (2) seconds\nset [stop moving v] to [no]\nforever\n    broadcast (stop moving v) and wait\nend\n\nwhen I receive [walking cutscene v]\nrepeat (10)\n    switch costume to (walkedit-0 v)\n    wait (0) seconds\n    switch costume to (walkedit-1 v)\n    wait (0) seconds\n    switch costume to (walkedit-2 v)\n    wait (0) seconds\n    switch costume to (walkedit-3 v)\n    wait (0) seconds\n    switch costume to (walkedit-4 v)\n    wait (0) seconds\n    switch costume to (walkedit-5 v)\n    wait (0) seconds\n    switch costume to (walkedit-6 v)\n    wait (0) seconds\n    switch costume to (walkedit-7 v)\n    wait (0) seconds\n    switch costume to (walkedit-8 v)\n    wait (0) seconds\n    switch costume to (walkedit-9 v)\n    wait (0) seconds\n    switch costume to (walkedit-10 v)\n    wait (0) seconds\n    switch costume to (walkedit-11 v)\n    wait (0) seconds\nend\n\nwhen I receive [dead v]\nswitch costume to (sonic die 1-disfraz1 v)\nwait (0.1) seconds\nswitch costume to (sonic die 1-disfraz2 v)\nwait (0.1) seconds\nswitch costume to (sonic die 1-disfraz3 v)\nwait (0.1) seconds\nswitch costume to (sonic die 1-disfraz4 v)\nwait (0.1) seconds\nswitch costume to (sonic die 1-disfraz5 v)\n\nwhen I receive [dead in game v]\nswitch costume to (sonic die 1-disfraz1 v)\nwait (0.08) seconds\nswitch costume to (sonic die 1-disfraz2 v)\nwait (0.08) seconds\nswitch costume to (sonic die 1-disfraz3 v)\nwait (0.08) seconds\nswitch costume to (sonic die 1-disfraz4 v)\nwait (0.08) seconds\nswitch costume to (sonic die 1-disfraz5 v)\n\nwhen backdrop switches to [beginning of game cutscene v]\nstop [other scripts in sprite v]\nshow\npoint in direction (90)\nset rotation style [left-right v]\nset size to (100) %\ngo to [front v] layer\nbroadcast (walking cutscene v)\ngo to x: (-230) y: (-98)\nglide (2) secs to x: (-163) y: (-98)\nstop [other scripts in sprite v]\ngo to x: (-163) y: (-101)\nswitch costume to (dchak5v-9de65aae-11ea-4376-a2a5-9f191132d749 v)\nwait (9) seconds\ngo to x: (-138) y: (-96)\nswitch costume to (costume3 v)\nrepeat (20)\n    glide (0.0001) secs to x: (-139) y: (-91)\n    glide (0.0001) secs to x: (-139) y: (-96)\nend\nbroadcast (dead v)\nglide (1) secs to x: (-7) y: (14)\nrepeat (50)\n    change size by (-2)\n    turn right (15) degrees\n    move (10) steps\nend\nhide\nwait (2) seconds\nbroadcast (ring loss v)\n\ndefine jump sfx\nif <<(hanging on tails) = [no]> and <(stop moving) = [no]>> then\n    if <<<<key (space v) pressed?> or <key (w v) pressed?>> and <(PC mode on?) = [yes]>> or <<<(touch up left) = [1]> or <<(touch up right) = [1]> or <(touch up) = [1]>>> and <(Mobile mode on?) = [yes]>>> then\n        start sound [Sonic Jump v]\n        wait until <(-sy) = [0]>\n    end\nend\n\nwhen I receive [play game v]\nset volume to (100) %\nset [ending action? v] to [0]\nforever\n    jump sfx\nend\n\nwhen I receive [victory v]\nstop [other scripts in sprite v]\nswitch costume to (dchak5v-9de65aae-11ea-4376-a2a5-9f191132d749 v)\nif <not <touching (platforms v)?>> then\n    repeat until <touching (platforms v)?>\n        change y by (-6)\n    end\nend\nwait (1) seconds\nrepeat (14)\n    next costume\n    wait (0.02) seconds\nend\nwait (3) seconds\nif <(LEVEL) = [GHZ]> then\n    broadcast (reset for victory v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    set [level v] to [GHZ2]\n    stop [other scripts in sprite v]\n    broadcast (screen transition loading green hills v) and wait\n    stop [this script v]\nend\nif <(LEVEL) = [GHZ2]> then\n    broadcast (reset for victory v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    set [level v] to [GHZ3]\n    stop [other scripts in sprite v]\n    broadcast (screen transition loading green hills v) and wait\n    stop [this script v]\nend\nif <(LEVEL) = [GHZ3]> then\n    broadcast (reset for victory v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    set [level v] to [GHZ3]\n    stop [other scripts in sprite v]\n    broadcast (screen transition zone complete! v) and wait\n    stop [this script v]\nend\nif <(LEVEL) = [LZ]> then\n    broadcast (reset for victory v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    set [level v] to [LZ2]\n    stop [other scripts in sprite v]\n    broadcast (screen transition loading labyrinth v) and wait\n    stop [this script v]\nend\nif <(LEVEL) = [LZ2]> then\n    broadcast (reset for victory v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    set [level v] to [LZ3]\n    broadcast (screen transition loading labyrinth v) and wait\n    stop [this script v]\nend\nif <(LEVEL) = [LZ3]> then\n    broadcast (reset for victory v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    set [level v] to [LZ3]\n    stop [other scripts in sprite v]\n    broadcast (screen transition zone complete! v) and wait\n    stop [this script v]\nend\nif <(LEVEL) = [SLZ]> then\n    broadcast (reset for victory v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    set [level v] to [SLZ2]\n    stop [other scripts in sprite v]\n    broadcast (screen transition loading starlight  v) and wait\n    stop [this script v]\nend\nif <(LEVEL) = [SLZ2]> then\n    broadcast (reset for victory v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    set [level v] to [SLZ3]\n    stop [other scripts in sprite v]\n    broadcast (screen transition loading starlight  v) and wait\n    stop [this script v]\nend\nif <(LEVEL) = [SLZ3]> then\n    broadcast (reset for victory v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    set [level v] to [SLZ3]\n    stop [other scripts in sprite v]\n    broadcast (screen transition zone complete! v) and wait\n    stop [this script v]\nend\nif <(LEVEL) = [DEZ]> then\n    broadcast (reset for victory v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    set [level v] to [DEZ2]\n    stop [other scripts in sprite v]\n    broadcast (screen transition loading death egg v) and wait\n    stop [this script v]\nend\nif <(LEVEL) = [DEZ2]> then\n    broadcast (reset for victory v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    set [level v] to [DEZ2]\n    stop [other scripts in sprite v]\n    broadcast (screen transition zone complete! v) and wait\n    stop [this script v]\nend\nif <(LEVEL) = [GGZ]> then\n    broadcast (reset for victory v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    set [level v] to [GGZ2]\n    stop [other scripts in sprite v]\n    broadcast (screen transition gadget gauntlet v) and wait\n    stop [this script v]\nend\n\nwhen backdrop switches to [green hills2 v]\nbroadcast (Play Game v)\nwait (2) seconds\nset [stop moving v] to [no]\nforever\n    broadcast (stop moving v) and wait\nend\n\nwhen backdrop switches to [green hills loading v]\nset [player: -x v] to [-150]\nif <not <(LEVEL) = [GHZ3]>> then\n    set [player: -y v] to [-100]\nelse\n    set [player: -y v] to [0]\nend\nset [-sx v] to [0]\nset [-sy v] to [0]\nset [-in air v] to [0]\nset [exit v] to []\nset [dead v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [flashing v] to [0]\n\ndefine collision top\nif <(stop moving) = [no]> then\n    if <(top collision) = [1]> then\n        set [-sy v] to [0]\n        repeat until <(top collision) = [0]>\n            if <(stop moving) = [no]> then\n                change [-sy v] by (-5)\n                change [player: -y v] by (-5)\n            end\n        end\n    end\nend\nif <(stop moving) = [yes]> then\n    set [top collision v] to [0]\nend\n\nwhen I receive [play game v]\nwait (1) seconds\nforever\n    collision top\nend\n\nwhen backdrop switches to [green hillsboss v]\nbroadcast (reset for victory v)\nset [stop moving v] to [no]\nset [ghost v] effect to (100)\nswitch costume to (idle v)\ngo to x: (-186) y: (-101)\npoint in direction (90)\nset rotation style [left-right v]\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nshow\nforever\n    broadcast (glitch detection v)\n    repeat until <(EXIT) > []>\n        boss tick\n        broadcast (boss tick v)\n    end\n    if <(EXIT) = [Win]> then\n        Game - Win\n    else\n        Game - die boss\n    end\nend\n\nwhen backdrop switches to [green hillsboss v]\nwait (1) seconds\nforever\n    if <<<<(touch right) = [1]> or <(touch up right) = [1]>> and <(Mobile mode on?) = [yes]>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <<(PC mode on?) = [yes]> and <(stop moving) = [no]>>>> then\n        point in direction (90)\n        set rotation style [left-right v]\n        change x by (11)\n    end\n    if <<<<(touch left) = [1]> or <(touch up left) = [1]>> and <(Mobile mode on?) = [yes]>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <<(PC mode on?) = [yes]> and <(stop moving) = [no]>>>> then\n        point in direction (-90)\n        set rotation style [left-right v]\n        change x by (-11)\n    end\nend\n\ndefine boss tick\nif <<<<(touch up left) = [1]> or <<(touch up right) = [1]> or <(touch up) = [1]>>> and <(Mobile mode on?) = [yes]>> or <<<key (space v) pressed?> or <key (w v) pressed?>> and <(PC mode on?) = [yes]>>> then\n    if <<(-in air) < [4]> and <(stop moving) = [no]>> then\n        set [-sy v] to [21]\n    end\nend\nif <<(-sy) > [-15]> and <(stop moving) = [no]>> then\n    change [-sy v] by (-2)\nend\nif <(stop moving) = [no]> then\n    Change Player Y by (-sy)\nend\nSet Costume\n\nwhen backdrop switches to [green hillsboss v]\nwait (1) seconds\nforever\n    collision top\nend\n\ndefine Game - die boss\nstop [other scripts in sprite v]\nstart sound [SonicDash v]\nswitch costume to (sonic die 1-disfraz1 v)\nrepeat (10)\n    change y by (10)\nend\nbroadcast (dead in game v)\nrepeat until <(y position) < [-175]>\n    change [-sy v] by (-1)\n    change y by (-sy)\nend\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nif <(backdrop [number v]) = [8]> then\n    set [exit v] to []\n    set [-sy v] to [15]\n    set [player: -y v] to [0]\n    change [lives v] by (-1)\n    hide\n    stop [other scripts in sprite v]\n    if <(Lives) < [1]> then\n        stop [other scripts in sprite v]\n        wait (0.5) seconds\n        broadcast (game over v) and wait\n    end\n    switch backdrop to (green hillsboss v)\n    stop [this script v]\nend\nif <(backdrop [number v]) = [15]> then\n    set [exit v] to []\n    set [-sy v] to [15]\n    set [player: -y v] to [0]\n    change [lives v] by (-1)\n    hide\n    stop [other scripts in sprite v]\n    if <(Lives) < [1]> then\n        stop [other scripts in sprite v]\n        wait (0.5) seconds\n        broadcast (game over v) and wait\n    end\n    switch backdrop to (labyrinthboss v)\n    stop [this script v]\nend\nif <(backdrop [number v]) = [19]> then\n    set [exit v] to []\n    set [player: -y v] to [0]\n    set [-sy v] to [15]\n    change [lives v] by (-1)\n    hide\n    stop [other scripts in sprite v]\n    if <(Lives) < [1]> then\n        stop [other scripts in sprite v]\n        wait (0.5) seconds\n        broadcast (game over v) and wait\n    end\n    switch backdrop to (starlight3 v)\n    stop [this script v]\nend\nif <(backdrop [number v]) = [22]> then\n    set [exit v] to []\n    set [player: -y v] to [0]\n    set [-sy v] to [15]\n    change [lives v] by (-1)\n    hide\n    stop [other scripts in sprite v]\n    if <(Lives) < [1]> then\n        stop [other scripts in sprite v]\n        wait (0.5) seconds\n        broadcast (game over v) and wait\n    end\n    switch backdrop to (death eggboss v)\n    stop [this script v]\nend\nif <(backdrop [number v]) = [25]> then\n    set [exit v] to []\n    set [player: -y v] to [0]\n    set [-sy v] to [15]\n    change [lives v] by (-1)\n    hide\n    stop [other scripts in sprite v]\n    if <(Lives) < [1]> then\n        stop [other scripts in sprite v]\n        wait (0.5) seconds\n        broadcast (game over v) and wait\n    end\n    switch backdrop to (gadget gauntletboss v)\n    stop [this script v]\nend\n\nwhen I receive [reset for victory v]\nset [player: -x v] to [-150]\nset [player: -y v] to [0]\nset [-sx v] to [0]\nset [-sy v] to [0]\nset [-in air v] to [0]\nset [exit v] to []\nset [dead v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [flashing v] to [0]\n\nwhen backdrop switches to [zone complete v]\nstop [other scripts in sprite v]\nshow\nset [ghost v] effect to (0)\nset size to (200) %\ngo to x: (0) y: (-27)\nswitch costume to (dchak5v-9de65aae-11ea-4376-a2a5-9f191132d749 v)\nwait (0.5) seconds\nwait (1) seconds\nrepeat (14)\n    next costume\n    wait (0.02) seconds\nend\n\nwhen backdrop switches to [begin game v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth v]\nbroadcast (Play Game v)\nforever\n    broadcast (stop moving v) and wait\nend\n\nwhen backdrop switches to [labyrinth2 v]\nbroadcast (Play Game v)\nwait (2) seconds\nset [stop moving v] to [no]\nforever\n    if <(stop moving) = [yes]> then\n        broadcast (stop moving v) and wait\n    end\nend\n\nwhen I receive [underwater v]\nforever\n    start sound [Underwater Air timer v]\n    wait (5) seconds\nend\n\nwhen backdrop switches to [labyrinthboss v]\nwait (1) seconds\nforever\n    if <<<<(touch right) = [1]> or <(touch up right) = [1]>> and <(Mobile mode on?) = [yes]>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <<(PC mode on?) = [yes]> and <(stop moving) = [no]>>>> then\n        point in direction (90)\n        set rotation style [left-right v]\n        change x by (3)\n    end\n    if <<<<(touch left) = [1]> or <(touch up left) = [1]>> and <(Mobile mode on?) = [yes]>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <<(PC mode on?) = [yes]> and <(stop moving) = [no]>>>> then\n        point in direction (-90)\n        set rotation style [left-right v]\n        change x by (-3)\n    end\nend\n\nwhen backdrop switches to [labyrinthboss v]\nbroadcast (underwater v)\nbroadcast (reset for victory v)\nset [stop moving v] to [no]\nset [ghost v] effect to (100)\nswitch costume to (idle v)\ngo to x: (-186) y: (90)\npoint in direction (90)\nset rotation style [left-right v]\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nshow\nforever\n    broadcast (glitch detection v)\n    repeat until <(EXIT) > []>\n        boss tick\n        broadcast (boss tick v)\n    end\n    if <(EXIT) = [Win]> then\n        Game - Win\n    else\n        Game - die boss\n    end\nend\n\nwhen backdrop switches to [starlight v]\nbroadcast (Play Game v)\nforever\n    broadcast (stop moving v) and wait\nend\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight2 v]\nbroadcast (Play Game v)\nforever\n    broadcast (stop moving v) and wait\nend\n\nwhen backdrop switches to [starlight3 v]\nwait (1) seconds\nforever\n    if <<<<(touch right) = [1]> or <(touch up right) = [1]>> and <(Mobile mode on?) = [yes]>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <<(PC mode on?) = [yes]> and <(stop moving) = [no]>>>> then\n        point in direction (90)\n        set rotation style [left-right v]\n        change x by (11)\n    end\n    if <<<<(touch left) = [1]> or <(touch up left) = [1]>> and <(Mobile mode on?) = [yes]>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <<(PC mode on?) = [yes]> and <(stop moving) = [no]>>>> then\n        point in direction (-90)\n        set rotation style [left-right v]\n        change x by (-11)\n    end\nend\n\nwhen backdrop switches to [starlight3 v]\nbroadcast (reset for victory v)\nset [stop moving v] to [no]\nset [ghost v] effect to (100)\nswitch costume to (idle v)\ngo to x: (-182) y: (-90)\npoint in direction (90)\nset rotation style [left-right v]\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nshow\nforever\n    broadcast (glitch detection v)\n    repeat until <(EXIT) > []>\n        boss tick\n        broadcast (boss tick v)\n    end\n    if <(EXIT) = [Win]> then\n        Game - Win\n    else\n        Game - die boss\n    end\nend\n\nwhen backdrop switches to [starlight3 v]\nset volume to (100) %\nforever\n    jump sfx\nend\n\nwhen backdrop switches to [labyrinthboss v]\nset volume to (100) %\nforever\n    jump sfx\nend\n\nwhen backdrop switches to [green hillsboss v]\nset volume to (100) %\nforever\n    jump sfx\nend\n\nwhen backdrop switches to [death egg v]\nbroadcast (Play Game v)\nwait (2) seconds\nset [stop moving v] to [no]\nforever\n    if <(stop moving) = [yes]> then\n        broadcast (stop moving v) and wait\n    end\nend\n\ndefine collision left\nif <(stop moving) = [no]> then\n    if <<(left collision) = [1]> and <(right collision) = [0]>> then\n        repeat until <(left collision) = [0]>\n            change [player: -x v] by (7)\n            change [-sx v] by (5)\n        end\n    end\nend\nif <(stop moving) = [yes]> then\n    set [left collision v] to [0]\nend\n\ndefine collision right\nif <<(right collision) = [1]> and <(left collision) = [0]>> then\n    repeat until <(right collision) = [0]>\n        change [player: -x v] by (-7)\n        change [-sx v] by (-5)\n        if <(backdrop [number v]) = [24]> then\n            change [-sx v] by (-7)\n        end\n    end\nend\n\nwhen I receive [play game v]\nwait (1) seconds\nforever\n    collision left\nend\n\nwhen I receive [play game v]\nwait (1) seconds\nforever\n    collision right\nend\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [reset shadow v]\nset [-x v] to [0]\nset [-sx v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [-sy v] to [0]\n\nwhen backdrop switches to [death eggboss v]\nwait (1) seconds\nforever\n    if <<<<(touch right) = [1]> or <(touch up right) = [1]>> and <(Mobile mode on?) = [yes]>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <<(PC mode on?) = [yes]> and <(stop moving) = [no]>>>> then\n        point in direction (90)\n        set rotation style [left-right v]\n        change x by (7)\n    end\n    if <<<<(touch left) = [1]> or <(touch up left) = [1]>> and <(Mobile mode on?) = [yes]>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <<(PC mode on?) = [yes]> and <(stop moving) = [no]>>>> then\n        point in direction (90)\n        set rotation style [left-right v]\n        change x by (-7)\n    end\nend\n\nwhen backdrop switches to [death eggboss v]\nset [stop moving v] to [no]\nbroadcast (reset for victory v)\nset [ghost v] effect to (100)\nswitch costume to (idle v)\ngo to x: (-186) y: (90)\npoint in direction (90)\nset rotation style [left-right v]\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nshow\nforever\n    broadcast (glitch detection v)\n    repeat until <(EXIT) > []>\n        boss tick\n        broadcast (boss tick v)\n    end\n    if <(EXIT) = [Win]> then\n        Game - Win\n    else\n        Game - die boss\n    end\nend\n\nwhen backdrop switches to [death eggboss v]\nset volume to (100) %\nforever\n    jump sfx\nend\n\nwhen backdrop switches to [gadget gauntlet loading v]\nset [player: -x v] to [-150]\nif <not <(LEVEL) = [GGZ2]>> then\n    set [player: -y v] to [-100]\nelse\n    set [player: -y v] to [0]\nend\nset [-sx v] to [0]\nset [-sy v] to [0]\nset [-in air v] to [0]\nset [exit v] to []\nset [dead v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [flashing v] to [0]\n\nwhen backdrop switches to [starlight loading v]\nset [player: -x v] to [-150]\nif <not <(LEVEL) = [SLZ3]>> then\n    set [player: -y v] to [-100]\nelse\n    set [player: -y v] to [0]\nend\nset [-sx v] to [0]\nset [-sy v] to [0]\nset [-in air v] to [0]\nset [exit v] to []\nset [dead v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [flashing v] to [0]\n\nwhen backdrop switches to [labyrinth loading v]\nset [player: -x v] to [-150]\nif <not <(LEVEL) = [LZ3]>> then\n    set [player: -y v] to [-100]\nelse\n    set [player: -y v] to [0]\nend\nset [-sx v] to [0]\nset [-sy v] to [0]\nset [-in air v] to [0]\nset [exit v] to []\nset [dead v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [flashing v] to [0]\n\nwhen backdrop switches to [gadget gauntlet v]\nbroadcast (Play Game v)\nwait (2) seconds\nset [stop moving v] to [no]\nforever\n    broadcast (stop moving v) and wait\nend\n\nwhen backdrop switches to [gadget gauntlet loading v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntletboss v]\nset [stop moving v] to [no]\nbroadcast (reset for victory v)\nset [ghost v] effect to (100)\nswitch costume to (idle v)\ngo to x: (-186) y: (90)\npoint in direction (90)\nset rotation style [left-right v]\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nshow\nforever\n    broadcast (glitch detection v)\n    repeat until <(EXIT) > []>\n        boss tick\n        broadcast (boss tick v)\n    end\n    if <(EXIT) = [Win]> then\n        Game - Win\n    else\n        Game - die boss\n    end\nend\n\nwhen backdrop switches to [gadget gauntletboss v]\nwait (1) seconds\nforever\n    if <<<<(touch right) = [1]> or <(touch up right) = [1]>> and <(Mobile mode on?) = [yes]>> or <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <<(PC mode on?) = [yes]> and <(stop moving) = [no]>>>> then\n        point in direction (90)\n        set rotation style [left-right v]\n        change x by (11)\n    end\n    if <<<<(touch left) = [1]> or <(touch up left) = [1]>> and <(Mobile mode on?) = [yes]>> or <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <<(PC mode on?) = [yes]> and <(stop moving) = [no]>>>> then\n        point in direction (-90)\n        set rotation style [left-right v]\n        change x by (-11)\n    end\nend\n\nwhen backdrop switches to [gadget gauntletboss v]\nset volume to (100) %\nforever\n    jump sfx\nend\n\nwhen I receive [#1 victory v]\nstop [other scripts in sprite v]\nswitch costume to (dchak5v-9de65aae-11ea-4376-a2a5-9f191132d749 v)\nwait (0.5) seconds\nwait (1) seconds\nrepeat (14)\n    next costume\n    wait (0.02) seconds\nend\nwait (3) seconds\nbroadcast (reset for victory v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nbroadcast (ending screen transition  v) and wait\nstop [this script v]\n\nwhen backdrop switches to [gadget gauntlet cutscene v]\nset size to (100) %\npoint in direction (90)\nset rotation style [left-right v]\nstop [other scripts in sprite v]\ngo to x: (-185) y: (-97)\nset [ghost v] effect to (0)\nshow\ngo to [front v] layer\nswitch costume to (idle v)\n\nwhen backdrop switches to [gadget gauntlet cutscene2 v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet cutscene3 v]\nstop [other scripts in sprite v]\ngo to x: (-17) y: (123)\nswitch costume to (sonic fall 2 v)\nset size to (200) %\nshow\nglide (1) secs to x: (-33) y: (26)\nrepeat until <touching (tornado v)?>\n    switch costume to (sonic fall 2 v)\n    wait (0) seconds\n    switch costume to (sonic fall 1-disfraz1 v)\n    wait (0) seconds\nend\nif <touching (tornado v)?> then\n    repeat until <touching (_edge_ v)?>\n        switch costume to (idle v)\n        go to (tornado v)\n    end\nend\nhide\n\nwhen backdrop switches to [gadget gauntlet cutscene4 v]\nstop [other scripts in sprite v]\nhide\nwait (1) seconds\nset size to (100) %\nshow\nforever\n    go to (tornado v)\nend\n\nwhen I receive [the end v]\nstop [other scripts in sprite v]\nhide\n\ndefine you glitched it\nstart sound [SonicDash v]\nset [stop moving v] to [yes]\nswitch costume to (sonic die 1-disfraz1 v)\nrepeat (10)\n    change y by (10)\nend\nbroadcast (dead in game v)\nrepeat until <(y position) < [-175]>\n    change [-sy v] by (-1)\n    change y by (-sy)\nend\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nset [exit v] to []\nset [-sy v] to [15]\nhide\nwait (2) seconds\nif <(LEVEL) = [GHZ3]> then\n    stop [other scripts in sprite v]\n    wait (0.5) seconds\n    switch backdrop to (green hillsboss v)\n    stop [this script v]\nend\nif <(LEVEL) = [LZ3]> then\n    stop [other scripts in sprite v]\n    wait (0.5) seconds\n    switch backdrop to (labyrinthboss v)\n    stop [this script v]\nend\nif <(LEVEL) = [SLZ3]> then\n    stop [other scripts in sprite v]\n    wait (0.5) seconds\n    switch backdrop to (starlight3 v)\n    stop [this script v]\nend\nif <(LEVEL) = [DEZ2]> then\n    stop [other scripts in sprite v]\n    wait (0.5) seconds\n    switch backdrop to (death eggboss v)\n    stop [this script v]\nend\nif <(LEVEL) = [GGZ2]> then\n    stop [other scripts in sprite v]\n    wait (0.5) seconds\n    switch backdrop to (gadget gauntletboss v)\n    stop [this script v]\nend\n\nwhen I receive [stop moving v]\nforever\n    if <<not <(LEVEL) = [GHZ3]>> or <<not <(LEVEL) = [LZ3]>> or <<not <(LEVEL) = [SLZ3]>> or <<not <(LEVEL) = [DEZ2]>> or <not <(LEVEL) = [GGZ2]>>>>>> then\n        if <(stop moving) = [yes]> then\n            wait (4) seconds\n            if <(-sy) < [20]> then\n                set [stop moving v] to [no]\n            end\n        end\n    else\n        stop [this script v]\n    end\nend\n\nwhen I receive [glitch detection v]\nwait (2) seconds\nforever\n    if <<<(left collision) = [1]> and <(top collision) = [1]>> and <(right collision) = [1]>> then\n        repeat (10)\n            stop [other scripts in sprite v]\n        end\n        you glitched it\n        broadcast (stop moving v)\n        if <<not <(LEVEL) = [GHZ3]>> and <<not <(LEVEL) = [LZ3]>> and <<not <(LEVEL) = [SLZ3]>> and <<not <(LEVEL) = [GGZ2]>> and <not <(LEVEL) = [DEZ2]>>>>>> then\n            broadcast (Play Game v) and wait\n        end\n        wait (2) seconds\n    end\nend\n\nwhen I receive [glitch detection v]\nwait (2) seconds\nforever\n    if <key (y v) pressed?> then\n        repeat (10)\n            stop [other scripts in sprite v]\n        end\n        you glitched it\n        broadcast (stop moving v)\n        if <<not <(LEVEL) = [GHZ3]>> and <<not <(LEVEL) = [LZ3]>> and <<not <(LEVEL) = [SLZ3]>> and <<not <(LEVEL) = [GGZ2]>> and <not <(LEVEL) = [DEZ2]>>>>>> then\n            broadcast (Play Game v) and wait\n        end\n        wait (2) seconds\n    end\nend\n\nwhen I receive [boss tick v]\nchange [-walk v] by (1)\nif <(-walk) > [29]> then\n    set [-walk v] to [22]\nend\n\nwhen I receive [stop moving v]\nforever\n    if <<not <(LEVEL) = [GHZ3]>> or <<not <(LEVEL) = [LZ3]>> or <<not <(LEVEL) = [SLZ3]>> or <<not <(LEVEL) = [DEZ2]>> or <not <(LEVEL) = [GGZ2]>>>>>> then\n        if <<(stop moving) = [yes]> and <(EXIT) = []>> then\n            repeat until <(stop moving) = [no]>\n                set [player: -x v] to [-150]\n                if <<(LEVEL) = [GHZ]> or <<(LEVEL) = [GHZ2]> or <(LEVEL) = [GHZ3]>>> then\n                    set [player: -y v] to [-100]\n                end\n                if <<(LEVEL) = [LZ]> or <<(LEVEL) = [LZ2]> or <(LEVEL) = [LZ3]>>> then\n                    set [player: -y v] to [-80]\n                end\n                if <<(LEVEL) = [SLZ]> or <<(LEVEL) = [SLZ2]> or <(LEVEL) = [SLZ3]>>> then\n                    set [player: -y v] to [-88]\n                end\n                if <<(LEVEL) = [DEZ]> or <(LEVEL) = [DEZ2]>> then\n                    set [player: -y v] to [-97]\n                end\n                if <<(LEVEL) = [GGZ]> or <(LEVEL) = [GGZ2]>> then\n                    set [player: -y v] to [-96]\n                end\n                set [-sx v] to [0]\n                set [-sy v] to [0]\n                set [-in air v] to [0]\n                set [exit v] to []\n                set [dead v] to [0]\n                set [scroll x v] to [0]\n                set [scroll y v] to [0]\n                set [flashing v] to [0]\n            end\n            stop [this script v]\n        end\n    else\n        stop [this script v]\n    end\nend\n\n@enemy5\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((enemy: -x) - (SCROLL X)) (enemy: -y)\n\nwhen I receive [set up v]\nhide\nset size to (100) %\nset [enemy: -x v] to [0]\nset [enemy: -y v] to [0]\nif <(LEVEL) = [DEZ]> then\n    switch costume to (costume1 v)\n    Clone at x - [1200] y - [32] EV - [99999]\n    Clone at x - [1500] y - [-90] EV - [99999]\n    Clone at x - [1700] y - [-90] EV - [99999]\n    Clone at x - [1900] y - [-90] EV - [99999]\n    Clone at x - [2000] y - [-90] EV - [99999]\nelse\n    if <(LEVEL) = [GGZ]> then\n        Clone at x - [400] y - [32] EV - [99999]\n        Clone at x - [600] y - [32] EV - [99999]\n        Clone at x - [800] y - [32] EV - [99999]\n        Clone at x - [1000] y - [32] EV - [99999]\n        Clone at x - [7500] y - [32] EV - [99999]\n        Clone at x - [7700] y - [32] EV - [99999]\n        Clone at x - [8000] y - [32] EV - [99999]\n        Clone at x - [8200] y - [32] EV - [99999]\n        Clone at x - [8400] y - [32] EV - [99999]\n    end\nend\nset [enemy: -x v] to [-99999]\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) EV - (ev)\nset [enemy: -x v] to (x)\nset [enemy: -y v] to (y)\nset [ev v] to (ev)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    repeat (EV)\n        repeat (30)\n            point in direction (90)\n            set rotation style [left-right v]\n            change [enemy: -x v] by (-2)\n        end\n        wait (2) seconds\n        repeat (30)\n            point in direction (-90)\n            set rotation style [left-right v]\n            change [enemy: -x v] by (2)\n        end\n        wait (2) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    Other\nend\n\ndefine Other\nnext costume\nwait (0.1) seconds\n\nwhen I start as a clone\nforever\n    if <touching (bottom sense v)?> then\n        broadcast (Bounce v)\n        set [points x v] to (enemy: -x)\n        set [points y v] to (enemy: -y)\n        start sound [Enemy Kill v]\n        set [point counter v] to [2]\n        change [score v] by (200)\n        repeat until <(y position) < [-179]>\n            change [enemy: -y v] by (-10)\n        end\n        delete this clone\n    end\n    if <<<touching (sonic the hedgehog v)?> and <not <touching (bottom sense v)?>>> and <(spin attack) = [yes]>> then\n        broadcast (Bounce v)\n        set [points x v] to (enemy: -x)\n        set [points y v] to (enemy: -y)\n        start sound [Enemy Kill v]\n        set [point counter v] to [2]\n        change [score v] by (200)\n        repeat until <(y position) < [-179]>\n            change [enemy: -y v] by (-10)\n        end\n        delete this clone\n    end\n    if <<<touching (sonic the hedgehog v)?> and <not <touching (bottom sense v)?>>> and <(spin attack) = [no]>> then\n        hide\n        broadcast (Hurt v)\n        delete this clone\n    end\nend\n\nif <(STAR?) = [OFF]> then\n    broadcast (Hurt v)\nend\n\ncreate clone of (stomp v)\n\nswitch backdrop to (gadget gauntlet v)\n\nwait (1) seconds\n\nswitch backdrop to (death egg v)\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nset [-x v] to [0]\nset [-y v] to [0]\nhide\ndelete this clone\n\n@right sense\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [tick v]\nif <(hide) = [no]> then\n    show\nend\ngo to (sonic the hedgehog v)\npoint in direction (180)\nset rotation style [all around v]\nset [ghost v] effect to (100)\nif <(stop moving) = [no]> then\n    if <touching (platforms v)?> then\n        go to (sonic the hedgehog v)\n        set [right collision v] to [1]\n    else\n        set [right collision v] to [0]\n    end\nelse\n    set [right collision v] to [0]\nend\n\nwhen backdrop switches to [begin game v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hills loading v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [zone complete v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\n\nswitch backdrop to (labyrinth v)\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet cutscene v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet cutscene v]\nstop [other scripts in sprite v]\nhide\n\nif <(sx) > [0]> then\n\nPosition\n\n@Platforms\n\nwhen I receive [green flag v]\nhide\ngo to [back v] layer\n\nwhen I receive [tick v]\nif <<not <(backdrop [number v]) = [8]>> and <<not <(backdrop [number v]) = [19]>> and <<not <(backdrop [number v]) = [15]>> and <<<not <(backdrop [number v]) = [25]>> and <not <(backdrop [number v]) = [29]>>> and <not <(backdrop [number v]) = [28]>>>>>> then\n    Position ((-x) - (SCROLL X)) [0]\nelse\n    if <(LEVEL) = [GHZ3]> then\n        show\n        go to [front v] layer\n        switch costume to (greenhill15 v)\n        set [ghost v] effect to (0)\n        go to x: (0) y: (0)\n    end\n    if <(LEVEL) = [LZ3]> then\n        show\n        go to [front v] layer\n        set [ghost v] effect to (0)\n        switch costume to (labyrinth v)\n        go to x: (0) y: (0)\n    end\n    if <(LEVEL) = [SLZ3]> then\n        show\n        set [ghost v] effect to (0)\n        go to x: (0) y: (0)\n    end\n    if <(LEVEL) = [DEZ2]> then\n        show\n        set [ghost v] effect to (0)\n        go to x: (0) y: (0)\n    end\n    if <<(LEVEL) = [GGZ2]> and <(hide) = [no]>> then\n        show\n        set [ghost v] effect to (0)\n        go to [front v] layer\n        go to x: (0) y: (0)\n    end\nend\n\nwhen I receive [set up v]\nhide\nset [color v] effect to (0)\nset [brightness v] effect to (0)\nset [-x v] to [0]\nset [-y v] to [0]\nif <(LEVEL) = [GHZ]> then\n    switch costume to (greenhill v)\n    repeat (7)\n        Clone at x - [478] y - [0]\n    end\nelse\n    if <(LEVEL) = [GHZ2]> then\n        switch costume to (greenhill7 v)\n        Clone at x - [480] y - [0]\n        Clone at x - [480] y - [0]\n        Clone at x - [480] y - [0]\n        Clone at x - [600] y - [0]\n        Clone at x - [400] y - [0]\n        Clone at x - [480] y - [0]\n        Clone at x - ((480) * (2)) y - [0]\n    else\n        if <(LEVEL) = [LZ]> then\n            switch costume to (labyrinth v)\n            repeat (5)\n                Clone at x - [480] y - [0]\n            end\n            Clone at x - ((480) * (2)) y - [0]\n            repeat (7)\n                Clone at x - [480] y - [0]\n            end\n        else\n            if <(LEVEL) = [LZ2]> then\n                switch costume to (labyrinth7 v)\n                repeat (5)\n                    Clone at x - [480] y - [0]\n                end\n            else\n                if <(LEVEL) = [SLZ]> then\n                    switch costume to (starlight11 v)\n                    repeat (2)\n                        Clone at x - [480] y - [0]\n                    end\n                    Clone at x - ((480) * (6)) y - [0]\n                    Clone at x - ((480) * (1.8)) y - [0]\n                    Clone at x - [480] y - [0]\n                else\n                    if <(LEVEL) = [SLZ2]> then\n                        switch costume to (starlight v)\n                        repeat (3)\n                            Clone at x - [480] y - [0]\n                        end\n                        Clone at x - ((480) * (3.4)) y - [0]\n                        repeat (6)\n                            Clone at x - [480] y - [0]\n                        end\n                    else\n                        if <(LEVEL) = [DEZ]> then\n                            switch costume to (death egg6 v)\n                            Clone at x - [2270] y - [0]\n                            Clone at x - [830] y - [0]\n                            Clone at x - [480] y - [0]\n                            repeat (3)\n                                Clone at x - [600] y - [0]\n                            end\n                            repeat (2)\n                                Clone at x - [480] y - [0]\n                            end\n                            Clone at x - [1200] y - [0]\n                        else\n                            if <(LEVEL) = [GGZ]> then\n                                switch costume to (the gadget v)\n                                repeat (4)\n                                    Clone at x - [480] y - [0]\n                                end\n                                Clone at x - ((480) * (2)) y - [0]\n                                Clone at x - [600] y - [0]\n                                repeat (3)\n                                    Clone at x - [480] y - [0]\n                                end\n                                repeat (2)\n                                    Clone at x - [480] y - [0]\n                                end\n                                Clone at x - ((480) * (6)) y - [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\nif <<not <(backdrop [number v]) = [8]>> and <<not <(backdrop [number v]) = [19]>> and <<not <(backdrop [number v]) = [15]>> and <<not <(backdrop [number v]) = [25]>> and <<not <(backdrop [number v]) = [28]>> and <not <(backdrop [number v]) = [29]>>>>>>> then\n    go to x: (x) y: (y)\n    if <<(x) = (x position)> and <(y) = (y position)>> then\n        show\n    else\n        if <(LEVEL) = [SLZ3]> then\n            show\n            set [ghost v] effect to (0)\n            go to x: (0) y: (0)\n            stop [this script v]\n        end\n        hide\n    end\nelse\n    stop [this script v]\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\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nset [-x v] to [0]\nset [-y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [beginning of game cutscene v]\ngo to x: (0) y: (0)\ngo to [front v] layer\ngo [forward v] (2) layers\ngo [backward v] (1) layers\nshow\nswitch costume to (greenhill9 v)\n\nwhen I start as a clone\nwait until <(backdrop [number v]) = [4]>\ndelete this clone\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nset [-x v] to [0]\nset [-y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hillsboss v]\nshow\ngo to [front v] layer\nswitch costume to (greenhill15 v)\ngo to x: (0) y: (0)\n\nwhen backdrop switches to [zone complete v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\nset [-x v] to [0]\nset [-y v] to [0]\nhide\ndelete this clone\n\nswitch backdrop to (gadget gauntletboss v)\n\nwhen backdrop switches to [labyrinthboss v]\nforever\n    show\n    switch costume to (labyrinth v)\n    go to x: (0) y: (0)\nend\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\nset [-x v] to [0]\nset [-y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\nset [-x v] to [0]\nset [-y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [starlight3 v]\nswitch costume to (starlight16 v)\nset [color v] effect to (0)\nset [brightness v] effect to (0)\nshow\ngo to x: (0) y: (0)\nwait (1) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nrepeat (100)\n    show\n    go to [front v] layer\nend\n\nswitch costume to (greenhill15 v)\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nset [-x v] to [0]\nset [-y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [death eggboss v]\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (death egg12 v)\n    wait (0) seconds\n    switch costume to (death egg13 v)\n    wait (0) seconds\nend\n\nwhen I receive [victory v]\nif <(backdrop [number v]) = [22]> then\n    stop [other scripts in sprite v]\nend\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\nset [-x v] to [0]\nset [-y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntletboss v]\nswitch costume to (the gadget v)\nset [color v] effect to (0)\nset [brightness v] effect to (0)\nshow\ngo to x: (0) y: (0)\nwait (1) seconds\nrepeat (10)\n    go to [front v] layer\n    change [brightness v] effect by (-10)\nend\nforever\n    show\n    switch costume to (the gadget v)\n    set [color v] effect to (0)\n    go to x: (0) y: (0)\nend\n\nswitch backdrop to (gadget gauntletboss v)\n\nwhen backdrop switches to [gadget gauntlet cutscene2 v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nset [-x v] to [0]\nset [-y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet cutscene2 v]\nstop [other scripts in sprite v]\nset [-x v] to [0]\nset [-y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet cutscene4 v]\nset [hide v] to [yes]\nset [-x v] to [0]\nset [-y v] to [0]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen I receive [ending 3 v]\ndelete this clone\n\nwhen I receive [ending 4 v]\nset [hide v] to [yes]\ndelete this clone\n\nswitch costume to (death egg6 v)\n\n@tornado\n\nwhen backdrop switches to [gadget gauntlet cutscene3 v]\ngo to x: (-203) y: (22)\nset size to (200) %\nhide\nwait (5) seconds\nshow\nglide (3) secs to x: (413) y: (22)\nhide\nbroadcast (ending 4 v)\n\nwhen backdrop switches to [gadget gauntlet cutscene3 v]\nforever\n    wait (0) seconds\n    next costume\nend\n\nwhen backdrop switches to [gadget gauntlet cutscene4 v]\ngo to x: (-210) y: (-9)\nset size to (100) %\nhide\nwait (1) seconds\nshow\ngo to [front v] layer\nglide (1) secs to x: (11) y: (-6)\nforever\n    glide (1) secs to x: (18) y: (-0)\n    glide (1) secs to x: (18) y: (-14)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [the end v]\nstop [other scripts in sprite v]\nhide\n\n@shadow\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [death eggboss v]\nshow variable [boss health v]\nset [boss health v] to [20]\nset [shadow attack v] to [no]\nbroadcast (begin shadow cutscene v)\nwait (1) seconds\ngo to x: (-195) y: (24)\nset size to (300) %\nset [brightness v] effect to (-50)\ngo to [front v] layer\nswitch costume to (costume1 v)\nshow\nglide (4) secs to x: (15) y: (24)\nstart sound [Sonic Jump v]\nbroadcast (shrink shadow v)\n\nwhen I receive [change shadow brightness v]\nswitch costume to (costume27 v)\nbroadcast (hide the plats v)\nglide (1) secs to x: (164) y: (133)\nglide (1) secs to x: (157) y: (-118)\nbroadcast (begin the fight v)\n\nwhen I receive [shrink shadow v]\nstop [other scripts in sprite v]\nbroadcast (change shadow brightness v)\nrepeat (5)\n    change [brightness v] effect by (10)\nend\nrepeat (20)\n    change size by (-10)\nend\n\nwait (0.) seconds\n\nwait () seconds\n\nwhen I receive [begin shadow cutscene v]\nset [brightness v] effect to (0)\nhide\nwait (1) seconds\ngo to x: (-195) y: (24)\nset size to (300) %\ngo to [front v] layer\nswitch costume to (costume1 v)\nshow\nforever\n    if <(costume [number v]) > [26]> then\n        switch costume to (costume1 v)\n        go to [front v] layer\n    end\n    next costume\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [begin the fight v]\nset [shadow attack v] to [no]\nforever\n    if <(shadow attack) = [no]> then\n        set [which attack v] to [0]\n        wait (5) seconds\n        set [shadow attack v] to [yes]\n        set [which attack v] to (pick random (1) to (4))\n    end\n    if <(which attack) = [1]> then\n        repeat (3)\n            start sound [Sonic Jump v]\n            glide (1) secs to x: (239) y: (-118)\n            start sound [Sonic Jump v]\n            glide (1) secs to x: (-223) y: (-118)\n        end\n        start sound [Sonic Jump v]\n        glide (1) secs to x: (157) y: (-118)\n        set [which attack v] to [0]\n        set [shadow attack v] to [no]\n    end\n    if <(which attack) = [2]> then\n        start sound [Sonic Jump v]\n        glide (1) secs to x: (10) y: (110)\n        wait (2) seconds\n        glide (0.1) secs to x: (6) y: (-120)\n        start sound [spindash go v]\n        glide (0.5) secs to x: (-215) y: (-118)\n        start sound [spindash go v]\n        glide (0.5) secs to x: (239) y: (-118)\n        glide (0.5) secs to x: (157) y: (-118)\n        set [which attack v] to [0]\n        set [shadow attack v] to [no]\n    end\n    if <<(which attack) = [3]> or <(which attack) = [4]>> then\n        wait until <(which attack) = [0]>\n        broadcast (come down v)\n    end\nend\n\nwhen I receive [begin the fight v]\nset [which attack v] to [0]\nset [shadow attack v] to [no]\nforever\n    if <(shadow attack) = [no]> then\n        if <(costume [number v]) > [26]> then\n            switch costume to (costume1 v)\n            go to [front v] layer\n        end\n        next costume\n    end\n    if <(shadow attack) = [yes]> then\n        if <<(which attack) = [2]> or <(which attack) = [1]>> then\n            switch costume to (costume27 v)\n        end\n        if <<(which attack) = [3]> or <(which attack) = [4]>> then\n            switch costume to (costume28 v)\n            broadcast (come up v)\n            wait (0.1) seconds\n            switch costume to (costume29 v)\n            wait (0.1) seconds\n            switch costume to (costume30 v)\n            wait (0.1) seconds\n            switch costume to (costume31 v)\n            wait (0.1) seconds\n            switch costume to (costume32 v)\n            wait (0.1) seconds\n            repeat until <(which attack) = [0]>\n                switch costume to (costume33 v)\n                wait (0.1) seconds\n                switch costume to (costume34 v)\n                wait (0.1) seconds\n            end\n        end\n    end\nend\n\nswitch backdrop to (death eggboss v)\n\nswitch backdrop to (gadget gauntlet v)\n\ngo to [front v] layer\nif <(costume [number v]) > [26]> then\nnext costume\n\nstart sound [Sonic Jump v]\nglide (1) secs to x: (240) y: (-118)\n\nrepeat (3)\nstart sound [Sonic Jump v]\n\nglide (1) secs to x: (239) y: (-118)\nstart sound [Sonic Jump v]\nglide (1) secs to x: (-223) y: (-118)\n\nglide (1) secs to x: (239) y: (-118)\nset [which attack v] to [0]\nset [shadow attack v] to [no]\n\nglide (1) secs to x: (239) y: (-118)\n\nwhen I receive [come up v]\nglide (1) secs to x: (9) y: (90)\n\nwhen I receive [come down v]\nglide (1) secs to x: (157) y: (-118)\nset [shadow attack v] to [no]\n\n\n\nwhen backdrop switches to [death eggboss v]\n\nwhen I receive [egghurt v]\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen I receive [damage shadow v]\nstart sound [Damage v]\nchange [boss health v] by (-1)\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen I receive [dead in game v]\nstop [other scripts in sprite v]\nhide\n\nbroadcast (dead in game v)\n\nwhen I receive [begin the fight v]\nforever\n    if <<<touching (top sense2 v)?> or <touching (sonic the hedgehog v)?>> and <(spin attack) = [yes]>> then\n        start sound [Damage v]\n        broadcast (damage shadow v) and wait\n    end\n    if <(Boss health) < [1]> then\n        stop [other scripts in sprite v]\n        broadcast (eggman defeated v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (1) seconds\n        broadcast (Victory v)\n        stop [this script v]\n    end\nend\n\nwait (5) seconds\n\nwhen I receive [begin the fight v]\nforever\n    if <<touching (sonic the hedgehog v)?> and <(shadow attack) = [yes]>> then\n        set [exit v] to [dead]\n    end\nend\n\n@final boss attacks\n\nwhen backdrop switches to [gadget gauntletboss v]\ngo to x: (0) y: (128)\nhide\npoint in direction (90)\nset rotation style [left-right v]\nset [which attack v] to [0]\nwait (7) seconds\nforever\n    set [which attack v] to (pick random (1) to (4))\n    if <(Boss health) < [20]> then\n        if <(which attack) = [1]> then\n            switch costume to (spikes3 v)\n            go to x: (0) y: (128)\n            hide\n            show\n            start sound [Impact2 v]\n            wait (0.7) seconds\n            go to [front v] layer\n            glide (0.7) secs to x: (0) y: (-104)\n            hide\n            set [which attack v] to [0]\n        end\n        if <(which attack) = [2]> then\n            switch costume to (spikes5 v)\n            go to x: (0) y: (128)\n            hide\n            show\n            start sound [Impact2 v]\n            wait (0.7) seconds\n            glide (0.7) secs to x: (0) y: (-104)\n            hide\n            set [which attack v] to [0]\n        end\n        if <(which attack) = [3]> then\n            switch costume to (spikes2 v)\n            go to [front v] layer\n            go to x: (0) y: (128)\n            hide\n            show\n            start sound [Impact2 v]\n            wait (0.7) seconds\n            glide (0.7) secs to x: (0) y: (-104)\n            hide\n            set [which attack v] to [0]\n        end\n        if <(which attack) = [4]> then\n            switch costume to (spikes4 v)\n            go to [front v] layer\n            go to x: (0) y: (128)\n            hide\n            show\n            start sound [Impact2 v]\n            wait (0.7) seconds\n            glide (0.7) secs to x: (0) y: (-104)\n            hide\n            set [which attack v] to [0]\n        end\n    end\n    if <<(Boss health) < [25]> and <(Boss health) > [15]>> then\n        if <(which attack) = [1]> then\n            switch costume to (spikes3 v)\n            go to x: (0) y: (128)\n            go to [front v] layer\n            hide\n            show\n            start sound [Impact2 v]\n            wait (1) seconds\n            glide (0.7) secs to x: (0) y: (-104)\n            hide\n            set [which attack v] to [0]\n        end\n        if <(which attack) = [2]> then\n            switch costume to (spikes5 v)\n            go to x: (0) y: (128)\n            hide\n            show\n            start sound [Impact2 v]\n            wait (1) seconds\n            glide (0.7) secs to x: (0) y: (-104)\n            hide\n            set [which attack v] to [0]\n        end\n        if <(which attack) = [3]> then\n            switch costume to (spikes2 v)\n            go to [front v] layer\n            go to x: (0) y: (128)\n            hide\n            show\n            start sound [Impact2 v]\n            wait (1) seconds\n            glide (0.7) secs to x: (0) y: (-104)\n            hide\n            set [which attack v] to [0]\n        end\n        if <(which attack) = [4]> then\n            switch costume to (spikes4 v)\n            go to x: (0) y: (128)\n            hide\n            show\n            start sound [Impact2 v]\n            wait (1) seconds\n            glide (0.7) secs to x: (0) y: (-104)\n            hide\n            set [which attack v] to [0]\n        end\n    end\n    if <(Boss health) > [25]> then\n        if <(which attack) = [1]> then\n            switch costume to (spikes3 v)\n            go to [front v] layer\n            go to x: (0) y: (128)\n            hide\n            show\n            start sound [Impact2 v]\n            wait (2) seconds\n            glide (1) secs to x: (0) y: (-104)\n            hide\n            set [which attack v] to [0]\n        end\n        if <(which attack) = [2]> then\n            switch costume to (spikes5 v)\n            go to x: (0) y: (128)\n            hide\n            show\n            start sound [Impact2 v]\n            wait (2) seconds\n            glide (1) secs to x: (0) y: (-104)\n            hide\n            set [which attack v] to [0]\n        end\n        if <(which attack) = [3]> then\n            switch costume to (spikes2 v)\n            go to x: (0) y: (128)\n            go to [front v] layer\n            hide\n            show\n            start sound [Impact2 v]\n            wait (2) seconds\n            glide (1) secs to x: (0) y: (-104)\n            hide\n            set [which attack v] to [0]\n        end\n        if <(which attack) = [4]> then\n            switch costume to (spikes4 v)\n            go to x: (0) y: (128)\n            go to [front v] layer\n            hide\n            show\n            start sound [Impact2 v]\n            wait (2) seconds\n            glide (1) secs to x: (0) y: (-104)\n            hide\n            set [which attack v] to [0]\n        end\n    end\n    if <(Boss health) < [20]> then\n        wait (0.5) seconds\n    end\n    if <<(Boss health) < [25]> and <(Boss health) > [15]>> then\n        wait (1) seconds\n    end\n    if <(Boss health) > [25]> then\n        wait (2) seconds\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (128)\nhide\n\nswitch backdrop to (gadget gauntletboss v)\n\nwhen I receive [#1 victory v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntletboss v]\nwait (2) seconds\nforever\n    if <touching (sonic the hedgehog v)?> then\n        set [exit v] to [dead]\n    end\nend\n\nset [boss health v] to [0]\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\n@Portal2\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [gadget gauntletboss v]\nswitch costume to (ruby 1 v)\npoint in direction (90)\nset rotation style [left-right v]\nforever\n    go to (eggman v)\n    set size to (100) %\n    show\n    go to [front v] layer\nend\n\nwhen backdrop switches to [gadget gauntlet cutscene v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet cutscene4 v]\nwait (10) seconds\nshow\ngo to [front v] layer\ngo to x: (-162) y: (191)\nstart sound [S3K_51 v]\nglide (0.8) secs to x: (-167) y: (-149)\nhide\n\nwhen I receive [#1 victory v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet cutscene4 v]\nhide\nforever\n    switch costume to (ruby 2 v)\n    set rotation style [all around v]\n    turn right (40) degrees\nend\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\n\n@Bottom Sense\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [tick v]\nshow\ngo to (sonic the hedgehog v)\nset [ghost v] effect to (100)\nif <<touching (platforms v)?> or <touching (eggman v)?>> then\n    set [collision v] to [1]\nelse\n    set [collision v] to [0]\nend\n\nwhen backdrop switches to [begin game v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hills loading v]\nhide variable [lives v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [zone complete v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet cutscene v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [boss tick v]\nshow\ngo to (sonic the hedgehog v)\nset [ghost v] effect to (100)\nif <<touching (platforms v)?> or <touching (eggman v)?>> then\n    set [collision v] to [1]\nelse\n    set [collision v] to [0]\nend\n\n@ghost plat\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [set up v]\nhide\nset size to (100) %\nset [ghost v] effect to (0)\nset [rotating block: -x v] to [0]\nset [rotating block: -y v] to [0]\nwait (0.1) seconds\nif <(LEVEL) = [SLZ]> then\n    switch costume to (background2 v)\n    Clone at x - [1300] y - [-93]\n    Clone at x - [1500] y - [-70]\n    Clone at x - [1800] y - [-50]\n    Clone at x - [2000] y - [-50]\n    Clone at x - [2200] y - [-70]\n    Clone at x - [2400] y - [-93]\n    switch costume to (starlight5 v)\n    Clone at x - [2800] y - [-93]\n    switch costume to (starlight6 v)\n    Clone at x - [3200] y - [-93]\n    switch costume to (background2 v)\nelse\n    if <(LEVEL) = [SLZ2]> then\n        switch costume to (background2 v)\n        Clone at x - [1800] y - [-93]\n        Clone at x - [2000] y - [-93]\n        Clone at x - [2300] y - [-93]\n    else\n        if <(LEVEL) = [DEZ]> then\n            switch costume to (death egg2 v)\n            Clone at x - [500] y - [-93]\n            Clone at x - [800] y - [-93]\n            Clone at x - [1000] y - [-93]\n            Clone at x - [6700] y - [-110]\n            Clone at x - [6800] y - [-110]\n            Clone at x - [6900] y - [-110]\n            Clone at x - [7000] y - [-110]\n            Clone at x - [7100] y - [-110]\n            Clone at x - [7200] y - [-110]\n        else\n            if <(LEVEL) = [GGZ]> then\n                switch costume to (the gadget12 v)\n                Clone at x - [6300] y - [0]\n                Clone at x - [6800] y - [0]\n                Clone at x - [7100] y - [0]\n            end\n        end\n    end\nend\nset [rotating block: -x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x - (x) y - (y)\nset size to (100) %\nset [rotating block: -x v] to (x)\nset [rotating block: -y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    if <(LEVEL) = [DEZ]> then\n        repeat (pick random (10) to (20))\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (0.5) seconds\n        show\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        wait (1) seconds\n    end\n    if <not <(LEVEL) = [DEZ]>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        wait (0.5) seconds\n        show\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        wait (1) seconds\n    end\nend\n\nwhen I receive [tick v]\nPosition ((Rotating Block: -x) - (SCROLL X)) (Rotating Block: -y)\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\n@chain\n\nwhen backdrop switches to [green hillsboss v]\nforever\n    go to (eggman v)\nend\n\nwhen backdrop switches to [green hillsboss v]\ngo to [front v] layer\nhide\nwait (1) seconds\ngo [backward v] (10) layers\nshow\npoint in direction (90)\nset rotation style [all around v]\nforever\n    turn right (2) degrees\nend\n\nwhen backdrop switches to [green hillsboss v]\nwait (1) seconds\npoint in direction (90)\nset rotation style [all around v]\nforever\n    if <(Boss health) < [10]> then\n        turn right (4) degrees\n    end\n    if <(Boss health) < [1]> then\n        stop [other scripts in sprite v]\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [green hills loading v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [dead in game v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [zone complete v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\n@Borders\n\nwhen I receive [play game v]\ngo to x: (0) y: (0)\nshow\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntletboss v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [green hillsboss v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [labyrinthboss v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [starlight3 v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death eggboss v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntletboss v]\nstop [other scripts in sprite v]\nhide\n\n@Sprite57\n\nwhen flag clicked\nset size to (400) %\nhide\n\nwhen backdrop switches to [death eggboss v]\nset [which attack v] to [0]\nhide\nforever\n    go to [front v] layer\n    if <(which attack) = [4]> then\n        go to x: (-339) y: (-139)\n        show\n        glide (1) secs to x: (-114) y: (40)\n        wait (1) seconds\n        glide (1) secs to x: (0) y: (-178)\n        wait (1) seconds\n        glide (1) secs to x: (135) y: (0)\n        wait (1) seconds\n        glide (1) secs to x: (299) y: (-147)\n        hide\n        set [which attack v] to [0]\n    end\n    if <(which attack) = [3]> then\n        go to x: (-339) y: (-53)\n        show\n        glide (1) secs to x: (-144) y: (-209)\n        wait (1) seconds\n        glide (1) secs to x: (-24) y: (50)\n        wait (1) seconds\n        glide (1) secs to x: (145) y: (-165)\n        wait (1) seconds\n        glide (1) secs to x: (371) y: (-29)\n        hide\n        set [which attack v] to [0]\n    end\nend\n\nwhen I receive [begin the fight v]\nwait (2) seconds\nforever\n    if <touching (sonic the hedgehog v)?> then\n        set [exit v] to [dead]\n    end\nend\n\nwhen I receive [victory v]\nstop [other scripts in sprite v]\nhide\n\n@enemy\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((enemy: -x) - (SCROLL X)) (enemy: -y)\n\nwhen I receive [set up v]\nhide\nset size to (100) %\nset [enemy: -x v] to [0]\nset [enemy: -y v] to [0]\nif <(LEVEL) = [GHZ]> then\n    switch costume to (costume1 v)\n    Clone at x - [300] y - [-105] EV - [99999]\n    Clone at x - [1916] y - [-105] EV - [99999]\nelse\n    if <(LEVEL) = [GHZ2]> then\n        switch costume to (costume1 v)\n        Clone at x - [500] y - [-105] EV - [99999]\n        Clone at x - [600] y - [-105] EV - [99999]\n        Clone at x - [700] y - [-105] EV - [99999]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (costume1 v)\n            Clone at x - [1280] y - [-81] EV - [90]\n        end\n    end\nend\nset [enemy: -x v] to [-99999]\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) EV - (ev)\nset [enemy: -x v] to (x)\nset [enemy: -y v] to (y)\nset [ev v] to (ev)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    repeat (EV)\n        repeat (30)\n            point in direction (90)\n            set rotation style [left-right v]\n            change [enemy: -x v] by (-2)\n        end\n        wait (2) seconds\n        repeat (30)\n            point in direction (-90)\n            set rotation style [left-right v]\n            change [enemy: -x v] by (2)\n        end\n        wait (2) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    Other\nend\n\ndefine Other\nnext costume\nwait (0.1) seconds\n\nwhen I start as a clone\nforever\n    if <touching (bottom sense v)?> then\n        broadcast (Bounce v)\n        set [points x v] to (enemy: -x)\n        set [points y v] to (enemy: -y)\n        start sound [Enemy Kill v]\n        set [point counter v] to [2]\n        change [score v] by (200)\n        repeat until <(y position) < [-179]>\n            change [enemy: -y v] by (-10)\n        end\n        delete this clone\n    end\n    if <<<touching (sonic the hedgehog v)?> and <not <touching (bottom sense v)?>>> and <(spin attack) = [yes]>> then\n        broadcast (Bounce v)\n        set [points x v] to (enemy: -x)\n        set [points y v] to (enemy: -y)\n        start sound [Enemy Kill v]\n        set [point counter v] to [2]\n        change [score v] by (200)\n        repeat until <(y position) < [-179]>\n            change [enemy: -y v] by (-10)\n        end\n        delete this clone\n    end\n    if <<<touching (sonic the hedgehog v)?> and <not <touching (bottom sense v)?>>> and <(spin attack) = [no]>> then\n        hide\n        broadcast (Hurt v)\n        delete this clone\n    end\nend\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\n@enemy3\n\nwhen I receive [green flag v]\nhide\nhide variable [clone id v]\ndelete this clone\n\nwhen I receive [tick v]\nif <(LEVEL) = [GHZ2]> then\n    Position ((enemy: -x) - (SCROLL X)) (enemy: -y)\nend\nif <(LEVEL) = [SLZ2]> then\n    Position ((enemy: -x) - (SCROLL X)) (enemy: -y)\nend\n\nwhen I receive [set up v]\nhide\nset size to (100) %\nset [clone id v] to [0]\nset [enemy: -x v] to [0]\nset [enemy: -y v] to [0]\nif <(LEVEL) = [GHZ2]> then\n    switch costume to (costume1 v)\n    change [clone id v] by (1)\n    Clone at x - [3400] y - [-59] EV - [99999]\n    change [clone id v] by (1)\n    Clone at x - [3600] y - [-59] EV - [99999]\n    set [clone id v] to [0]\n    hide\n    stop [this script v]\nelse\n    if <(LEVEL) = [SLZ2]> then\n        switch costume to (costume1 v)\n        change [clone id v] by (1)\n        Clone at x - [2600] y - [-59] EV - [99999]\n        change [clone id v] by (1)\n        Clone at x - [2700] y - [-59] EV - [99999]\n        set [clone id v] to [0]\n        hide\n        stop [this script v]\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <<(Clone Id) = [1]> or <(Clone Id) = [2]>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x - (x) y - (y) EV - (ev)\nset [enemy: -x v] to (x)\nset [enemy: -y v] to (y)\nset [ev v] to (ev)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    repeat (EV)\n        repeat (30)\n            point in direction (90)\n            set rotation style [left-right v]\n            change [enemy: -x v] by (-2)\n        end\n        wait (2) seconds\n        repeat (30)\n            point in direction (-90)\n            set rotation style [left-right v]\n            change [enemy: -x v] by (2)\n        end\n        wait (2) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    Other\nend\n\ndefine Other\nnext costume\nwait (0.1) seconds\n\nwhen I start as a clone\nforever\n    if <touching (bottom sense v)?> then\n        broadcast (Bounce v)\n        set [points x v] to (enemy: -x)\n        set [points y v] to (enemy: -y)\n        start sound [Enemy Kill v]\n        set [point counter v] to [2]\n        change [score v] by (200)\n        repeat until <(y position) < [-179]>\n            change [enemy: -y v] by (-10)\n        end\n        delete this clone\n    end\n    if <<<touching (sonic the hedgehog v)?> and <not <touching (bottom sense v)?>>> and <(spin attack) = [yes]>> then\n        broadcast (Bounce v)\n        set [points x v] to (enemy: -x)\n        set [points y v] to (enemy: -y)\n        start sound [Enemy Kill v]\n        set [point counter v] to [2]\n        change [score v] by (200)\n        repeat until <(y position) < [-179]>\n            change [enemy: -y v] by (-10)\n        end\n        delete this clone\n    end\n    if <<<touching (sonic the hedgehog v)?> and <not <touching (bottom sense v)?>>> and <(spin attack) = [no]>> then\n        hide\n        broadcast (Hurt v)\n        delete this clone\n    end\nend\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nswitch backdrop to (green hills2 v)\n\n@Sprait9\n\nwhen flag clicked\nset [boss health v] to [8]\nhide\n\nwhen backdrop switches to [green hillsboss v]\nset [boss health v] to [20]\nshow variable [boss health v]\nwait (1) seconds\npoint in direction (90)\nset rotation style [all around v]\nforever\n    turn right (2) degrees\nend\n\nwhen backdrop switches to [green hillsboss v]\ngo to [front v] layer\nforever\n    go to (chain v)\nend\n\nwhen backdrop switches to [green hillsboss v]\nset [boss health v] to [20]\nhide\nwait (1) seconds\nshow\npoint in direction (90)\nset rotation style [all around v]\nforever\n    if <(Boss health) < [10]> then\n        turn right (4) degrees\n    end\n    if <touching (sonic the hedgehog v)?> then\n        set [exit v] to [dead]\n    end\n    if <(Boss health) < [1]> then\n        stop [other scripts in sprite v]\n        hide\n        stop [this script v]\n    end\nend\n\nwhen backdrop switches to [green hills loading v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [dead in game v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [zone complete v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\n@enemy2\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((enemy: -x) - (SCROLL X)) (enemy: -y)\n\nwhen I receive [set up v]\nhide\nset size to (100) %\nset [enemy: -x v] to [0]\nset [enemy: -y v] to [0]\nif <(LEVEL) = [LZ]> then\n    switch costume to (costume1 v)\n    Clone at x - [550] y - [32] EV - [99999]\n    Clone at x - [2184] y - [-90] EV - [99999]\nelse\nend\nset [enemy: -x v] to [-99999]\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) EV - (ev)\nset [enemy: -x v] to (x)\nset [enemy: -y v] to (y)\nset [ev v] to (ev)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    repeat (EV)\n        repeat (30)\n            point in direction (90)\n            set rotation style [left-right v]\n            change [enemy: -x v] by (-2)\n        end\n        wait (2) seconds\n        repeat (30)\n            point in direction (-90)\n            set rotation style [left-right v]\n            change [enemy: -x v] by (2)\n        end\n        wait (2) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    Other\nend\n\ndefine Other\nnext costume\nwait (0.1) seconds\n\nwhen I start as a clone\nforever\n    if <touching (bottom sense v)?> then\n        broadcast (Bounce v)\n        set [points x v] to (enemy: -x)\n        set [points y v] to (enemy: -y)\n        start sound [Enemy Kill v]\n        set [point counter v] to [2]\n        change [score v] by (200)\n        repeat until <(y position) < [-179]>\n            change [enemy: -y v] by (-10)\n        end\n        delete this clone\n    end\n    if <<<touching (sonic the hedgehog v)?> and <not <touching (bottom sense v)?>>> and <(spin attack) = [yes]>> then\n        broadcast (Bounce v)\n        set [points x v] to (enemy: -x)\n        set [points y v] to (enemy: -y)\n        start sound [Enemy Kill v]\n        set [point counter v] to [2]\n        change [score v] by (200)\n        repeat until <(y position) < [-179]>\n            change [enemy: -y v] by (-10)\n        end\n        delete this clone\n    end\n    if <<<touching (sonic the hedgehog v)?> and <not <touching (bottom sense v)?>>> and <(spin attack) = [no]>> then\n        hide\n        broadcast (Hurt v)\n        delete this clone\n    end\nend\n\nif <(STAR?) = [OFF]> then\n    broadcast (Hurt v)\nend\n\ncreate clone of (stomp v)\n\nwait (1) seconds\n\nswitch backdrop to (green hills v)\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\n@enemy4\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((enemy: -x) - (SCROLL X)) (enemy: -y)\n\nwhen I receive [set up v]\nhide\nset size to (100) %\nset [enemy: -x v] to [0]\nset [enemy: -y v] to [0]\nif <(LEVEL) = [LZ2]> then\n    switch costume to (costume1 v)\n    Clone at x - [1900] y - [-75] EV - [99999]\nend\nset [enemy: -x v] to [-99999]\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) EV - (ev)\nset [enemy: -x v] to (x)\nset [enemy: -y v] to (y)\nset [ev v] to (ev)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nforever\n    repeat (EV)\n        repeat (30)\n            point in direction (90)\n            set rotation style [left-right v]\n            change [enemy: -x v] by (-2)\n        end\n        wait (2) seconds\n        repeat (30)\n            point in direction (-90)\n            set rotation style [left-right v]\n            change [enemy: -x v] by (2)\n        end\n        wait (2) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    Other\nend\n\ndefine Other\nnext costume\nwait (0.1) seconds\n\nwhen I start as a clone\nforever\n    if <touching (bottom sense v)?> then\n        broadcast (Bounce v)\n        set [points x v] to (enemy: -x)\n        set [points y v] to (enemy: -y)\n        start sound [Enemy Kill v]\n        set [point counter v] to [2]\n        change [score v] by (200)\n        repeat until <(y position) < [-179]>\n            change [enemy: -y v] by (-10)\n        end\n        delete this clone\n    end\n    if <<<touching (sonic the hedgehog v)?> and <not <touching (bottom sense v)?>>> and <(spin attack) = [yes]>> then\n        broadcast (Bounce v)\n        set [points x v] to (enemy: -x)\n        set [points y v] to (enemy: -y)\n        start sound [Enemy Kill v]\n        set [point counter v] to [2]\n        change [score v] by (200)\n        repeat until <(y position) < [-179]>\n            change [enemy: -y v] by (-10)\n        end\n        delete this clone\n    end\n    if <<<touching (sonic the hedgehog v)?> and <not <touching (bottom sense v)?>>> and <(spin attack) = [no]>> then\n        hide\n        broadcast (Hurt v)\n        delete this clone\n    end\nend\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\n@<3 * follow\n\nwhen flag clicked\nset [costume v] to [0]\nhide\nforever\n    wait (pick random (30) to (40)) seconds\n    switch costume to (<3 * follow v)\n    go to x: (0) y: (50)\n    show\n    go to [front v] layer\n    start sound [woosh1 v]\n    repeat (9)\n        change y by (-6)\n    end\n    repeat (5)\n        change y by (3)\n    end\n    repeat (5)\n        change y by (-1)\n    end\n    wait (2) seconds\n    repeat (15)\n        change y by (7)\n    end\n    hide\nend\n\n@Decoration\n\nwhen I receive [green flag v]\nhide\ngo to [back v] layer\n\nwhen I receive [tick v]\nPosition ((Decoration: -x) - (SCROLL X)) ((Decoration: -y) - (SCROLL Y))\n\nwhen I receive [set up v]\nhide\nset [decoration: -x v] to [0]\nset [decoration: -y v] to [0]\nif <(LEVEL) = [SLZ]> then\n    set [decoration: -y v] to [-5]\nend\nif <(LEVEL) = [DEZ]> then\n    set [decoration: -y v] to [-7]\nend\nif <(LEVEL) = [SLZ2]> then\n    set [decoration: -y v] to [-5]\nend\nif <(LEVEL) = [LZ]> then\n    switch costume to (labyrinth2 v)\n    repeat (10)\n        go to [front v] layer\n    end\n    set [color v] effect to (0)\n    Clone at x - [600] y - [48]\n    set [color v] effect to (0)\n    Clone at x - [600] y - [-15]\n    set [color v] effect to (50)\n    Clone at x - [630] y - [-105]\n    set [color v] effect to (0)\n    Clone at x - [1500] y - [5]\n    Clone at x - [510] y - [100]\n    Clone at x - [630] y - [55]\nelse\n    if <(LEVEL) = [LZ2]> then\n        switch costume to (labyrinth02 v)\n        set [color v] effect to (0)\n        Clone at x - [600] y - [145]\n        set [color v] effect to (0)\n        Clone at x - [1150] y - [-215]\n        set [color v] effect to (0)\n    else\n        if <(LEVEL) = [SLZ]> then\n            switch costume to (costume v)\n            set [color v] effect to (0)\n            repeat (2)\n                Clone at x - [200] y - [0]\n            end\n            Clone at x - [4300] y - [0]\n            repeat (2)\n                Clone at x - [200] y - [0]\n            end\n        else\n            if <(LEVEL) = [SLZ2]> then\n                switch costume to (costume v)\n                set [color v] effect to (0)\n                repeat (3)\n                    Clone at x - [200] y - [0]\n                end\n            else\n                if <(LEVEL) = [DEZ]> then\n                    switch costume to (death egg5 v)\n                    set [color v] effect to (0)\n                else\n                    hide\n                    stop [other scripts in sprite v]\n                    delete this clone\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\nif <<not <(LEVEL) = [SLZ2]>> and <<not <(LEVEL) = [SLZ]>> and <<not <(LEVEL) = [DEZ]>> and <<not <(LEVEL) = [LZ]>> and <not <(LEVEL) = [LZ2]>>>>>> then\n    hide\n    stop [other scripts in sprite v]\n    stop [this script v]\nend\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 [decoration: -x v] by (x)\nchange [decoration: -y v] by (y)\nnext costume\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\n@front page\n\nwhen flag clicked\nhide\n\nshow\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\n\n@Platforms2\n\nwhen I receive [green flag v]\nhide\ngo to [back v] layer\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [zone complete v]\nhide variable [lives v]\nhide variable [boss health v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [death eggboss v]\nset [brightness v] effect to (-50)\nset [ghost v] effect to (0)\nshow\ngo to x: (0) y: (200)\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [death eggboss v]\nshow\nforever\n    switch costume to (death egg12 v)\n    go to [front v] layer\n    wait (0) seconds\n    switch costume to (death egg13 v)\n    wait (0) seconds\nend\n\nwhen I receive [hide the plats v]\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [victory v]\nstop [other scripts in sprite v]\n\nwhen I receive [#1 victory v]\nstop [other scripts in sprite v]\nhide\n\n@code lister\n\nwhen flag clicked\nforever\n    if <key (t v) pressed?> then\n        start sound [Dialogue v]\n        delete all of [your code v]\n        hide list [your code v]\n        add [This is your code. Be sure to write it down every time the code updates ] to [your code v]\n        add (code) to [your code v]\n        add [put the code in load game to retrieve your data \(if you have any\)] to [your code v]\n        wait (1) seconds\n        wait until <key (t v) pressed?>\n        show list [your code v]\n        play sound [Dialogue v] until done\n    end\nend\n\n@BG1\n\nwhen I receive [green flag v]\nhide\ngo to [back v] layer\n\nwhen I receive [tick v]\nPosition ((Decoration: -x) - (background scrollX)) [0]\n\nwhen I receive [set up v]\nset [background scrollx v] to [0]\nhide\nset [decoration: -x v] to [0]\nset [decoration: -y v] to [0]\ngo to [back v] layer\nif <(LEVEL) = [GHZ]> then\n    set [color v] effect to (0)\n    switch costume to (world 1 v)\n    repeat (10)\n        Clone at x - [480] y - [0]\n    end\nelse\n    if <(LEVEL) = [GHZ2]> then\n        set [color v] effect to (0)\n        repeat (10)\n            switch costume to (world 1 in the mountains v)\n            Clone at x - [480] y - [0]\n            switch costume to (world 1 in the mountains2 v)\n            Clone at x - [480] y - [0]\n        end\n    else\n        if <(LEVEL) = [LZ]> then\n            set [color v] effect to (0)\n            switch costume to (labyrinth background v)\n            repeat (10)\n                Clone at x - [480] y - [0]\n            end\n        else\n            if <(LEVEL) = [LZ2]> then\n                set [color v] effect to (0)\n                switch costume to (labyrinth background v)\n                repeat (10)\n                    Clone at x - [480] y - [0]\n                end\n            else\n                if <(LEVEL) = [SLZ]> then\n                    set [color v] effect to (0)\n                    switch costume to (starlight backdrop v)\n                    repeat (10)\n                        Clone at x - [480] y - [0]\n                    end\n                else\n                    if <(LEVEL) = [SLZ2]> then\n                        set [color v] effect to (0)\n                        switch costume to (starlight backdrop v)\n                        repeat (10)\n                            Clone at x - [480] y - [0]\n                        end\n                    else\n                        if <(LEVEL) = [DEZ]> then\n                            set [color v] effect to (0)\n                            switch costume to (genesis 32x scd - sonic & knuckles - the doomsday zone\(1\) v)\n                            repeat (13)\n                                Clone at x - [480] y - [0]\n                            end\n                        else\n                            if <(LEVEL) = [GGZ]> then\n                                set [color v] effect to (70)\n                                switch costume to (sky chase v)\n                                repeat (13)\n                                    Clone at x - [480] y - [0]\n                                end\n                            else\n                                stop [other scripts in sprite v]\n                                hide\n                                stop [this script v]\n                            end\n                        end\n                    end\n                end\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 [decoration: -x v] by (x)\nchange [decoration: -y v] by (y)\n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [labyrinth loading v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [death egg loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [green hills loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [starlight loading v]\nstop [other scripts in sprite v]\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntlet cutscene4 v]\nset [decoration: -x v] to [0]\nset [decoration: -y v] to [0]\nset [background scrollx v] to [0]\ngo to x: (0) y: (0)\nset [color v] effect to (0)\nswitch costume to (boss 5 v)\ngo to [back v] layer\nrepeat (20)\n    Clone at x - [480] y - [0]\nend\nforever\n    change [background scrollx v] by (2)\n    broadcast (Tick v)\nend\n\nwhen I receive [the end v]\nstop [other scripts in sprite v]\nset [background scrollx v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [green hillsboss v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [labyrinthboss v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [starlight3 v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [death eggboss v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\nwhen backdrop switches to [gadget gauntletboss v]\nstop [other scripts in sprite v]\nhide\nset [platforms: -x v] to [0]\nset [platforms: -y v] to [0]\nhide\ndelete this clone\n\n@timer\n\nwhen flag clicked\nhide variable [dez time v]\nhide variable [slz time v]\nhide variable [ghz time v]\nhide variable [lz time v]\nhide variable [ggz time v]\nset [ggz time v] to [0]\nset [ghz time v] to [0]\nset [lz time v] to [0]\nset [dez time v] to [0]\nset [slz time v] to [0]\nhide\n\nset [ggz time v] to [0]\nset [ghz time v] to [0]\nset [lz time v] to [0]\nset [dez time v] to [0]\nset [slz time v] to [0]\n\nwhen backdrop switches to [green hills v]\nshow\ngo to [front v] layer\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [ghz time v]\nforever\n    wait (1) seconds\n    change [ghz time v] by (1)\nend\n\nwhen I receive [victory v]\nstop [other scripts in sprite v]\nwait (2) seconds\nhide variable [dez time v]\nhide variable [slz time v]\nhide variable [ghz time v]\nhide variable [ggz time v]\nhide variable [lz time v]\nhide\n\nwhen backdrop switches to [green hills2 v]\nshow\ngo to [front v] layer\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [ghz time v]\nforever\n    wait (1) seconds\n    go to [front v] layer\n    change [ghz time v] by (1)\nend\n\nwhen backdrop switches to [green hillsboss v]\nshow\ngo to [front v] layer\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [ghz time v]\nforever\n    wait (1) seconds\n    change [ghz time v] by (1)\nend\n\nwhen backdrop switches to [green hills loading v]\nhide variable [☁ dez best v]\nhide variable [☁ ghz best v]\nhide variable [☁ lz best v]\nhide variable [☁ ggz best v]\nhide variable [☁ slz best v]\nwait (1) seconds\nif <(LEVEL) = [GHZ]> then\n    set [ghz time v] to [0]\nend\n\nwhen backdrop switches to [begin game v]\nhide variable [dez time v]\nhide variable [slz time v]\nhide variable [ghz time v]\nhide variable [lz time v]\nhide variable [ggz time v]\nset [ggz time v] to [0]\nset [ghz time v] to [0]\nset [lz time v] to [0]\nset [dez time v] to [0]\nset [slz time v] to [0]\nhide\n\nwhen backdrop switches to [labyrinth v]\nshow\ngo to [front v] layer\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [lz time v]\nforever\n    wait (1) seconds\n    change [lz time v] by (1)\n    go to [front v] layer\nend\n\nwhen backdrop switches to [labyrinth2 v]\nshow\ngo to [front v] layer\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [lz time v]\nforever\n    wait (1) seconds\n    change [lz time v] by (1)\nend\n\nwhen backdrop switches to [labyrinthboss v]\nshow\ngo to [front v] layer\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [lz time v]\nforever\n    wait (1) seconds\n    change [lz time v] by (1)\nend\n\nwhen backdrop switches to [labyrinth loading v]\nhide variable [☁ dez best v]\nhide variable [☁ ghz best v]\nhide variable [☁ lz best v]\nhide variable [☁ ggz best v]\nhide variable [☁ slz best v]\nwait (1) seconds\nif <(LEVEL) = [LZ]> then\n    set [lz time v] to [0]\nend\n\nwhen backdrop switches to [starlight loading v]\nhide variable [☁ dez best v]\nhide variable [☁ ghz best v]\nhide variable [☁ lz best v]\nhide variable [☁ ggz best v]\nhide variable [☁ slz best v]\nwait (1) seconds\nif <(LEVEL) = [SLZ]> then\n    set [slz time v] to [0]\nend\n\nwhen backdrop switches to [death egg loading v]\nhide variable [☁ dez best v]\nhide variable [☁ ghz best v]\nhide variable [☁ lz best v]\nhide variable [☁ ggz best v]\nhide variable [☁ slz best v]\nwait (1) seconds\nif <(LEVEL) = [DEZ]> then\n    set [dez time v] to [0]\nend\n\nwhen backdrop switches to [gadget gauntlet loading v]\nhide variable [☁ dez best v]\nhide variable [☁ ghz best v]\nhide variable [☁ lz best v]\nhide variable [☁ ggz best v]\nhide variable [☁ slz best v]\nwait (1) seconds\nif <(LEVEL) = [GGZ]> then\n    set [ggz time v] to [0]\nend\n\nwhen backdrop switches to [starlight v]\nshow\ngo to [front v] layer\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [slz time v]\nforever\n    go to [front v] layer\n    wait (1) seconds\n    change [slz time v] by (1)\nend\n\nwhen backdrop switches to [starlight2 v]\nshow\ngo to [front v] layer\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [slz time v]\nforever\n    wait (1) seconds\n    go to [front v] layer\n    change [slz time v] by (1)\nend\n\nwhen backdrop switches to [starlight3 v]\nshow\ngo to [front v] layer\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [slz time v]\nforever\n    wait (1) seconds\n    go to [front v] layer\n    change [slz time v] by (1)\nend\n\nwhen backdrop switches to [death egg v]\nshow\ngo to [front v] layer\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [dez time v]\nforever\n    wait (1) seconds\n    change [dez time v] by (1)\nend\n\nwhen backdrop switches to [death eggboss v]\nshow\ngo to [front v] layer\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [dez time v]\nforever\n    wait (1) seconds\n    change [dez time v] by (1)\nend\n\nwhen backdrop switches to [gadget gauntlet v]\nshow\ngo to [front v] layer\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [ggz time v]\nforever\n    wait (1) seconds\n    go to [front v] layer\n    change [ggz time v] by (1)\nend\n\nwhen backdrop switches to [gadget gauntletboss v]\nshow\ngo to x: (-189) y: (162)\nset size to (150) %\nshow variable [ggz time v]\nforever\n    go to [front v] layer\n    wait (1) seconds\n    change [ggz time v] by (1)\nend\n\nwhen I receive [#1 victory v]\nstop [other scripts in sprite v]\nwait (2) seconds\nhide variable [dez time v]\nhide variable [slz time v]\nhide variable [ghz time v]\nhide variable [ggz time v]\nhide variable [lz time v]\nhide\n\nwhen flag clicked\nhide variable [☁ dez best v]\nhide variable [☁ ghz best v]\nhide variable [☁ lz best v]\nhide variable [☁ ggz best v]\nhide variable [☁ slz best v]\nhide\n\nwhen backdrop switches to [begin game v]\nwait (2) seconds\nshow variable [☁ dez best v]\nshow variable [☁ ggz best v]\nshow variable [☁ lz best v]\nshow variable [☁ slz best v]\nshow variable [☁ ghz best v]\n\nwhen backdrop switches to [beginning of game cutscene v]\nstop [other scripts in sprite v]\nhide variable [☁ dez best v]\nhide variable [☁ ghz best v]\nhide variable [☁ lz best v]\nhide variable [☁ ggz best v]\nhide variable [☁ slz best v]\nhide\n\nset [☁ ggz best v] to [999]\nset [☁ dez best v] to [999]\nset [☁ ghz best v] to [999]\nset [☁ lz best v] to [999]\nset [☁ slz best v] to [999]\n\nwhen backdrop switches to [zone complete v]\nstop [other scripts in sprite v]\nwait (1) seconds\nif <<(LEVEL) = [GHZ3]> and <(GHZ Time) < (☁ GHZ Best)>> then\n    start sound [ring v]\n    set [☁ ghz best v] to (GHZ Time)\n    stop [this script v]\nend\nif <<(LEVEL) = [LZ3]> and <(LZ TIME) < (☁ LZ Best)>> then\n    start sound [ring v]\n    set [☁ lz best v] to (LZ TIME)\n    stop [this script v]\nend\nif <<(LEVEL) = [SLZ3]> and <(SLZ TIME) < (☁ SLZ Best)>> then\n    start sound [ring v]\n    set [☁ slz best v] to (SLZ TIME)\n    stop [this script v]\nend\nif <<(LEVEL) = [DEZ2]> and <(DEZ TIME) < (☁ DEZ Best)>> then\n    start sound [ring v]\n    set [☁ dez best v] to (DEZ TIME)\n    stop [this script v]\nend\nif <<(LEVEL) = [GGZ2]> and <(GGZ TIME) < (☁ GGZ Best)>> then\n    start sound [ring v]\n    set [☁ ggz best v] to (GGZ TIME)\n    stop [this script v]\nend\n\nwhen I receive [game over v]\nstop [other scripts in sprite v]\nhide variable [dez time v]\nhide variable [slz time v]\nhide variable [ghz time v]\nhide variable [ggz time v]\nhide variable [lz time v]\nwait (2) seconds\nhide\n\n@special effects \n\nwhen backdrop switches to [begin game v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [gadget gauntlet loading v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [beginning of game cutscene v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [code v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [mode select v]\nset [ghost v] effect to (100)\nhide\ngo to [front v] layer\nswitch costume to (menu v)\ngo to x: (166) y: (-114)\nwait (1) seconds\nforever\n    if <(Mode clicked) = [1]> then\n        switch costume to (menu v)\n        set [ghost v] effect to (100)\n        show\n        repeat (20)\n            change [ghost v] effect by (-5)\n        end\n        wait until <not <(Mode clicked) = [1]>>\n    end\n    if <not <(Mode clicked) = [1]>> then\n        switch costume to (options icons v)\n        set [ghost v] effect to (100)\n        show\n        repeat (20)\n            change [ghost v] effect by (-5)\n        end\n        wait until <(Mode clicked) = [1]>\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (0)\nhide\n\n@touchpad\n\nwhen flag clicked\nset [touch left v] to [0]\nset [touch up left v] to [0]\nset [touch right v] to [0]\nhide variable [touch up right v]\nhide variable [touch up left v]\nhide variable [touch up v]\nhide variable [touch left v]\nhide variable [touch up right v]\nset [clone id v] to [0]\nset [touch up right v] to [0]\nset [touch up v] to [0]\nset [ghost v] effect to (99)\nhide\n\nwhen I receive [play game v]\nset [clone id v] to [0]\nset [ghost v] effect to (99)\nshow\nswitch costume to (costume1 v)\nif <(Mobile mode on?) = [yes]> then\n    repeat (4)\n        change [clone id v] by (1)\n        create clone of (_myself_ v)\n    end\n    set [clone id v] to [0]\n    wait (1) seconds\nelse\n    stop [other scripts in sprite v]\n    hide\n    stop [this script v]\nend\nswitch costume to (costume1 v)\nforever\n    if <(Mobile mode on?) = [yes]> then\n        go to [front v] layer\n        if <<(backdrop [number v]) = [8]> or <<(backdrop [number v]) = [15]> or <(backdrop [number v]) = [19]>>> then\n            go to x: (0) y: (0)\n        else\n            go to x: (0) y: (0)\n        end\n        if <not <mouse down?>> then\n            set [touch right v] to [0]\n            set [touch up left v] to [0]\n            set [touch up right v] to [0]\n            set [touch left v] to [0]\n            set [touch up v] to [0]\n        end\n    else\n        stop [other scripts in sprite v]\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [#1 victory v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen I start as a clone\nif <(clone ID) = [1]> then\n    set [ghost v] effect to (99)\n    show\n    switch costume to (costume2 v)\n    wait (1) seconds\n    forever\n        if <(Mobile mode on?) = [yes]> then\n            go to [front v] layer\n            go to x: (0) y: (0)\n        else\n            delete this clone\n        end\n    end\nend\nif <(clone ID) = [2]> then\n    set [ghost v] effect to (99)\n    show\n    switch costume to (costume3 v)\n    wait (1) seconds\n    forever\n        if <(Mobile mode on?) = [yes]> then\n            go to [front v] layer\n            if <<(backdrop [number v]) = [8]> or <<(backdrop [number v]) = [15]> or <(backdrop [number v]) = [19]>>> then\n                go to x: (0) y: (0)\n            else\n                go to x: (0) y: (0)\n            end\n        else\n            delete this clone\n        end\n    end\nend\nif <(clone ID) = [3]> then\n    set [ghost v] effect to (99)\n    show\n    switch costume to (costume4 v)\n    wait (1) seconds\n    forever\n        if <(Mobile mode on?) = [yes]> then\n            go to [front v] layer\n            go to x: (0) y: (0)\n        else\n            delete this clone\n        end\n    end\nend\nif <(clone ID) = [4]> then\n    set [ghost v] effect to (99)\n    show\n    switch costume to (costume5 v)\n    wait (1) seconds\n    forever\n        if <(Mobile mode on?) = [yes]> then\n            go to [front v] layer\n            if <<(backdrop [number v]) = [8]> or <<(backdrop [number v]) = [15]> or <(backdrop [number v]) = [19]>>> then\n                go to x: (0) y: (0)\n            else\n                go to x: (0) y: (0)\n            end\n        else\n            delete this clone\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(clone ID) = [3]> then\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [touch right v] to [1]\n            set [touch up left v] to [0]\n            set [touch up right v] to [0]\n            set [touch left v] to [0]\n            set [touch up v] to [0]\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(clone ID) = [1]> then\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [touch left v] to [1]\n            set [touch up right v] to [0]\n            set [touch right v] to [0]\n            set [touch up v] to [0]\n            set [touch up left v] to [0]\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(clone ID) = [4]> then\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [touch up v] to [1]\n            set [touch up right v] to [0]\n            set [touch right v] to [0]\n            set [touch up left v] to [0]\n            set [touch left v] to [0]\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(clone ID) = [2]> then\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [touch up right v] to [1]\n            set [touch right v] to [0]\n            set [touch up left v] to [0]\n            set [touch left v] to [0]\n            set [touch up v] to [0]\n        end\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <(clone ID) = [0]> then\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            set [touch up left v] to [1]\n            set [touch up right v] to [0]\n            set [touch right v] to [0]\n            set [touch left v] to [0]\n            set [touch up v] to [0]\n        end\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\nset size to (100) %\ngo to x: (-153) y: (-124)\nshow\n\nwhen this sprite clicked\nbroadcast (screen transition v)\nhide\n\nwhen backdrop switches to [title v]\ngo [backward v] (999) layers\nhide\n\ngo to x: (183) y: (-116)\n\n