Wizard Tales [DEMO] - A Platformer by KettleClog

Instructions: - - - - - - - - - - HOW TO PLAY / CONTROLS: - - - - - - - - - -\n\nThere are 2 control types - arrow keys and WASD. \n\nWASD CONTROL TYPE:\nWASD - Movement\nSpace / W - Jump\nP - Shoot\nO - Air Dash\n\nARROW KEY CONTROL TYPE:\nArrow keys - Movement\nSpace / Up Arrow - Jump\nP - Shoot\nO - Air Dash\n\nRemember to use the air dash - you won't get too far without it!\n\n- - - - - - - - - - - - - ABOUT THIS GAME - - - - - - - - - - - - - -\n\nWizard Tales is a retro-style platformer inspired by NES games such as Mega Man and Castlevania. Fight and platform your way through a variety challenging stages and beat as many bosses as you can. Rescue fellow wizards as you progress through the game; their abilities will prove useful against the armies of monsters in your way. Think you have what it takes? Have fun!\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

@Stage\n\nwhen flag clicked\nclear graphic effects\nswitch backdrop to (cutscene v)\n\nwhen I receive [level start v]\nclear graphic effects\nstop [other scripts in sprite v]\nswitch backdrop to (sky 1 v)\n\n@Music\n\nwhen I receive [start player v]\nwait (0.2) seconds\nset volume to (100) %\nif < ([costume name v] of [ground v]) contains [1-]?> then\n    play sound [1 - Pine Forest Intro v] until done\n    forever\n        play sound [1 - Pine Forest v] until done\n    end\nend\nif < ([costume name v] of [ground v]) contains [2-]?> then\n    play sound [2 - Goblin Mines Intro v] until done\n    forever\n        play sound [2 - Goblin Mines v] until done\n    end\nend\nif < ([costume name v] of [ground v]) contains [3-]?> then\n    forever\n        play sound [3 - Thunder Fields v] until done\n    end\nend\n\nwhen I receive [fade out music v]\nrepeat (25)\n    change volume by (-4)\nend\nstop all sounds\nstop [other scripts in sprite v]\nwait (1) seconds\nset volume to (100) %\nplay sound [Wizard Fight Intro v] until done\nforever\n    play sound [Wizard Fight v] until done\nend\n\nwhen I receive [dragon die v]\nrepeat (25)\n    change volume by (-4)\nend\nstop all sounds\nstop [other scripts in sprite v]\nwait (1) seconds\nset volume to (100) %\n\nwhen I receive [level clear v]\nset volume to (100) %\nbroadcast (STAGE CLEAR TEXT v)\nplay sound [Stage Clear v] until done\n\nwhen I receive [only stop music \(fade out\) v]\nrepeat (25)\n    change volume by (-4)\nend\nstop all sounds\nstop [other scripts in sprite v]\nwait (1) seconds\nset volume to (100) %\n\n@Sprites\n\nwhen flag clicked\nclear graphic effects\nhide\n\nforever\n    next costume\n    wait (0.1) seconds\nend\n\n@Player Spawn Animation\n\nwhen I start as a clone\nshow\nrepeat (4)\n    move (8) steps\nend\nrepeat (3)\n    move (4) steps\nend\nrepeat (2)\n    move (2) steps\nend\nrepeat (1)\n    move (1) steps\nend\nwait (0.1) seconds\nrepeat (1)\n    move (-1) steps\nend\nrepeat (2)\n    move (-2) steps\nend\nrepeat (3)\n    move (-4) steps\nend\nrepeat (4)\n    move (-8) steps\nend\nset [player begin v] to [Y]\nbroadcast (Start Player v)\ndelete this clone\n\nwhen I start as a clone\nforever\n    next costume\nend\n\nwhen I receive [level start v]\nset [player begin v] to [N]\nwait (1) seconds\nstart sound [Teleport2 v]\ngo to (p_collsion v)\npoint in direction (90)\ncreate clone of (_myself_ v)\npoint in direction (45)\ncreate clone of (_myself_ v)\npoint in direction (0)\ncreate clone of (_myself_ v)\npoint in direction (-45)\ncreate clone of (_myself_ v)\npoint in direction (-90)\ncreate clone of (_myself_ v)\npoint in direction (-135)\ncreate clone of (_myself_ v)\npoint in direction (180)\ncreate clone of (_myself_ v)\npoint in direction (135)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\n@P_Collsion\n\nwhen I receive [level start v]\nforever\n    if <<touching (liquid v)?> and <touching (_edge_ v)?>> then\n        start sound [Splash v]\n        set [bullet x v] to (x position)\n        set [bullet y v] to (y position)\n        broadcast (Bullet Particle v)\n        broadcast (INSTA KILL v)\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\nwhen I receive [level start v]\nshow\nforever\n    if <(username) = [KettleClog]> then\n        if <key (e v) pressed?> then\n            set y to (0)\n            set [speed y v] to [5]\n            wait until <not <key (e v) pressed?>>\n        end\n    end\nend\n\nwhen I receive [level start v]\nwait until <(player begin) = [Y]>\nset [gravity v] to [-2]\nset [jump force v] to [17]\nset [acceleration v] to [1.2]\nset [resistance v] to [0.8]\nset [speed y v] to [-1]\nset [speed x v] to [0]\nforever\n    if <(Player Motion) = [Y]> then\n        if <<key (space v) pressed?> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n            if <(Dash) = [N]> then\n                if <(falling) < [2]> then\n                    set [speed y v] to (JUMP FORCE)\n                end\n            end\n        end\n        if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n            set [direction v] to [LEFT]\n            change [speed x v] by ((0) - (ACCELERATION))\n        end\n        if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n            set [direction v] to [RIGHT]\n            change [speed x v] by (ACCELERATION)\n        end\n    end\n    set [speed x v] to ((speed x) * (RESISTANCE))\n    if <(Dash) = [N]> then\n        change [speed y v] by (GRAVITY)\n    end\n    Move - In steps (([abs v] of (speed x) ) + ([abs v] of (speed y) ))\nend\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\n\ndefine Move - In steps (steps)\nchange [falling v] by (1)\nrepeat (steps)\n    set [last value v] to (x position)\n    change x by ((speed x) / (steps))\n    if <touching (ground v)?> then\n        set x to (last value)\n        set [speed x v] to [0]\n    end\n    set [last value v] to (y position)\n    change y by ((speed y) / (steps))\n    if <touching (ground v)?> then\n        set y to (last value)\n        if <(speed y) < [0]> then\n            set [falling v] to [0]\n        end\n        set [speed y v] to [0]\n    end\nend\n\nwhen I receive [level start v]\nforever\n    if <not < ([costume name v] of [ground v]) contains [BOSS]?>> then\n        if <(x position) > [239]> then\n            set [player was touching ground v] to [N]\n            change y by (2)\n            broadcast (Right v)\n            set x to (-240)\n            change y by (2)\n            set [respawnx v] to ((x position) + (20))\n            set [respawn y v] to ((y position) + (2))\n            wait (0.01) seconds\n            broadcast (Clear up Clones v)\n            wait until <not <(x position) > [239]>>\n        end\n    end\nend\n\nwhen I receive [start player v]\nset [dash v] to [N]\nwait until <not <key (o v) pressed?>>\nwait until <(falling) < [2]>\nforever\n    if <(Player Motion) = [Y]> then\n        if <key (o v) pressed?> then\n            start sound [dash v]\n            broadcast (Dash v)\n            set [dash v] to [Y]\n            if <<not <(speed x) = [18]>> or <not <(speed x) = [-18]>>> then\n                if <(direction) = [RIGHT]> then\n                    repeat (10)\n                        set [speed x v] to [10]\n                        set [speed y v] to [0]\n                    end\n                else\n                    repeat (10)\n                        set [speed x v] to [-10]\n                        set [speed y v] to [0]\n                    end\n                end\n                set [dash v] to [N]\n                wait until <not <key (o v) pressed?>>\n                wait until <(falling) < [2]>\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [direction v] to [RIGHT]\n\nwhen I receive [level start v]\nset [player motion v] to [Y]\nforever\n    if <[-170] > (y position)> then\n        if <not <touching (liquid v)?>> then\n            set [speed y v] to [0]\n            set y to (200)\n            broadcast (Right v)\n            set [respawnx v] to (x position)\n            set [respawn y v] to (y position)\n            wait (0.01) seconds\n            broadcast (Clear up Clones v)\n            wait until <not <[-170] > (y position)>>\n        end\n    end\nend\n\nwhen I receive [screen shake! v]\nrepeat (3)\n    change y by (15)\n    wait (0.01) seconds\n    change y by (-15)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (10)\n    wait (0.01) seconds\n    change y by (-10)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (5)\n    wait (0.01) seconds\n    change y by (-5)\n    wait (0.01) seconds\nend\n\nwhen I receive [player dead v]\nset [player motion v] to [N]\n\nwhen I receive [you died - letters v]\nstop [other scripts in sprite v]\nset [gravity v] to [-2]\nset [jump force v] to [17]\nset [acceleration v] to [1.2]\nset [resistance v] to [0.8]\nset [speed y v] to [0]\nset [speed x v] to [0]\ngo to x: (-180) y: (-122)\n\nwhen I receive [level start v]\ngo to x: (-180) y: (-122)\nshow\n\nwhen I receive [right v]\nif <(speed y) = [0]> then\n\nwhen flag clicked\nset y to (-170)\n\nwhen I receive [0-entermap v]\nstop [other scripts in sprite v]\nhide\n\n@P_Visual\n\nwhen I receive [0-entermap v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [start player v]\nclear graphic effects\npoint in direction (90)\nshow\nset rotation style [left-right v]\nforever\n    go to (p_collsion v)\n    if <([dash v] of [p_collsion v]) = [N]> then\n        if <(Player Motion) = [Y]> then\n            if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n                point in direction (-90)\n            end\n            if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n                point in direction (90)\n            end\n            if <([falling v] of [p_collsion v]) > [0]> then\n                switch costume to (ij v)\n            else\n                if <not <<key (a v) pressed?> or <<key (d v) pressed?> or <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>>>>> then\n                    change [player frame v] by (0.08)\n                    switch costume to ((1) + (([floor v] of (player frame) ) mod (2)))\n                else\n                    change [player frame v] by (0.3)\n                    switch costume to ((1) + (([floor v] of (player frame) ) mod (2)))\n                end\n            end\n        end\n        if <(Player Motion) = [N]> then\n            change [player frame v] by (0.08)\n            switch costume to ((1) + (([floor v] of (player frame) ) mod (2)))\n        end\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [damage taken v]\nif <not <(costume [name v]) = [IDC]>> then\n    start sound [Hurt v]\n    set [ghost v] effect to (50)\n    set [brightness v] effect to (80)\n    repeat (8)\n        change [brightness v] effect by (-10)\n    end\n    wait (1.2) seconds\n    set [ghost v] effect to (0)\nend\n\nwhen I receive [level start v]\nforever\n\nif <<(y position) < [-170]> and <touching (liquid v)?>> then\n    hide\nend\n\nshow\n\nwhen I receive [dash v]\nif <not <(costume [name v]) = [IDC]>> then\n    repeat (5)\n        wait (0.03) seconds\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I receive [right v]\ndelete this clone\n\nwhen I start as a clone\nclear graphic effects\nswitch costume to (idc v)\nset [ghost v] effect to (0)\nset [brightness v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (12)\nend\ndelete this clone\n\nwhen I receive [dash v]\nif <not <(costume [name v]) = [IDC]>> then\n    repeat until <([dash v] of [p_collsion v]) = [N]>\n        switch costume to (id v)\n    end\n    repeat (1)\n        switch costume to (id v)\n    end\n    stop [this script v]\nend\n\nwhen I receive [level start v]\nset [sign? v] to [N]\nforever\n    if <touching (sign v)?> then\n        set [sign? v] to [Y]\n    else\n        set [sign? v] to [N]\n    end\nend\n\nwhen flag clicked\nset [sign? v] to [N]\n\nwhen I receive [level start v]\ngo to [front v] layer\n\nwhen I receive [clear up clones v]\ndelete this clone\n\nwhen I receive [screen shake! v]\nrepeat (3)\n    change y by (15)\n    wait (0.01) seconds\n    change y by (-15)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (10)\n    wait (0.01) seconds\n    change y by (-10)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (5)\n    wait (0.01) seconds\n    change y by (-5)\n    wait (0.01) seconds\nend\n\nwhen I receive [player dead v]\nif <not <(costume [name v]) = [IDC]>> then\n    go to [front v] layer\n    start sound [kingknight_land2 v]\n    broadcast (SCREEN SHAKE! v)\n    stop [other scripts in sprite v]\n    clear graphic effects\n    broadcast (only stop music \(fade out\) v)\n    switch costume to (idead v)\n    wait (1) seconds\n    hide\n    broadcast (PLAYER EXPLODE v)\n    wait (3) seconds\n    broadcast ("YOU DIED" SCREEN v)\nend\n\nwhen I receive [player dead v]\ndelete this clone\n\nwhen I receive [start player v]\nset [brightness v] effect to (80)\nrepeat (8)\n    change [brightness v] effect by (-10)\nend\n\n@P_Hurtbox\n\nwhen I receive [level start v]\nshow\nset [ghost v] effect to (100)\ngo to [back v] layer\nset rotation style [don't rotate v]\nforever\n    go to (p_collsion v)\nend\n\nwhen I receive [level start v]\nforever\n    if <(Player Motion) = [Y]> then\n        if <<touching (fire hopper v)?> or <<touching (shroom v)?> or <<touching (shroom bullet v)?> or <<touching (fish v)?> or <<touching (devil v)?> or <<touching (devil bullet v)?> or <<touching (dragon v)?> or <<touching (dragon head v)?> or <<touching (dragon fire v)?> or >>>>>>>>> then\n            broadcast (Damage Taken v)\n            wait (1.5) seconds\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [player dead v]\nhide\n\n@P_Bullet\n\nwhen flag clicked\nset [player begin v] to [N]\nset [player motion v] to [N]\nswitch costume to (control v)\nhide\n\nwhen I receive [level start v]\ngo to [front v] layer\nswitch costume to (control v)\nhide\nwait until <(player begin) = [Y]>\nforever\n    if <(Player Motion) = [Y]> then\n        if <([dash v] of [p_collsion v]) = [N]> then\n            if <key (p v) pressed?> then\n                go to (p_visual v)\n                create clone of (_myself_ v)\n                wait until <not <key (p v) pressed?>>\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nstart sound [wizard_fire v]\nshow\nset rotation style [left-right v]\npoint in direction ([direction v] of [p_visual v])\nif <([direction v] of [p_visual v]) = [90]> then\n    move ((20) + ([speed x v] of [p_collsion v])) steps\nelse\n    move ((20) - ([speed x v] of [p_collsion v])) steps\nend\nchange y by (-12)\nswitch costume to (form1 v)\nwait (0.02) seconds\nswitch costume to (form2 v)\nwait (0.02) seconds\ngo to [front v] layer\nswitch costume to (bullet v)\nrepeat (2)\n    move (13) steps\nend\nswitch costume to (bullet2 v)\nrepeat until <touching (_edge_ v)?>\n    move (13) steps\nend\ndelete this clone\n\nwhen I receive [right v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <<touching (fire hopper v)?> or <<touching (shroom v)?> or <<touching (fish v)?> or <<touching (devil v)?> or <<touching (dragon v)?> or >>>>> then\n        set [bullet x v] to (x position)\n        set [bullet y v] to (y position)\n        set [ghost v] effect to (100)\n        switch costume to (hitbox v)\n        move (13) steps\n        broadcast (Enemy Flash v)\n        broadcast (Bullet Particle v)\n        wait (0.0001) seconds\n        delete this clone\n    end\nend\n\nwhen I receive [clear up clones v]\ndelete this clone\n\nwhen I receive [player dead v]\ndelete this clone\n\n@TEXT\n\nwhen I receive [damage taken v]\nswitch costume to (ouch! v)\ngo to (p_collsion v)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nrepeat (6)\n    change y by (6)\nend\nrepeat (3)\n    change y by (3)\nend\nrepeat (2)\n    change y by (2)\nend\nrepeat (1)\n    change y by (1)\nend\nif <(costume [name v]) = [CHECKPOINT]> then\n    wait (0.2) seconds\nend\nrepeat (10)\n    show\n    wait (0.02) seconds\n    hide\n    wait (0.02) seconds\nend\ndelete this clone\n\nwhen I receive [right v]\ndelete this clone\n\nwhen I receive [checkpoint v]\nswitch costume to (checkpoint v)\ngo to (checkpoint v)\nchange x by (10)\ncreate clone of (_myself_ v)\n\n@GROUND\n\nwhen flag clicked\nswitch costume to (1-1 v)\nhide\ngo to x: (0) y: (-4)\n\nwhen I receive [level start v]\nshow\nforever\n    if <(username) = [KettleClog]> then\n        if <key (e v) pressed?> then\n            broadcast (Right v)\n            wait until <not <key (e v) pressed?>>\n        end\n    end\nend\n\nwhen I receive [right v]\nnext costume\nif <(costume [name v]) = [TILESET]> then\n    next costume\nend\n\nwhen I receive [screen shake! v]\nrepeat (3)\n    change y by (15)\n    wait (0.01) seconds\n    change y by (-15)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (10)\n    wait (0.01) seconds\n    change y by (-10)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (5)\n    wait (0.01) seconds\n    change y by (-5)\n    wait (0.01) seconds\nend\n\nwhen I receive [you died - letters v]\nif << (costume [name v]) contains [1-]?> and <not <(costume [name v]) = [1-BOSS]>>> then\n    switch costume to (1-1 v)\nend\nif <(costume [name v]) = [1-BOSS]> then\n    switch costume to (1-13 v)\nend\n\n@BG\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\nwhen I receive [level start v]\nshow\ngo to x: (0) y: (-4)\nforever\n    switch costume to ([costume name v] of [ground v])\nend\n\nwhen I receive [screen shake! v]\nrepeat (3)\n    change y by (15)\n    wait (0.01) seconds\n    change y by (-15)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (10)\n    wait (0.01) seconds\n    change y by (-10)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (5)\n    wait (0.01) seconds\n    change y by (-5)\n    wait (0.01) seconds\nend\n\n@Clouds\n\nwhen I receive [level start v]\nshow\nswitch costume to (blue_f v)\ngo to [back v] layer\ngo to x: (0) y: (50)\nforever\n    go to [back v] layer\n    repeat (503)\n        change x by (-1)\n        wait (0.1) seconds\n    end\n    go to x: (0) y: (50)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [screen shake! v]\nrepeat (3)\n    change y by (15)\n    wait (0.01) seconds\n    change y by (-15)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (10)\n    wait (0.01) seconds\n    change y by (-10)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (5)\n    wait (0.01) seconds\n    change y by (-5)\n    wait (0.01) seconds\nend\n\n@Far BG\n\nwhen flag clicked\ngo to x: (0) y: (10)\nswitch costume to (tree1 v)\nhide\ngo to [back v] layer\n\nwhen I receive [right v]\nnext costume\n\nwhen I receive [screen shake! v]\nrepeat (3)\n    change y by (15)\n    wait (0.01) seconds\n    change y by (-15)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (10)\n    wait (0.01) seconds\n    change y by (-10)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (5)\n    wait (0.01) seconds\n    change y by (-5)\n    wait (0.01) seconds\nend\n\nwhen I receive [level start v]\nstop [other scripts in sprite v]\nrepeat (10)\n    set [ghost v] effect to (0)\n    show\nend\n\nwhen I receive [thunder!! v]\ngo to [back v] layer\nshow\nset [ghost v] effect to (0)\nrepeat (15)\n    change [ghost v] effect by (5)\nend\n\nwhen flag clicked\nforever\n    if <(title space) = [Y]> then\n        wait until <(RAIN?) = [N]>\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n    end\nend\n\n@Arrow\n\nwhen I receive [destroy everything v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [start player v]\ngo to x: (190) y: (-50)\nhide\nclear graphic effects\nforever\n    if <([costume name v] of [ground v]) = [1-1]> then\n        wait (1) seconds\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 <([costume name v] of [ground v]) = [1-1]>>\n    else\n        clear graphic effects\n        hide\n    end\nend\n\nwhen I receive [level start v]\nforever\n    if <([costume name v] of [ground v]) = [1-1]> then\n        repeat (10)\n            change x by (1)\n        end\n        repeat (10)\n            change x by (-1)\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\n@Health\n\nwhen I receive [damage taken v]\ngo to x: (-210) y: (110)\nrepeat (2)\n    change x by (2)\nend\nrepeat (1)\n    change x by (1)\nend\nrepeat (1)\n    change x by (-1)\nend\nrepeat (4)\n    change x by (-2)\nend\nrepeat (1)\n    change x by (-1)\nend\nrepeat (1)\n    change x by (1)\nend\nrepeat (1)\n    change x by (2)\nend\nrepeat (2)\n    change x by (1)\nend\ngo to x: (-210) y: (110)\n\nwhen I receive [level start v]\nclear graphic effects\ngo to x: (-210) y: (110)\nshow\nswitch costume to (5 v)\n\nwhen I receive [damage taken v]\nnext costume\nset [brightness v] effect to (80)\nrepeat (8)\n    change [brightness v] effect by (-10)\nend\nclear graphic effects\n\nwhen flag clicked\nhide\n\nwhen I receive [level start v]\nforever\n    if <(costume [name v]) = [0]> then\n        broadcast (PLAYER DEAD v)\n        wait until <not <(costume [name v]) = [0]>>\n    end\nend\n\nwhen I receive [insta kill v]\nswitch costume to (0 v)\n\nwhen I receive [level start v]\nforever\n    if <(username) = [KettleClog]> then\n        if <key (1 v) pressed?> then\n            broadcast (PLAYER DEAD v)\n            wait (2) seconds\n            wait until <not <key (1 v) pressed?>>\n        end\n    end\nend\n\nwhen I receive [you died - letters v]\nswitch costume to (5 v)\n\n@Fire Hopper\n\nwhen I start as a clone\nshow\nforever\n    next costume\n    wait (0.2) seconds\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <(x position) > ([x position v] of [p_hurtbox v])> then\n    forever\n        point in direction (-90)\n        repeat until <<touching (e_stop v)?> or <<touching (_edge_ v)?> or <touching (dragon v)?>>>\n            change x by (-2)\n        end\n        change x by (2)\n        point in direction (90)\n        repeat until <<touching (e_stop v)?> or <<touching (_edge_ v)?> or <touching (dragon v)?>>>\n            change x by (2)\n        end\n        change x by (-2)\n    end\nelse\n    forever\n        point in direction (90)\n        repeat until <<touching (e_stop v)?> or <<touching (_edge_ v)?> or <touching (dragon v)?>>>\n            change x by (2)\n        end\n        change x by (-2)\n        point in direction (-90)\n        repeat until <<touching (e_stop v)?> or <touching (_edge_ v)?>>\n            change x by (-2)\n        end\n        change x by (2)\n    end\nend\n\nwhen I receive [right v]\ndelete this clone\n\nwhen I receive [level start v]\nclear graphic effects\nforever\n    if <([costume name v] of [ground v]) = [1-2]> then\n        go to x: (50) y: (-102)\n        create clone of (_myself_ v)\n        go to x: (200) y: (-134)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-2]>>\n    end\n    if <([costume name v] of [ground v]) = [1-3]> then\n        go to x: (80) y: (-102)\n        create clone of (_myself_ v)\n        go to x: (160) y: (-70)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-3]>>\n    end\n    if <([costume name v] of [ground v]) = [1-4]> then\n        go to x: (200) y: (-102)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-4]>>\n    end\n    if <([costume name v] of [ground v]) = [1-5]> then\n        go to x: (120) y: (-102)\n        create clone of (_myself_ v)\n        go to x: (-20) y: (-134)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-5]>>\n    end\n    if <([costume name v] of [ground v]) = [1-9]> then\n        go to x: (-30) y: (-102)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-9]>>\n    end\n    if <([costume name v] of [ground v]) = [1-10]> then\n        go to x: (200) y: (-102)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-10]>>\n    end\n    if <([costume name v] of [ground v]) = [1-14]> then\n        go to x: (-50) y: (-102)\n        create clone of (_myself_ v)\n        go to x: (210) y: (-102)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-14]>>\n    end\n    if <([costume name v] of [ground v]) = [1-16]> then\n        go to x: (-65) y: (-134)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-16]>>\n    end\nend\n\nwhen I start as a clone\nwait (0.01) seconds\nforever\n    repeat (pick random (1) to (2))\n        repeat (2)\n            change y by (3)\n        end\n        repeat (1)\n            change y by (2)\n        end\n        repeat (1)\n            change y by (1)\n        end\n        repeat (1)\n            change y by (-1)\n        end\n        repeat (1)\n            change y by (-2)\n        end\n        repeat (2)\n            change y by (-3)\n        end\n    end\n    repeat (pick random (1) to (2))\n        repeat (2)\n            change y by (2)\n        end\n        repeat (1)\n            change y by (1)\n        end\n        repeat (1)\n            change y by (-1)\n        end\n        repeat (2)\n            change y by (-2)\n        end\n    end\nend\n\nwhen I start as a clone\nrepeat (3)\n    wait until <touching (p_bullet v)?>\n    start sound [enemy_gethit v]\n    wait (0) seconds\nend\nwait until <touching (p_bullet v)?>\nset [enemy x v] to (x position)\nset [enemy y v] to (y position)\nset [smoke x v] to (x position)\nset [smoke y v] to (y position)\nbroadcast (Enemy Drop Star v)\nbroadcast (SMOKE v)\nstart sound [enemy_die v]\ndelete this clone\n\nbroadcast (Enemy Explosion v)\n\nwhen I receive [enemy flash v]\nset [enemy x v] to (x position)\nset [enemy y v] to (y position)\nif <touching (p_bullet v)?> then\n    set [brightness v] effect to (80)\n    repeat (8)\n        change [brightness v] effect by (-10)\n    end\nelse\n    clear graphic effects\nend\n\nwhen I receive [spawn fire hopper v]\nstart sound [enemy_die v]\ngo to x: (Enemy X) y: (-134)\ncreate clone of (_myself_ v)\n\nwhen I receive [dragon die v]\ndelete this clone\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\n@E_STOP\n\nwhen I receive [level start v]\nshow\ngo to x: (0) y: (-4)\nset [ghost v] effect to (100)\nforever\n    switch costume to ([costume name v] of [ground v])\nend\n\nwhen flag clicked\nhide\n\n@Bullet Particle\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nswitch costume to (control v)\nhide\n\nwhen I receive [bullet particle v]\nif <(costume [name v]) = [Control]> then\n    set x to (Bullet X)\n    set y to (Bullet Y)\n    point in direction (pick random (0) to (180))\n    repeat (pick random (2) to (3))\n        create clone of (_myself_ v)\n        turn right (120) degrees\n    end\nend\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (particle v)\nset size to (400) %\nshow\nrepeat (6)\n    move (4) steps\n    change y by (2)\nend\nrepeat (5)\n    move (3) steps\n    change y by (-2)\n    change size by (-30)\nend\nrepeat (4)\n    move (2) steps\n    change y by (-4)\n    change size by (-30)\nend\nrepeat (3)\n    move (1) steps\n    change y by (-6)\n    change size by (-30)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    switch costume to (particle v)\n    wait (0.02) seconds\n    switch costume to (particle2 v)\n    wait (0.02) seconds\nend\n\nwhen I receive [right v]\ndelete this clone\n\nwhen I receive [clear up clones v]\ndelete this clone\n\nwhen I receive [bone explode v]\nif <(costume [name v]) = [Control]> then\n    set x to (BONE X)\n    set y to (BONE Y)\n    point in direction (pick random (0) to (180))\n    repeat (6)\n        create clone of (_myself_ v)\n        turn right (60) degrees\n    end\nend\n\n@Enemy Explosion\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    switch costume to (particle v)\n    wait (0.02) seconds\n    switch costume to (particle2 v)\n    wait (0.02) seconds\nend\n\nwhen I receive [enemy explosion v]\nif <(costume [name v]) = [Control]> then\n    Explosion\nend\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (particle v)\nset size to (400) %\nshow\nrepeat (6)\n    move (4) steps\n    change y by (2)\nend\nrepeat (5)\n    move (3) steps\n    change y by (-2)\n    change size by (-30)\nend\nrepeat (4)\n    move (2) steps\n    change y by (-4)\n    change size by (-30)\nend\nrepeat (3)\n    move (1) steps\n    change y by (-6)\n    change size by (-30)\nend\ndelete this clone\n\nwhen flag clicked\nswitch costume to (control v)\nhide\n\ndefine Explosion\nhide\nset x to (Enemy X)\nset y to (Enemy Y)\npoint in direction (pick random (0) to (180))\nrepeat (6)\n    turn right (60) degrees\n    create clone of (_myself_ v)\nend\n\nwhen I receive [right v]\ndelete this clone\n\nwhen I receive [level start v]\nset [create particle v] to [Y]\n\nwhen I receive [clear up clones v]\ndelete this clone\n\n@Shroom\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I start as a clone\nclear graphic effects\nrepeat (2)\n    wait until <touching (p_bullet v)?>\n    start sound [enemy_gethit v]\n    wait (0) seconds\nend\nwait until <touching (p_bullet v)?>\nset [enemy x v] to (x position)\nset [enemy y v] to (y position)\nbroadcast (Enemy Explosion v)\nbroadcast (Enemy Drop Star v)\nstart sound [enemy_die v]\ndelete this clone\n\ngo to [front v] layer\n\nwhen I receive [enemy flash v]\nset [enemy x v] to (x position)\nset [enemy y v] to (y position)\nif <touching (p_bullet v)?> then\n    set [brightness v] effect to (80)\n    repeat (8)\n        change [brightness v] effect by (-10)\n    end\nelse\n    clear graphic effects\nend\n\nwhen I receive [right v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [level start v]\nset [mush cycle v] to [0]\nforever\n    if <([costume name v] of [ground v]) = [1-4]> then\n        set [mush cycle v] to [0]\n        go to x: (65) y: (-134)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-4]>>\n    end\n    if <([costume name v] of [ground v]) = [1-5]> then\n        set [mush cycle v] to [0]\n        go to x: (190) y: (-70)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-5]>>\n    end\n    if <([costume name v] of [ground v]) = [1-6]> then\n        set [mush cycle v] to [0]\n        go to x: (210) y: (-70)\n        create clone of (_myself_ v)\n        wait (0.03) seconds\n        set [mush cycle v] to [1]\n        go to x: (145) y: (-134)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-6]>>\n    end\n    if <([costume name v] of [ground v]) = [1-9]> then\n        set [mush cycle v] to [0]\n        go to x: (210) y: (-134)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-9]>>\n    end\n    if <([costume name v] of [ground v]) = [1-11]> then\n        set [mush cycle v] to [0]\n        go to x: (65) y: (-102)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-11]>>\n    end\n    if <([costume name v] of [ground v]) = [1-15]> then\n        set [mush cycle v] to [0]\n        go to x: (0) y: (-102)\n        create clone of (_myself_ v)\n        set [mush cycle v] to [1]\n        go to x: (140) y: (-70)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-15]>>\n    end\n    if <([costume name v] of [ground v]) = [1-16]> then\n        set [mush cycle v] to [0]\n        go to x: (200) y: (-134)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-16]>>\n    end\n    if <([costume name v] of [ground v]) = [1-18]> then\n        set [mush cycle v] to [0]\n        go to x: (-20) y: (-134)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-18]>>\n    end\nend\n\nwhen I start as a clone\nshow\nforever\n    if <([x position v] of [p_collsion v]) > (x position)> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\nend\n\nwhen I start as a clone\nrepeat (Mush Cycle)\n    switch costume to (middle v)\n    wait (0.3) seconds\n    switch costume to (forward v)\n    wait (0.3) seconds\nend\nforever\n    switch costume to (middle v)\n    wait (0.3) seconds\n    switch costume to (back v)\n    wait (0.3) seconds\n    switch costume to (middle v)\n    wait (0.03) seconds\n    switch costume to (forward v)\n    wait (0.03) seconds\n    set [shroomx v] to (x position)\n    set [shroomy v] to (y position)\n    broadcast (Shroom Bullet v)\n    switch costume to (middle v)\n    wait (0.3) seconds\n    switch costume to (forward v)\n    wait (0.3) seconds\nend\n\n@Shroom Bullet\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [shroom bullet v]\nif <(costume [name v]) = [Control]> then\n    set x to (ShroomX)\n    set y to (ShroomY)\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nswitch costume to (control v)\nhide\n\nwhen I start as a clone\ngo to [front v] layer\nswitch costume to (form1 v)\nstart sound [wizard_fire v]\nif <([x position v] of [p_collsion v]) > (x position)> then\n    point in direction (90)\nelse\n    point in direction (-90)\nend\nmove (20) steps\nchange y by (-8)\nshow\nswitch costume to (form1 v)\nwait (0.02) seconds\nswitch costume to (form2 v)\nwait (0.02) seconds\nswitch costume to (bullet1 v)\nrepeat (4)\n    move (6) steps\nend\nswitch costume to (bullet2 v)\nrepeat until <touching (_edge_ v)?>\n    move (6) steps\nend\ndelete this clone\n\nwhen I receive [right v]\ndelete this clone\n\nwhen I start as a clone\nwait (0.2) seconds\nforever\n    switch costume to (bullet2 v)\n    wait (0.08) seconds\n    switch costume to (bullet3 v)\n    wait (0.08) seconds\nend\n\nwhen I receive [clear up clones v]\ndelete this clone\n\n@Fish\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [enemy flash v]\nset [enemy x v] to (x position)\nset [enemy y v] to (y position)\nif <touching (p_bullet v)?> then\n    set [brightness v] effect to (80)\n    repeat (8)\n        change [brightness v] effect by (-10)\n    end\nelse\n    clear graphic effects\nend\n\nwhen I start as a clone\nclear graphic effects\nrepeat (1)\n    wait until <touching (p_bullet v)?>\n    start sound [enemy_gethit v]\n    wait (0) seconds\nend\nwait until <touching (p_bullet v)?>\nset [enemy x v] to (x position)\nset [enemy y v] to (y position)\nbroadcast (Enemy Explosion v)\nstart sound [enemy_die v]\nhide\nset y to (-200)\ncreate clone of (_myself_ v)\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [level start v]\nforever\n    if <([costume name v] of [ground v]) = [1-7]> then\n        go to x: (50) y: (-200)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-7]>>\n    end\n    if <([costume name v] of [ground v]) = [1-8]> then\n        go to x: (-45) y: (-200)\n        create clone of (_myself_ v)\n        wait (0.1) seconds\n        go to x: (145) y: (-200)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-8]>>\n    end\n    if <([costume name v] of [ground v]) = [1-10]> then\n        go to x: (-45) y: (-200)\n        create clone of (_myself_ v)\n        wait (0.1) seconds\n        go to x: (110) y: (-200)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-10]>>\n    end\n    if <([costume name v] of [ground v]) = [1-11]> then\n        go to x: (130) y: (-200)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-11]>>\n    end\n    if <([costume name v] of [ground v]) = [1-17]> then\n        go to x: (0) y: (-200)\n        create clone of (_myself_ v)\n        wait (0.1) seconds\n        go to x: (120) y: (-200)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-17]>>\n    end\nend\n\ngo to x: (0) y: (-200)\ncreate clone of (_myself_ v)\nwait (0.1) seconds\n\nwhen I start as a clone\ngo to [front v] layer\nset y to (-200)\nwait (0.6) seconds\nshow\nset rotation style [left-right v]\nforever\n    start sound [lava_drop v]\n    set [bullet x v] to (x position)\n    set [bullet y v] to ((y position) + (20))\n    broadcast (Bullet Particle v)\n    show\n    repeat (10)\n        change y by (10)\n    end\n    repeat (6)\n        change y by (5)\n    end\n    repeat (4)\n        change y by (3)\n    end\n    repeat (3)\n        change y by (2)\n    end\n    repeat (2)\n        change y by (1)\n    end\n    repeat (2)\n        change y by (-1)\n    end\n    repeat (3)\n        change y by (-2)\n    end\n    repeat (4)\n        change y by (-3)\n    end\n    repeat (6)\n        change y by (-5)\n    end\n    repeat (10)\n        change y by (-10)\n    end\n    hide\n    start sound [Splash v]\n    set [bullet x v] to (x position)\n    set [bullet y v] to ((y position) + (20))\n    broadcast (Bullet Particle v)\n    wait (pick random (0.1) to (1)) seconds\nend\n\nwhen I receive [right v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    switch costume to (up1 v)\n    wait (0.1) seconds\n    switch costume to (up2 v)\n    wait (0.2) seconds\n    switch costume to (up1 v)\n    wait (0.1) seconds\n    switch costume to (up3 v)\n    wait (0.2) seconds\nend\n\n@Liquid\n\nwhen I receive [screen shake! v]\nrepeat (3)\n    change y by (15)\n    wait (0.01) seconds\n    change y by (-15)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (10)\n    wait (0.01) seconds\n    change y by (-10)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (5)\n    wait (0.01) seconds\n    change y by (-5)\n    wait (0.01) seconds\nend\n\nwhen I receive [level start v]\nforever\n    hide\n    if <([costume name v] of [ground v]) = [1-7]> then\n        show\n    end\n    if <([costume name v] of [ground v]) = [1-8]> then\n        show\n    end\n    if <([costume name v] of [ground v]) = [1-9]> then\n        show\n    end\n    if <([costume name v] of [ground v]) = [1-10]> then\n        show\n    end\n    if <([costume name v] of [ground v]) = [1-11]> then\n        show\n    end\n    if <([costume name v] of [ground v]) = [1-16]> then\n        show\n    end\n    if <([costume name v] of [ground v]) = [1-17]> then\n        show\n    end\nend\n\nwhen I receive [level start v]\ngo to x: (0) y: (-12)\nforever\n    set y to (-12)\n    change x by (8)\n    wait (0.2) seconds\n    change x by (-8)\n    wait (0.2) seconds\n    set y to (-10)\n    change x by (8)\n    wait (0.2) seconds\n    change x by (-8)\n    wait (0.2) seconds\nend\n\nwhen flag clicked\nhide\n\n@Stage HUD\n\nwhen I receive [start player v]\nswitch costume to (pine forest v)\nclear graphic effects\nhide\ngo to x: (-100) y: (200)\nwait (0.5) seconds\nshow\nrepeat (5)\n    change y by (-6)\nend\nrepeat (3)\n    change y by (-3)\nend\nrepeat (2)\n    change y by (-2)\nend\nrepeat (2)\n    change y by (-1)\nend\nwait (5) seconds\nrepeat (10)\n    change y by (1)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\nhide\n\n@Sign\n\nwhen I receive [screen shake! v]\nrepeat (3)\n    change y by (15)\n    wait (0.01) seconds\n    change y by (-15)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (10)\n    wait (0.01) seconds\n    change y by (-10)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (5)\n    wait (0.01) seconds\n    change y by (-5)\n    wait (0.01) seconds\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [level start v]\nhide\nforever\n    if <([costume name v] of [ground v]) = [1-3.5]> then\n        switch costume to (level 1 sign 1 v)\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [level start v]\ngo to (ground v)\nhide\nforever\n    if <(SIGN?) = [Y]> then\n        switch costume to (l1s1 w v)\n    else\n        switch costume to (level 1 sign 1 v)\n    end\nend\n\n@Sign Text\n\nwhen flag clicked\nhide\n\nwhen I receive [level start v]\nforever\n    if <(SIGN?) = [Y]> then\n        switch costume to (1 v)\n        set [ghost v] effect to (0)\n        go to x: (96) y: (-100)\n        go to [front v] layer\n        show\n        repeat (4)\n            change y by (5)\n        end\n        repeat (3)\n            change y by (3)\n        end\n        repeat (2)\n            change y by (2)\n        end\n        switch costume to (arrow v)\n        wait until <(SIGN?) = [N]>\n        switch costume to (1 v)\n        repeat (5)\n            change [ghost v] effect by (20)\n            change y by (1)\n        end\n    else\n        hide\n    end\nend\n\n@Star Collectable\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [enemy drop star v]\nset [star rng v] to (pick random (1) to (3))\nif <(Star RNG) = [1]> then\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to [front v] layer\nset [ghost v] effect to (0)\nset x to (Enemy X)\nset y to (Enemy Y)\nswitch costume to (1 v)\nshow\nwait (0.02) seconds\nswitch costume to (2 v)\nwait (0.02) seconds\nswitch costume to (3 v)\nforever\n    repeat (3)\n        change y by (2)\n    end\n    repeat (2)\n        change y by (1)\n    end\n    repeat (2)\n        change y by (-1)\n    end\n    repeat (3)\n        change y by (-2)\n    end\n    repeat (3)\n        change y by (-2)\n    end\n    repeat (2)\n        change y by (-1)\n    end\n    repeat (2)\n        change y by (1)\n    end\n    repeat (3)\n        change y by (2)\n    end\nend\n\nwhen I receive [level start v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [right v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(distance to [p_collsion v]) < [80]> then\n        stop [other scripts in sprite v]\n        switch costume to (3 v)\n        set [ghost v] effect to (0)\n        repeat (1)\n            point towards (p_collsion v)\n            move (1) steps\n            go to [front v] layer\n            if <touching (p_hurtbox v)?> then\n                broadcast (Star touched player v)\n                stop [this script v]\n            end\n        end\n        repeat (1)\n            point towards (p_collsion v)\n            move (2) steps\n            go to [front v] layer\n            if <touching (p_hurtbox v)?> then\n                broadcast (Star touched player v)\n                stop [this script v]\n            end\n        end\n        repeat (1)\n            point towards (p_collsion v)\n            move (4) steps\n            go to [front v] layer\n            if <touching (p_hurtbox v)?> then\n                broadcast (Star touched player v)\n                stop [this script v]\n            end\n        end\n        repeat (1)\n            point towards (p_collsion v)\n            move (6) steps\n            go to [front v] layer\n            if <touching (p_hurtbox v)?> then\n                broadcast (Star touched player v)\n                stop [this script v]\n            end\n        end\n        forever\n            point towards (p_collsion v)\n            move (8) steps\n            go to [front v] layer\n            if <touching (p_hurtbox v)?> then\n                broadcast (Star touched player v)\n                stop [this script v]\n            end\n        end\n    end\nend\n\nwhen I receive [clear up clones v]\ndelete this clone\n\nrepeat (2)\n    change y by (-4)\nend\n\nwhen I receive [star touched player v]\nif <touching (p_hurtbox v)?> then\n    switch costume to (2 v)\n    repeat (1)\n        point towards (p_collsion v)\n        move (10) steps\n        go to [front v] layer\n    end\n    switch costume to (1 v)\n    repeat (1)\n        point towards (p_collsion v)\n        move (10) steps\n        go to [front v] layer\n    end\n    start sound [Contra SFX \(29\) v]\n    broadcast (Star Collect v)\n    delete this clone\nend\n\n@Star HUD\n\nwhen I receive [star collect v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen I receive [level start v]\ngo to [front v] layer\nclear graphic effects\ngo to x: (160) y: (146)\nshow\n\nwhen flag clicked\nclear graphic effects\nhide\n\nwhen I receive [star collect v]\nwait (0.04) seconds\ngo to x: (160) y: (146)\nrepeat (2)\n    change y by (-2)\nend\nrepeat (2)\n    change y by (-1)\nend\nrepeat (2)\n    change y by (1)\nend\nrepeat (2)\n    change y by (2)\nend\n\n@*TENS\n\nwhen I receive [star collect v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen I receive [level start v]\ngo to [front v] layer\nclear graphic effects\ngo to x: (160) y: (146)\nshow\n\nwhen flag clicked\nswitch costume to (0 v)\nclear graphic effects\nhide\n\nwhen I receive [star collect v]\nwait (0.02) seconds\ngo to x: (160) y: (146)\nrepeat (2)\n    change y by (-2)\nend\nrepeat (2)\n    change y by (-1)\nend\nrepeat (2)\n    change y by (1)\nend\nrepeat (2)\n    change y by (2)\nend\n\nwhen I receive [star tens v]\nnext costume\n\n@*DIGITS\n\nwhen I receive [star collect v]\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\n\nwhen I receive [level start v]\ngo to [front v] layer\nclear graphic effects\ngo to x: (160) y: (146)\nshow\n\nwhen flag clicked\nswitch costume to (0 v)\nclear graphic effects\nhide\n\nwhen I receive [star collect v]\nnext costume\nif <(costume [name v]) = [0]> then\n    broadcast (STAR TENS v)\nend\ngo to x: (160) y: (146)\nrepeat (2)\n    change y by (-2)\nend\nrepeat (2)\n    change y by (-1)\nend\nrepeat (2)\n    change y by (1)\nend\nrepeat (2)\n    change y by (2)\nend\n\n@Devil\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [enemy flash v]\nset [enemy x v] to (x position)\nset [enemy y v] to (y position)\nif <touching (p_bullet v)?> then\n    set [brightness v] effect to (80)\n    repeat (8)\n        change [brightness v] effect by (-10)\n    end\nelse\n    clear graphic effects\nend\n\nwhen I start as a clone\nclear graphic effects\nrepeat (11)\n    wait until <touching (p_bullet v)?>\n    start sound [enemy_gethit v]\n    wait (0) seconds\nend\nwait until <touching (p_bullet v)?>\nset [enemy x v] to (x position)\nset [enemy y v] to (y position)\nbroadcast (Enemy Explosion v)\nbroadcast (Devil Bones v)\nbroadcast (Enemy Drop Star v)\nstart sound [enemy_die v]\nhide\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I receive [level start v]\nforever\n    if <([costume name v] of [ground v]) = [1-12]> then\n        go to x: (169) y: (-86)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-12]>>\n    end\n    if <([costume name v] of [ground v]) = [1-14]> then\n        go to x: (120) y: (-118)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-14]>>\n    end\n    if <([costume name v] of [ground v]) = [1-16]> then\n        go to x: (80) y: (-86)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-16]>>\n    end\n    if <([costume name v] of [ground v]) = [1-18]> then\n        go to x: (90) y: (-54)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-18]>>\n    end\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [right v]\ndelete this clone\n\nwhen I start as a clone\nshow\nswitch costume to (2 v)\nwait (0.3) seconds\nswitch costume to (1 v)\nrepeat (3)\n    repeat (4)\n        change x by (-2)\n    end\n    switch costume to (2 v)\n    repeat (4)\n        change x by (-2)\n    end\n    switch costume to (1 v)\nend\nforever\n    set [devil action v] to (pick random (1) to (2))\n    if <(Devil Action) = [1]> then\n        repeat (4)\n            switch costume to (shoot v)\n            wait (0.1) seconds\n            set [devil x v] to (x position)\n            set [devil y v] to (y position)\n            broadcast (Devil Bullet v)\n        end\n        switch costume to (1 v)\n        repeat (3)\n            repeat (4)\n                change x by (2)\n            end\n            switch costume to (2 v)\n            repeat (4)\n                change x by (2)\n            end\n            switch costume to (1 v)\n        end\n    end\n    if <(Devil Action) = [2]> then\n        repeat (4)\n            switch costume to (shoot v)\n            wait (0.1) seconds\n            set [devil x v] to (x position)\n            set [devil y v] to (y position)\n            broadcast (Devil Bullet v)\n        end\n        repeat (6)\n            change x by (2)\n            change y by (8)\n        end\n        repeat (4)\n            change x by (2)\n            change y by (4)\n        end\n        repeat (2)\n            change x by (2)\n            change y by (1)\n        end\n        repeat (2)\n            change x by (2)\n            change y by (-1)\n        end\n        repeat (4)\n            change x by (2)\n            change y by (-4)\n        end\n        repeat (6)\n            change x by (2)\n            change y by (-8)\n        end\n        start sound [kingknight_land v]\n        wait (0.02) seconds\n    end\n    set [devil action v] to (pick random (1) to (2))\n    if <(Devil Action) = [1]> then\n        repeat (4)\n            switch costume to (shoot v)\n            wait (0.1) seconds\n            set [devil x v] to (x position)\n            set [devil y v] to (y position)\n            broadcast (Devil Bullet v)\n        end\n        switch costume to (2 v)\n        repeat (3)\n            repeat (4)\n                change x by (-2)\n            end\n            switch costume to (2 v)\n            repeat (4)\n                change x by (-2)\n            end\n            switch costume to (1 v)\n        end\n    end\n    if <(Devil Action) = [2]> then\n        repeat (6)\n            change x by (-2)\n            change y by (8)\n        end\n        repeat (4)\n            change x by (-2)\n            change y by (4)\n        end\n        repeat (2)\n            change x by (-2)\n            change y by (1)\n        end\n        repeat (2)\n            change x by (-2)\n            change y by (-1)\n        end\n        repeat (4)\n            change x by (-2)\n            change y by (-4)\n        end\n        repeat (6)\n            change x by (-2)\n            change y by (-8)\n        end\n        start sound [kingknight_land v]\n        wait (0.02) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    if <([x position v] of [p_collsion v]) > (x position)> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\nend\n\n@Devil Bullet\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nswitch costume to (control v)\nhide\n\nwhen I receive [devil bullet v]\nif <(costume [name v]) = [Control]> then\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nstart sound [explode_small v]\ngo to [front v] layer\nset x to (DEVIL X)\nset y to (DEVIL Y)\nif <([x position v] of [p_collsion v]) > (x position)> then\n    point in direction (90)\nelse\n    point in direction (-90)\nend\nmove (23) steps\nchange y by (-12)\nswitch costume to (1 v)\nshow\nrepeat (6)\n    go to [front v] layer\n    move (6) steps\n    change y by (10)\nend\nrepeat (3)\n    move (6) steps\n    change y by (5)\nend\nrepeat (2)\n    move (6) steps\n    change y by (2)\nend\nrepeat (2)\n    move (6) steps\n    change y by (1)\nend\nrepeat (2)\n    move (6) steps\n    change y by (-1)\nend\nrepeat (2)\n    move (6) steps\n    change y by (-2)\nend\nrepeat (3)\n    move (6) steps\n    change y by (-5)\nend\nrepeat (6)\n    move (6) steps\n    change y by (-10)\nend\nrepeat until <touching (_edge_ v)?>\n    move (6) steps\n    change y by (-15)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    switch costume to (1 v)\n    wait (0.02) seconds\n    switch costume to (2 v)\n    wait (0.02) seconds\nend\n\nwhen I start as a clone\nforever\n    if <touching (_edge_ v)?> then\n        wait (0.1) seconds\n        delete this clone\n    end\nend\n\nwhen I receive [right v]\ndelete this clone\n\n@CHECKPOINT\n\nwhen flag clicked\nhide\n\nwhen I receive [level start v]\nforever\n    if <([costume name v] of [ground v]) = [1-13]> then\n        go to x: (0) y: (-100)\n        create clone of (_myself_ v)\n        wait until <not <([costume name v] of [ground v]) = [1-13]>>\n    end\nend\n\nwhen I receive [right v]\ndelete this clone\n\nwhen I start as a clone\nshow\nclear graphic effects\nswitch costume to (inactive v)\nwait until <([x position v] of [p_hurtbox v]) > (x position)>\nstart sound [Contra SFX \(29\) v]\nswitch costume to (active1 v)\nset [brightness v] effect to (80)\nset [enemy x v] to ((x position) + (10))\nset [enemy y v] to (y position)\nbroadcast (Enemy Explosion v)\nbroadcast (Checkpoint v)\nrepeat (8)\n    change [brightness v] effect by (-10)\nend\nforever\n    switch costume to (active1 v)\n    wait (0.2) seconds\n    switch costume to (active 2 v)\n    wait (0.2) seconds\nend\n\n@Bat\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\n@Dragon\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [dragon die v]\nset [player motion v] to [N]\nclear graphic effects\nstop [other scripts in sprite v]\nrepeat (3)\n    change x by (10)\n    wait (0.01) seconds\n    change x by (-10)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change x by (5)\n    wait (0.01) seconds\n    change x by (-5)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change x by (2)\n    wait (0.01) seconds\n    change x by (-2)\n    wait (0.01) seconds\nend\n\nwhen I receive [enemy flash v]\nset [enemy x v] to (x position)\nset [enemy y v] to (y position)\nif <touching (p_bullet v)?> then\n    set [brightness v] effect to (50)\n    repeat (5)\n        change [brightness v] effect by (-10)\n    end\n    stop [this script v]\nelse\n    clear graphic effects\n    stop [this script v]\nend\n\nwhen I receive [dragon fight start v]\nset [dragon hp v] to [100]\nforever\n    if <touching (p_bullet v)?> then\n        start sound [enemy_gethit v]\n        change [dragon hp v] by (-1)\n    end\nend\n\nwhen I receive [screen shake! v]\nrepeat (3)\n    change y by (15)\n    wait (0.01) seconds\n    change y by (-15)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (10)\n    wait (0.01) seconds\n    change y by (-10)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change y by (5)\n    wait (0.01) seconds\n    change y by (-5)\n    wait (0.01) seconds\nend\n\nwhen I receive [level start v]\nhide\nforever\n    if <([costume name v] of [ground v]) = [1-BOSS]> then\n        wait until <<([x position v] of [p_collsion v]) > [-180]> and <([falling v] of [p_collsion v]) = [0]>>\n        broadcast (Fade out music v)\n        set [player motion v] to [N]\n        go to x: (160) y: (200)\n        point in direction (90)\n        broadcast (Summon Dragon v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [summon dragon v]\nwait (3) seconds\nshow\nset [dragon state v] to [FLAP]\nrepeat (50)\n    change y by (-4)\nend\nrepeat (3)\n    change y by (-2)\nend\nrepeat (2)\n    change y by (-1)\nend\nwait (1) seconds\nset [dragon state v] to [N]\nswitch costume to (idle1 v)\nrepeat (2)\n    change y by (-3)\nend\nrepeat (3)\n    change y by (-6)\nend\nrepeat (6)\n    change y by (-12)\nend\nset y to (-134)\nset [dragon state v] to [IDLE]\nstart sound [kingknight_land v]\nstart sound [kingknight_land2 v]\nbroadcast (SCREEN SHAKE! v)\nbroadcast (Head Down v)\nwait (2) seconds\nbroadcast (Dragon fight start v)\nset [player motion v] to [Y]\n\nwhen I receive [summon dragon v]\nforever\n    if <(Dragon State) = [FLAP]> then\n        switch costume to (flap v)\n        wait (0.08) seconds\n        switch costume to (idle1 v)\n        wait (0.08) seconds\n    end\n    if <(Dragon State) = [IDLE]> then\n        switch costume to (idle2 v)\n        wait (0.3) seconds\n        switch costume to (idle1 v)\n        wait (0.3) seconds\n    end\nend\n\nwhen I receive [dragon fly v]\nset [dragon state v] to [FLAP]\nrepeat (8)\n    change y by (4)\nend\nrepeat (6)\n    change y by (6)\nend\nrepeat (4)\n    change y by (8)\nend\nrepeat until <touching (_edge_ v)?>\n    change y by (10)\nend\nrepeat (6)\n    change y by (10)\nend\nif <(x position) > [0]> then\n    go to x: (-160) y: (200)\n    point in direction (-90)\nelse\n    go to x: (160) y: (200)\n    point in direction (90)\nend\nbroadcast (Summon Dragon 2 v)\nhide\n\nwhen I receive [summon dragon 2 v]\nwait (1) seconds\nshow\nset [dragon state v] to [FLAP]\nrepeat (50)\n    change y by (-4)\nend\nrepeat (3)\n    change y by (-2)\nend\nrepeat (2)\n    change y by (-1)\nend\nbroadcast (Dragon head shoot in air v)\nwait (0.4) seconds\nset [dragon state v] to [N]\nswitch costume to (idle1 v)\nrepeat (2)\n    change y by (-3)\nend\nrepeat (3)\n    change y by (-6)\nend\nrepeat (6)\n    change y by (-12)\nend\nset y to (-134)\nset [dragon state v] to [IDLE]\nstart sound [kingknight_land v]\nstart sound [kingknight_land2 v]\nbroadcast (SCREEN SHAKE! v)\nbroadcast (Head Down v)\nwait (2) seconds\nset [dragon fly? v] to [N]\n\nwhen I receive [dragon skeleton v]\nset [enemy x v] to (x position)\nset [enemy y v] to (y position)\nhide\n\nwhen I receive [dragon fight start v]\nforever\n    if <<(Dragon HP) = [0]> or <(Dragon HP) < [0]>> then\n        clear graphic effects\n        stop [other scripts in sprite v]\n        set [enemy x v] to (x position)\n        set [enemy y v] to (y position)\n        broadcast (Dragon Die v)\n    end\nend\n\n@Dragon Head\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [dragon die v]\nset [player motion v] to [N]\nclear graphic effects\nswitch costume to (dead v)\nstop [other scripts in sprite v]\nrepeat (3)\n    change x by (10)\n    wait (0.01) seconds\n    change x by (-10)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change x by (5)\n    wait (0.01) seconds\n    change x by (-5)\n    wait (0.01) seconds\nend\nrepeat (3)\n    change x by (2)\n    wait (0.01) seconds\n    change x by (-2)\n    wait (0.01) seconds\nend\n\nwhen I receive [dragon skeleton v]\nhide\n\nwhen I receive [enemy flash v]\nset [brightness v] effect to (50)\nrepeat (5)\n    change [brightness v] effect by (-10)\nend\nstop [this script v]\n\nwhen flag clicked\nhide\n\nwhen I receive [level start v]\nhide\n\nwhen I receive [summon dragon v]\nset [head y v] to [0]\nset [head x v] to [2]\ngo to (dragon v)\nwait (3.25) seconds\nshow\nforever\n    point in direction ([direction v] of [dragon v])\n    set y to (([y position v] of [dragon v]) + (Head Y))\n    if <([direction v] of [dragon v]) = [90]> then\n        set x to (([x position v] of [dragon v]) + (Head X))\n    else\n        set x to (([x position v] of [dragon v]) - (Head X))\n    end\nend\n\nwhen I receive [head down v]\nrepeat (5)\n    change [head y v] by (-1)\nend\nwait (1) seconds\nrepeat (5)\n    change [head y v] by (1)\nend\nwait (0.4) seconds\n\nrepeat (4)\n    change [head y v] by (1)\nend\n\nwhen I receive [dragon fight start v]\nset [dragon fly? v] to [N]\nswitch costume to (close v)\nforever\n    repeat (1)\n        repeat (4)\n            change [head y v] by (1)\n        end\n        wait (0.6) seconds\n        repeat (4)\n            change [head y v] by (-1)\n        end\n    end\n    repeat (pick random (1) to (2))\n        repeat (1)\n            switch costume to (open v)\n            repeat (4)\n                change [head y v] by (-3)\n                change [head x v] by (-2)\n            end\n            broadcast (Dragon Fire Ball v)\n            wait (0.6) seconds\n            repeat (4)\n                change [head y v] by (3)\n                change [head x v] by (2)\n            end\n            switch costume to (close v)\n            wait (0.2) seconds\n        end\n        repeat (1)\n            wait (0.2) seconds\n            switch costume to (open v)\n            repeat (4)\n                change [head y v] by (3)\n                change [head x v] by (1)\n            end\n            broadcast (Dragon Fire Summon v)\n            wait (0.4) seconds\n            repeat (4)\n                change [head y v] by (-3)\n                change [head x v] by (-1)\n            end\n        end\n        switch costume to (close v)\n        wait (1.2) seconds\n    end\n    switch costume to (close v)\n    wait (0.1) seconds\n    repeat (1)\n        set [dragon fly? v] to [Y]\n        broadcast (Dragon Fly v)\n        wait until <(Dragon Fly?) = [N]>\n    end\nend\n\nwhen I receive [summon dragon 2 v]\nhide\nset [head y v] to [0]\nwait (1.2) seconds\nshow\n\nwhen I receive [dragon head shoot in air v]\nrepeat (1)\n    switch costume to (open v)\n    repeat (4)\n        change [head y v] by (3)\n        change [head x v] by (1)\n    end\n    broadcast (Dragon Fire Summon v)\n    wait (0.4) seconds\n    repeat (4)\n        change [head y v] by (-3)\n        change [head x v] by (-1)\n    end\nend\nswitch costume to (close v)\n\nwhen I receive [level start v]\nswitch costume to (close v)\n\nwhen I receive [dragon die v]\n\n@Dragon Fire\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nstart sound [explode_small v]\npoint in direction ([direction v] of [dragon head v])\ngo to (dragon head v)\nmove (-70) steps\nchange y by (20)\nshow\nswitch costume to (1 v)\nrepeat (2)\n    move (-3) steps\n    change y by (-3)\nend\nswitch costume to (2 v)\nrepeat (2)\n    move (-3) steps\n    change y by (-3)\nend\nswitch costume to (3 v)\nrepeat until <touching (_edge_ v)?>\n    move (-7) steps\nend\nrepeat (2)\n    move (-7) steps\nend\ndelete this clone\n\nwhen I receive [dragon fire ball v]\nrepeat (2)\n    create clone of (_myself_ v)\n    wait (0.15) seconds\nend\n\nwhen I start as a clone\nwait until <touching (ground v)?>\nforever\n    switch costume to (3 v)\n    wait (0.1) seconds\n    switch costume to (4 v)\n    wait (0.1) seconds\nend\n\nwhen I receive [dragon die v]\ndelete this clone\n\n@Devil Bones\n\nwhen I receive [devil bones v]\nset x to (Enemy X)\nset y to (Enemy Y)\npoint in direction (-75)\npoint in direction (75)\nswitch costume to (hand 1 v)\ncreate clone of (_myself_ v)\npoint in direction (-75)\nswitch costume to (hand 2 v)\ncreate clone of (_myself_ v)\npoint in direction (45)\nswitch costume to (ribs v)\ncreate clone of (_myself_ v)\npoint in direction (-45)\nswitch costume to (skull v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(costume [name v]) = [Hand 2]> then\n    set rotation style [don't rotate v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (2)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (2)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (2)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (2)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to (x position)\n    set [bone y v] to (y position)\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <(costume [name v]) = [Skull]> then\n    set rotation style [left-right v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (3)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (3)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (3)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (3)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to (x position)\n    set [bone y v] to (y position)\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [Hand 1]> then\n    set rotation style [don't rotate v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (1)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (1)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (1)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (1)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to (x position)\n    set [bone y v] to (y position)\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [Ribs]> then\n    set rotation style [left-right v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (4)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (4)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (4)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (4)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to (x position)\n    set [bone y v] to (y position)\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\n@Dragon Fire Summon\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [dragon die v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [dragon fire summon v]\nrepeat (3)\n    create clone of (_myself_ v)\n    wait (0.15) seconds\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [level start v]\nhide\n\nwhen I start as a clone\nshow\nstart sound [explode_small v]\npoint in direction ([direction v] of [dragon head v])\ngo to (dragon head v)\nmove (-70) steps\nchange y by (20)\nset [fire speed v] to [-4]\nshow\nswitch costume to (1 v)\nrepeat (8)\n    move (Fire Speed) steps\n    change y by (8)\nend\nswitch costume to (2 v)\nrepeat (6)\n    move (Fire Speed) steps\n    change y by (6)\nend\nrepeat (3)\n    move (Fire Speed) steps\n    change y by (3)\nend\nswitch costume to (3 v)\nrepeat (2)\n    move (Fire Speed) steps\n    change y by (2)\nend\nrepeat (1)\n    move (Fire Speed) steps\n    change y by (1)\nend\nrepeat (1)\n    move (Fire Speed) steps\n    change y by (-1)\nend\nrepeat (2)\n    move (Fire Speed) steps\n    change y by (-2)\nend\nswitch costume to (4 v)\nrepeat (3)\n    move (Fire Speed) steps\n    change y by (-3)\nend\nrepeat (6)\n    move (Fire Speed) steps\n    change y by (-6)\nend\nrepeat until <touching (ground v)?>\n    move (Fire Speed) steps\n    change y by (-8)\nend\nset [enemy x v] to (x position)\nset [enemy y v] to (y position)\nset [smoke x v] to (x position)\nset [smoke y v] to (y position)\nbroadcast (SMOKE v)\nstart sound [enemy_die v]\ndelete this clone\n\n@B-HUNDREDS\n\nwhen I receive [level start v]\nhide\n\nwhen flag clicked\ngo to x: (0) y: (146)\nhide\n\nwhen I receive [dragon fight start v]\nshow\nforever\n    if <<(Dragon HP) = [100]> or <(Dragon HP) > [100]>> then\n        switch costume to (letter (1) of (Dragon HP))\n    else\n        switch costume to (0 v)\n    end\nend\n\nwhen I receive [dragon die v]\nwait (1) seconds\nhide\n\n@B-TENS\n\nwhen I receive [dragon die v]\nwait (1) seconds\nhide\n\nwhen I receive [dragon fight start v]\nshow\nforever\n    if <<(Dragon HP) = [100]> or <(Dragon HP) > [100]>> then\n        switch costume to (letter (2) of (Dragon HP))\n    else\n        if <<(Dragon HP) = [10]> or <(Dragon HP) > [10]>> then\n            switch costume to (letter (1) of (Dragon HP))\n        else\n            switch costume to (0 v)\n        end\n    end\n    if <<(Dragon HP) = [0]> or <[0] > (Dragon HP)>> then\n        switch costume to (0 v)\n    end\nend\n\nwhen flag clicked\ngo to x: (14) y: (146)\nhide\n\nwhen I receive [level start v]\nhide\n\n@B-DIGITS\n\nwhen I receive [dragon die v]\nwait (1) seconds\nhide\n\nwhen I receive [dragon fight start v]\nshow\nforever\n    if <<(Dragon HP) = [100]> or <(Dragon HP) > [100]>> then\n        switch costume to (letter (3) of (Dragon HP))\n    else\n        if <<(Dragon HP) = [10]> or <(Dragon HP) > [10]>> then\n            switch costume to (letter (2) of (Dragon HP))\n        else\n            switch costume to (letter (1) of (Dragon HP))\n        end\n    end\n    if <<(Dragon HP) = [0]> or <[0] > (Dragon HP)>> then\n        switch costume to (0 v)\n    end\nend\n\nwhen flag clicked\ngo to x: (28) y: (146)\nhide\n\nwhen I receive [level start v]\nhide\n\n@boss explosion\n\nwhen I receive [dragon die v]\nstart sound [kingknight_land2 v]\nwait (1) seconds\nrepeat (5)\n    set x to (([x position v] of [dragon v]) + (pick random (-50) to (50)))\n    set y to (([y position v] of [dragon v]) + (pick random (-20) to (40)))\n    create clone of (_myself_ v)\n    wait (0.05) seconds\nend\nrepeat (5)\n    set x to (([x position v] of [dragon v]) + (pick random (-50) to (50)))\n    set y to (([y position v] of [dragon v]) + (pick random (-20) to (40)))\n    create clone of (_myself_ v)\n    wait (0.04) seconds\nend\nrepeat (5)\n    set x to (([x position v] of [dragon v]) + (pick random (-50) to (50)))\n    set y to (([y position v] of [dragon v]) + (pick random (-20) to (40)))\n    create clone of (_myself_ v)\n    wait (0.03) seconds\nend\nrepeat (5)\n    set x to (([x position v] of [dragon v]) + (pick random (-50) to (50)))\n    set y to (([y position v] of [dragon v]) + (pick random (-20) to (40)))\n    create clone of (_myself_ v)\n    wait (0.02) seconds\nend\nrepeat (5)\n    set x to (([x position v] of [dragon v]) + (pick random (-50) to (50)))\n    set y to (([y position v] of [dragon v]) + (pick random (-20) to (40)))\n    create clone of (_myself_ v)\n    wait (0.01) seconds\nend\nrepeat (15)\n    set x to (([x position v] of [dragon v]) + (pick random (-50) to (50)))\n    set y to (([y position v] of [dragon v]) + (pick random (-20) to (40)))\n    create clone of (_myself_ v)\nend\nbroadcast (Dragon Skeleton v)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nstart sound [explode_small v]\nshow\nset [brightness v] effect to (100)\nswitch costume to (1 v)\nwait (0.01) seconds\nswitch costume to (2 v)\nwait (0.01) seconds\nswitch costume to (3 v)\nwait (0.01) seconds\nswitch costume to (4 v)\nwait (0.01) seconds\ndelete this clone\n\n@Dragon Skeleton\n\nwhen I start as a clone\nif <(costume [name v]) = [LEG1]> then\n    set rotation style [don't rotate v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (5)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (5)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (5)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (5)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to (x position)\n    set [bone y v] to (y position)\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\nwhen I receive [dragon skeleton v]\nset x to (Enemy X)\nset y to (Enemy Y)\ngo to (dragon v)\npoint in direction (75)\nswitch costume to (leg1 v)\ncreate clone of (_myself_ v)\npoint in direction (-75)\nswitch costume to (leg2 v)\ncreate clone of (_myself_ v)\npoint in direction (45)\nswitch costume to (ribs v)\ncreate clone of (_myself_ v)\npoint in direction (-45)\nswitch costume to (skull v)\ncreate clone of (_myself_ v)\npoint in direction (90)\nswitch costume to (tail v)\ncreate clone of (_myself_ v)\nwait (3.5) seconds\nbroadcast (Level Clear v)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <(costume [name v]) = [LEG2]> then\n    set rotation style [don't rotate v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (6)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (6)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (6)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (6)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to (x position)\n    set [bone y v] to (y position)\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [SKULL]> then\n    set rotation style [don't rotate v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (7)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (7)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (7)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (7)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to ((x position) - (32))\n    set [bone y v] to ((y position) + (28))\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [RIBS]> then\n    set rotation style [don't rotate v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (8)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (8)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (8)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (8)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to (x position)\n    set [bone y v] to ((y position) + (20))\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [TAIL]> then\n    set rotation style [don't rotate v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (9)\n        move (0) steps\n        change y by (6)\n    end\n    repeat (9)\n        move (0) steps\n        change y by (3)\n    end\n    repeat (9)\n        move (0) steps\n        change y by (2)\n    end\n    repeat (9)\n        move (0) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to ((x position) - (-50))\n    set [bone y v] to ((y position) + (15))\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\n@Smoke\n\nwhen I receive [destroy everything v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nswitch costume to (control v)\nhide\n\nwhen I start as a clone\npoint in direction (0)\nturn right (pick random (-30) to (30)) degrees\nwait (0.01) seconds\nforever\n    move (4) steps\n    change [ghost v] effect by (5)\nend\n\nwhen I start as a clone\nshow\nswitch costume to (1 v)\nwait (0.1) seconds\nswitch costume to (2 v)\nwait (0.1) seconds\nrepeat (6)\n    switch costume to (3 v)\n    change [pixelate v] effect by (2)\n    wait (0.01) seconds\n    switch costume to (4 v)\n    change [pixelate v] effect by (2)\n    wait (0.01) seconds\nend\ndelete this clone\n\nwhen I receive [smoke v]\nif <(costume [name v]) = [Control]> then\n    go to x: (smoke x) y: (smoke y)\n    repeat (4)\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I receive [right v]\ndelete this clone\n\n@player skeleton\n\nwhen I start as a clone\nif <(costume [name v]) = [BONE1]> then\n    start sound [enemy_die v]\n    set rotation style [left-right v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (2)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (2)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (2)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (2)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to (x position)\n    set [bone y v] to (y position)\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\nwhen I receive [player explode v]\nif <([direction v] of [p_visual v]) = [-90]> then\n    go to (p_visual v)\n    point in direction (-5)\n    switch costume to (hat v)\n    create clone of (_myself_ v)\n    point in direction (75)\n    switch costume to (bone1 v)\n    create clone of (_myself_ v)\n    point in direction (-75)\n    switch costume to (bone2 v)\n    create clone of (_myself_ v)\n    point in direction (45)\n    switch costume to (ribs v)\n    create clone of (_myself_ v)\n    point in direction (-45)\n    switch costume to (skull v)\n    create clone of (_myself_ v)\nelse\n    go to (p_visual v)\n    point in direction (5)\n    switch costume to (hat v)\n    create clone of (_myself_ v)\n    point in direction (-75)\n    switch costume to (bone1 v)\n    create clone of (_myself_ v)\n    point in direction (75)\n    switch costume to (bone2 v)\n    create clone of (_myself_ v)\n    point in direction (-45)\n    switch costume to (ribs v)\n    create clone of (_myself_ v)\n    point in direction (45)\n    switch costume to (skull v)\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <(costume [name v]) = [BONE2]> then\n    set rotation style [left-right v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (4)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (4)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (4)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (4)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to (x position)\n    set [bone y v] to (y position)\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [RIBS]> then\n    set rotation style [left-right v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (6)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (6)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (6)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (6)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to (x position)\n    set [bone y v] to (y position)\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [SKULL]> then\n    set rotation style [left-right v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (8)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (8)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (8)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (8)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    set [bone x v] to (x position)\n    set [bone y v] to (y position)\n    start sound [enemy_die v]\n    broadcast (BONE EXPLODE v)\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [HAT]> then\n    set rotation style [left-right v]\n    clear graphic effects\n    go to [front v] layer\n    show\n    wait (0) seconds\n    repeat (10)\n        move (2) steps\n        change y by (6)\n    end\n    repeat (10)\n        move (2) steps\n        change y by (3)\n    end\n    repeat (10)\n        move (1) steps\n        change y by (2)\n    end\n    repeat (10)\n        move (1) steps\n        change y by (1)\n    end\n    wait (0) seconds\n    repeat (4)\n        hide\n        move (1) steps\n        change y by (1)\n        wait (0.01) seconds\n        show\n        move (1) steps\n        change y by (1)\n        wait (0.01) seconds\n    end\n    delete this clone\nend\n\n@BLACK FADE\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nhide\n\nwhen I receive ["you died" screen v]\nhide\nclear graphic effects\nswitch costume to (black v)\nwait (0.5) seconds\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nbroadcast (DESTROY EVERYTHING v)\nwait (0.4) seconds\nbroadcast (YOU DIED - letters v)\nwait (1.6) seconds\nclear graphic effects\n\nwhen I receive [fade out black v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [level start v]\nswitch costume to (black v)\n\nwhen I receive [dragon die v]\nswitch costume to (white v)\nrepeat (1)\n    clear graphic effects\n    show\n    wait (0.01) seconds\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\nend\n\nwhen flag clicked\nclear graphic effects\n\nwhen I receive [player dead v]\nswitch costume to (white v)\nrepeat (3)\n    clear graphic effects\n    show\n    wait (0.01) seconds\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\nend\n\nwhen I receive [dragon skeleton v]\nswitch costume to (white v)\nrepeat (1)\n    clear graphic effects\n    show\n    wait (0.01) seconds\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\nend\n\nwhen I receive [thunder!! v]\nswitch costume to (white v)\nrepeat (2)\n    clear graphic effects\n    show\n    wait (0.01) seconds\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\nend\n\nwhen I receive [level start v]\nswitch costume to (black v)\ngo to [front v] layer\nset [ghost v] effect to (0)\nshow\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nhide\n\nwhen I receive [level clear fin- fade to black v]\nswitch costume to (black v)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\n@BIG TEXT\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [you died - letters v]\ngo to x: (0) y: (400)\nclear graphic effects\nset [letter time spacing v] to [0.08]\nhide\nswitch costume to (y v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (o v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (u v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (d v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (i v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (e v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (d2 v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nwait (3) seconds\nbroadcast (Delete Letters v)\nwait (1) seconds\nbroadcast (Level Start v)\nbroadcast (Fade out black v)\n\nwhen I start as a clone\nset size to (400) %\ngo to [front v] layer\nshow\nset y to (400)\nrepeat (15)\n    change y by (-12)\nend\nif <not < (costume [name v]) contains [1]?>> then\n    start sound [slimeball_hit v]\nend\nrepeat (1)\n    change y by (6)\nend\nrepeat (3)\n    change y by (3)\nend\nrepeat (1)\n    change y by (2)\nend\nrepeat (1)\n    change y by (-2)\nend\nrepeat (3)\n    change y by (-3)\nend\nrepeat (1)\n    change y by (-6)\nend\nrepeat (1)\n    change y by (1)\nend\nrepeat (1)\n    change y by (-1)\nend\n\nwhen I receive [delete letters v]\nif < (costume [name v]) contains [1]?> then\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\nelse\n    repeat (20)\n        change [brightness v] effect by (-5)\n    end\nend\ndelete this clone\n\nwhen I receive [stage clear text v]\ngo to x: (0) y: (400)\nclear graphic effects\nset [letter time spacing v] to [0.08]\nhide\nswitch costume to (1s v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (1t v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (1a v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (1g v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (1e v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (1c v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (1l v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (1e2 v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (1a2 v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nswitch costume to (1r v)\ncreate clone of (_myself_ v)\nwait (letter time spacing) seconds\nwait (4) seconds\nbroadcast (Delete Letters v)\nwait (1) seconds\nbroadcast (level clear fin- fade to black v)\nwait (1) seconds\nbroadcast (END OF DEMO v)\n\nwait (1) seconds\n\nbroadcast (Right v)\n\n@MAP\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\ngo to [front v] layer\n\nwhen I receive [0-entermap v]\nhide\nset [ghost v] effect to (100)\nswitch backdrop to (cutscene v)\nswitch costume to (0-0 v)\nwait (1) seconds\ngo to [front v] layer\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (0.5) seconds\nbroadcast (0Map-THEODORE v)\nrepeat until <(costume [name v]) = [1-0]>\n    wait (0.2) seconds\n    start sound [explode_small v]\n    next costume\nend\nrepeat (7)\n    switch costume to (1-0arrow v)\n    wait (0.3) seconds\n    switch costume to (1-0 v)\n    wait (0.3) seconds\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (1) seconds\nbroadcast (Level Start v)\n\nwhen I receive [level start v]\nstop [other scripts in sprite v]\nhide\n\n@TITLE\n\nwhen I receive [level start v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen flag clicked\nstart sound [pop v]\nset x to (0)\nset y to (-4)\nhide\nset [ghost v] effect to (100)\nswitch costume to (kettleclog v)\nshow\nwait (0.5) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2.5) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nset [ghost v] effect to (0)\nwait (0.2) seconds\nset [rain? v] to [Y]\nswitch costume to (players1 v)\ncreate clone of (_myself_ v)\nswitch costume to (ground v)\ncreate clone of (_myself_ v)\nwait (0.7) seconds\nswitch costume to (1w v)\nrepeat (11)\n    wait (0.01) seconds\n    create clone of (_myself_ v)\n    next costume\nend\nset [brightness v] effect to (100)\nset [ghost v] effect to (0)\nswitch costume to (thunder2 v)\nshow\nstart sound [explode_medium v]\nbroadcast (THUNDER!! v)\nwait (0.2) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nstart sound [TITLE v]\nswitch costume to (press space v)\ncreate clone of (_myself_ v)\nbroadcast (PRESS SPACE v)\nforever\n    wait (pick random (0.5) to (2.5)) seconds\n    if <(title space) = [N]> then\n        set [brightness v] effect to (100)\n        set [ghost v] effect to (0)\n        switch costume to (thunder1 v)\n        show\n        start sound [explode_medium v]\n        broadcast (THUNDER!! v)\n        wait (0.2) seconds\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        hide\n    end\n    wait (pick random (0.5) to (2.5)) seconds\n    if <(title space) = [N]> then\n        set [brightness v] effect to (100)\n        set [ghost v] effect to (0)\n        switch costume to (thunder2 v)\n        show\n        start sound [explode_medium v]\n        broadcast (THUNDER!! v)\n        wait (0.2) seconds\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        hide\n    end\n    wait (pick random (0.5) to (2.5)) seconds\n    if <(title space) = [N]> then\n        set [brightness v] effect to (100)\n        set [ghost v] effect to (0)\n        switch costume to (thunder3 v)\n        show\n        start sound [explode_medium v]\n        broadcast (THUNDER!! v)\n        wait (0.2) seconds\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n    end\nend\n\nwhen flag clicked\nset [rain? v] to [N]\nif <(username) = [KettleClog]> then\n    wait until <key (q v) pressed?>\n    stop all sounds\n    set [rain? v] to [N]\n    broadcast (Level Start v)\nend\n\nwhen I start as a clone\nforever\n    if <(costume [name v]) = [GROUND]> then\n        show\n        repeat (14)\n            change x by (-1)\n        end\n        change x by (14)\n    end\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [GROUND]> then\n    set [ghost v] effect to (100)\n    wait (1.4) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [PLAYERS1]> then\n    go to [back v] layer\n    show\n    forever\n        switch costume to (players1 v)\n        wait (0.15) seconds\n        switch costume to (players2 v)\n        wait (0.15) seconds\n    end\nend\n\nwhen I start as a clone\nif <not <<(costume [name v]) = [PLAYERS1]> or <<(costume [name v]) = [PRESS SPACE]> or <(costume [name v]) = [GROUND]>>>> then\n    go to [front v] layer\n    set y to (50)\n    set [ghost v] effect to (100)\n    set [brightness v] effect to (100)\n    show\n    repeat (1)\n        change y by (6)\n        change [ghost v] effect by (-25)\n        change [brightness v] effect by (-20)\n    end\n    repeat (2)\n        change y by (4)\n        change [ghost v] effect by (-25)\n        change [brightness v] effect by (-20)\n    end\n    repeat (2)\n        change y by (2)\n        change [ghost v] effect by (-25)\n        change [brightness v] effect by (-20)\n    end\n    change y by (1)\n    change y by (-1)\n    repeat (2)\n        change y by (-2)\n    end\n    repeat (2)\n        change y by (-4)\n    end\n    repeat (1)\n        change y by (-6)\n    end\n    repeat (2)\n        change y by (1)\n    end\n    repeat (2)\n        change y by (-1)\n    end\n    forever\n        wait (2) seconds\n        repeat (2)\n            change y by (6)\n        end\n        repeat (1)\n            change y by (4)\n        end\n        repeat (1)\n            change y by (2)\n        end\n        repeat (2)\n            change y by (1)\n        end\n        repeat (2)\n            change y by (-1)\n        end\n        repeat (1)\n            change y by (-2)\n        end\n        repeat (1)\n            change y by (-4)\n        end\n        repeat (2)\n            change y by (-6)\n        end\n        repeat (2)\n            change y by (1)\n        end\n        repeat (2)\n            change y by (-1)\n        end\n    end\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [PLAYERS1]> then\n    set [ghost v] effect to (100)\n    wait (1.4) seconds\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [PRESS SPACE]> then\n    go to [front v] layer\n    set y to (-20)\n    show\n    set [brightness v] effect to (0)\n    set [ghost v] effect to (0)\n    forever\n        show\n        wait (0.4) seconds\n        if <(title space) = [N]> then\n            hide\n        end\n        wait (0.2) seconds\n    end\nend\n\nwhen I receive [press space v]\nwait until <not <key (space v) pressed?>>\nwait until <key (space v) pressed?>\nset [title space v] to [Y]\nstop all sounds\nstart sound [Contra SFX \(29\) v]\nif <(costume [name v]) = [PRESS SPACE]> then\n    show\n    set [brightness v] effect to (100)\n    repeat (10)\n        change [brightness v] effect by (-10)\n        show\n        wait (0.01) seconds\n        hide\n        wait (0.01) seconds\n    end\n    show\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\nwait (2) seconds\nset [rain? v] to [N]\nif <(costume [name v]) = [GROUND]> then\n    broadcast (DESTROY RAIN v)\nend\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nset [idk what to call this v] to [Y]\nif <(costume [name v]) = [GROUND]> then\n    broadcast (0-ENTERMAP v) and wait\nend\ndelete this clone\n\nset [acceleration v] to [0]\n\ndelete this clone\n\nwhen flag clicked\nset [title space v] to [N]\n\n@RAIN\n\nwhen flag clicked\n\nwhen flag clicked\nhide\nforever\n    if <(RAIN?) = [Y]> then\n        set [rain pos v] to (pick random (1) to (16))\n        if <(RAIN POS) = [1]> then\n            set x to (230)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [2]> then\n            set x to (200)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [3]> then\n            set x to (170)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [4]> then\n            set x to (140)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [5]> then\n            set x to (110)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [6]> then\n            set x to (80)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [7]> then\n            set x to (50)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [8]> then\n            set x to (20)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [9]> then\n            set x to (-10)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [10]> then\n            set x to (-40)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [11]> then\n            set x to (-70)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [12]> then\n            set x to (-100)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [13]> then\n            set x to (-130)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [14]> then\n            set x to (-160)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [15]> then\n            set x to (-190)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [16]> then\n            set x to (-220)\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen I receive [level start v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nshow\nclear graphic effects\nset [ghost v] effect to (60)\nset [brightness v] effect to (100)\nrepeat (19)\n    change y by (-15)\nend\nrepeat until <<touching (title v)?> or <<touching (ground v)?> or <touching (p_collsion v)?>>>\n    change y by (-15)\nend\nchange y by (4)\nswitch costume to (costume2 v)\nwait (0.01) seconds\nswitch costume to (costume3 v)\nwait (0.01) seconds\nswitch costume to (costume4 v)\nwait (0.01) seconds\ndelete this clone\n\nwhen I receive [level start v]\nforever\n    if <(RAIN?) = [Y]> then\n        set [rain pos v] to (pick random (1) to (16))\n        if <(RAIN POS) = [1]> then\n            set x to (230)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [2]> then\n            set x to (200)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [3]> then\n            set x to (170)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [4]> then\n            set x to (140)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [5]> then\n            set x to (110)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [6]> then\n            set x to (80)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [7]> then\n            set x to (50)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [8]> then\n            set x to (20)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [9]> then\n            set x to (-10)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [10]> then\n            set x to (-40)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [11]> then\n            set x to (-70)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [12]> then\n            set x to (-100)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [13]> then\n            set x to (-130)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [14]> then\n            set x to (-160)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [15]> then\n            set x to (-190)\n            create clone of (_myself_ v)\n        end\n        if <(RAIN POS) = [16]> then\n            set x to (-220)\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    change x by (-1)\nend\n\nwhen I receive [destroy rain v]\nrepeat (30)\n    change [ghost v] effect by (2)\nend\ndelete this clone\n\n@MAP CHARACTERS\n\nwhen I receive [0map-theodore v]\nswitch costume to (i2 v)\ngo to x: (-300) y: (-152)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nrepeat (10)\n    change x by (4)\nend\nrepeat until <touching (_edge_ v)?>\n    change x by (4)\nend\nrepeat (4)\n    change x by (4)\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <(costume [name v]) = [I2]> then\n    forever\n        switch costume to (i2 v)\n        wait (0.1) seconds\n        switch costume to (i1 v)\n        wait (0.1) seconds\n    end\nend\n\n@WATER FALL\n\nwhen flag clicked\nhide\n\nwhen I receive [level start v]\nforever\n    hide\n    if <([costume name v] of [ground v]) = [1-15]> then\n        switch costume to (1-15 v)\n        show\n        go to [back v] layer\n        go [forward v] (3) layers\n    end\n    if <([costume name v] of [ground v]) = [1-17]> then\n        switch costume to (1-17 v)\n        show\n        go to [back v] layer\n        go [forward v] (3) layers\n    end\n    if <([costume name v] of [ground v]) = [1-18]> then\n        switch costume to (1-18 v)\n        show\n        go to [back v] layer\n        go [forward v] (3) layers\n    end\n    if <([costume name v] of [ground v]) = [1-10]> then\n        switch costume to (1-10 v)\n        show\n        go to [back v] layer\n        go [forward v] (3) layers\n    end\n    if <([costume name v] of [ground v]) = [1-8]> then\n        switch costume to (1-8 v)\n        show\n        go to [back v] layer\n        go [forward v] (3) layers\n    end\n    if <([costume name v] of [ground v]) = [1-9]> then\n        switch costume to (1-9 v)\n        show\n        go to [back v] layer\n        go [forward v] (3) layers\n    end\n    if <([costume name v] of [ground v]) = [1-BOSS]> then\n        switch costume to (1-boss v)\n        show\n        go to [back v] layer\n        go [forward v] (3) layers\n    end\nend\n\nwhen I receive [level start v]\nset y to (-4)\nforever\n    repeat (6)\n        change y by (-2)\n    end\n    change y by (12)\nend\n\nwait (0.1) seconds\nwait (0.1) seconds\n\n@DEMO\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\n\nwhen I receive [end of demo v]\nshow\ngo to [front v] layer\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nstop [all v]\n\n