[60K VIEWS] Blackout | Platformer
@Stage\n\nswitch backdrop to (backdrop40 v)\n\nwhen I receive [otherworld v]\nbroadcast (owmusic v)\n\nwhen backdrop switches to [backdrop1 v]\nbroadcast (earth v)\n\nwhen I receive [earthmusic v]\nstop [other scripts in sprite v]\nstop all sounds\nforever\n    start sound [Golf Land v]\n    wait (57.68) seconds\nend\n\nwhen I receive [earth v]\nbroadcast (earthmusic v)\n\nwhen I receive [owmusic v]\nstop [other scripts in sprite v]\nstop all sounds\nforever\n    start sound [Rhinoceros v]\n    wait (203.78) seconds\nend\n\nset [test v] to [1]\n\nset [test v] to [0]\n\nwhen I receive [doodle v]\nbroadcast (doodlemusic v)\n\nwhen I receive [doodlemusic v]\nstop [other scripts in sprite v]\nstop all sounds\nforever\n    start sound [Pixelland v]\n    wait (233.72) seconds\nend\n\nwhen backdrop switches to [backdrop34 v]\nbroadcast (otherworld v)\n\nwhen backdrop switches to [backdrop42 v]\nbroadcast (doodle v)\n\nwhen I receive [endgamemusic v]\nstop [other scripts in sprite v]\nstop all sounds\nstart sound [Nebula Belt Intro v]\nwait (4.37) seconds\nforever\n    start sound [Nebula Belt v]\n    wait (66.22) seconds\nend\n\nwhen backdrop switches to [backdrop63 v]\nbroadcast (endgame v)\n\nwhen I receive [endgame v]\nbroadcast (endgamemusic v)\n\nwhen flag clicked\nshow variable [level v]\n\nhide variable [level v]\nhide variable [coins v]\n\nwhen backdrop switches to [backdrop70 v]\nbroadcast (gong v)\n\nwhen backdrop switches to [backdrop71 v]\nbroadcast (finale v)\n\nwhen I receive [gong v]\nstop [other scripts in sprite v]\nstop all sounds\nforever\n    start sound [Bell Toll v]\n    wait (4.02) seconds\nend\n\nwhen I receive [finalemusic v]\nstop [other scripts in sprite v]\nstart sound [The Ultimate Show intro v]\nwait (16) seconds\nforever\n    start sound [The Ultimate Show v]\n    wait (70.38) seconds\nend\n\nwhen I receive [finale v]\nbroadcast (finalemusic v)\n\n@Player\n\ndefine Platformer engine\nif on edge, bounce\nchange [y v] by (-0.5)\nif <key (left arrow v) pressed?> then\n    point in direction (-90)\n    change [x v] by (-1)\nend\nif <key (right arrow v) pressed?> then\n    point in direction (90)\n    change [x v] by (1)\nend\nset [x v] to ((x) * (0.9))\nchange x by (x)\nif <touching color (#000000)?> then\n    change y by (1)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (-6)\n                            change x by ((x) * (-1))\n                            if <key (up arrow v) pressed?> then\n                                set [y v] to [10]\n                                if <(x) > [0]> then\n                                    set [x v] to [-10]\n                                else\n                                    set [x v] to [10]\n                                end\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (y)\nif <touching color (#000000)?> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\nend\nchange y by (-0.5)\nif <<touching color (#000000)?> and <key (up arrow v) pressed?>> then\n    set [y v] to [10]\nend\nchange y by (0.5)\nif <touching color (#ff0000)?> then\n    go to x: (X Spawn) y: (Y Spawn)\n    broadcast (coinreset v)\nend\nif <touching color (#003fff)?> then\n    set [y v] to [16]\nend\nif <(y position) < [-219]> then\n    go to x: (X Spawn) y: (Y Spawn)\nend\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nset [y spawn v] to [-120]\nset [x spawn v] to [-210]\ngo to x: (X Spawn) y: (Y Spawn)\nshow\nset size to (60) %\nset [x v] to [0]\nset [y v] to [0]\nforever\n    Platformer engine\nend\n\nwhen flag clicked\nif <(username) = [acduckii_rises]> then\n    switch costume to (bubbles v)\nelse\n    switch costume to (randombird)\nend\n\nwhen [r v] key pressed\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen I receive [switch bird v]\nif <(costume [number v]) = [4]> then\n    switch costume to (red v)\nelse\n    next costume\nend\n\nrepeat until <not <(randombird) = (costume [number v])>>\n\nset [randombird v] to (pick random (1) to (4))\n\nwhen I receive [restart v]\ngo to x: (X Spawn) y: (Y Spawn)\n\nwhen flag clicked\nset [randombird v] to (pick random (1) to (4))\nforever\n    wait until <(x position) > [210]>\n    broadcast (clear v)\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [72]> then\n        wait until <(y position) > [130]>\n    else\n        wait until <(x position) > [186]>\n    end\n    if <<(pig = dead?) = [1]> and <(charged pig = dead?) = [1]>> then\n        broadcast (clearstage v)\n        switch backdrop to (next backdrop v)\n        if <(backdrop [name v]) = [testing]> then\n            switch backdrop to (backdrop1 v)\n        end\n        go to x: (X Spawn) y: (Y Spawn)\n        broadcast (clearstage v)\n        if <(costume [number v]) = [5]> then\n            if <(username) = [acduckii_rises]> then\n                switch costume to (bubbles v)\n            else\n                switch costume to (randombird)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(backdrop [number v]) > [68]> and <(backdrop [number v]) < [74]>> then\n        set size to (30) %\n    else\n        set size to (60) %\n    end\nend\n\nwhen flag clicked\nset [tut v] to [0]\nset [blueclone v] to [0]\nforever\n    if <(costume [number v]) = [5]> then\n        repeat (2)\n            change [blueclone v] by (1)\n            create clone of (_myself_ v)\n        end\n        wait until <not <(costume [number v]) = [5]>>\n        set [blueclone v] to [0]\n        repeat (2)\n            delete this clone\n        end\n    else\n        set [blueclone v] to [0]\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nswitch costume to (join [blue_] (blueclone))\nchange y by ((blueclone) * (60))\nchange x by ((blueclone) * (60))\nif <(blueclone) = [1]> then\n    repeat until <(blueclone) = [0]>\n        blueclone 1\n    end\nelse\n    if <(blueclone) = [2]> then\n        repeat until <(blueclone) = [0]>\n            blueclone 2\n        end\n    end\nend\n\ndefine blueclone 1\nif on edge, bounce\nchange [y v] by (-0.5)\nif <key (a v) pressed?> then\n    point in direction (-90)\n    change [x v] by (-1)\nend\nif <key (d v) pressed?> then\n    point in direction (90)\n    change [x v] by (1)\nend\nset [x v] to ((x) * (0.9))\nchange x by (x)\nif <touching color (#000000)?> then\n    change y by (1)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (-6)\n                            change x by ((x) * (-1))\n                            if <key (w v) pressed?> then\n                                set [y v] to [10]\n                                if <(x) > [0]> then\n                                    set [x v] to [-10]\n                                else\n                                    set [x v] to [10]\n                                end\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (y)\nif <touching color (#000000)?> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\nend\nchange y by (-0.5)\nif <<touching color (#000000)?> and <key (w v) pressed?>> then\n    set [y v] to [10]\nend\nchange y by (0.5)\nif <touching color (#ff0000)?> then\n    delete this clone\nend\nif <touching color (#003fff)?> then\n    set [y v] to [16]\nend\nif <(y position) < [-219]> then\n    go to x: (X Spawn) y: (Y Spawn)\nend\n\ndefine blueclone 2\nif on edge, bounce\nchange [y v] by (-0.5)\nif <key (j v) pressed?> then\n    point in direction (-90)\n    change [x v] by (-1)\nend\nif <key (l v) pressed?> then\n    point in direction (90)\n    change [x v] by (1)\nend\nset [x v] to ((x) * (0.9))\nchange x by (x)\nif <touching color (#000000)?> then\n    change y by (1)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (-6)\n                            change x by ((x) * (-1))\n                            if <key (i v) pressed?> then\n                                set [y v] to [10]\n                                if <(x) > [0]> then\n                                    set [x v] to [-10]\n                                else\n                                    set [x v] to [10]\n                                end\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (y)\nif <touching color (#000000)?> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\nend\nchange y by (-0.5)\nif <<touching color (#000000)?> and <key (i v) pressed?>> then\n    set [y v] to [10]\nend\nchange y by (0.5)\nif <touching color (#ff0000)?> then\n    delete this clone\nend\nif <touching color (#003fff)?> then\n    set [y v] to [16]\nend\nif <(y position) < [-219]> then\n    go to x: (X Spawn) y: (Y Spawn)\nend\n\nwhen I start as a clone\nif <(tut) = [0]> then\n    if <(blueclone) = [1]> then\n        say [Use the WASD keys to move me!] for (1) seconds\n    else\n        if <(blueclone) = [2]> then\n            wait (1) seconds\n            say [Use the IJKL keys to move me!] for (1) seconds\n            set [tut v] to [1]\n        end\n    end\nend\n\nwhen I start as a clone\nwait until <(blueclone) = [0]>\ndelete this clone\n\nwhen [r v] key pressed\nset [blueclone v] to [0]\nwait (0.01) seconds\nif <(costume [number v]) = [5]> then\n    repeat (2)\n        change [blueclone v] by (1)\n        create clone of (_myself_ v)\n    end\nelse\n    set [blueclone v] to [0]\n    delete this clone\nend\n\nwhen I receive [blues v]\ngo to x: (X Spawn) y: (Y Spawn)\nswitch costume to (blue_main v)\nsay [Get me to the other side!] for (1) seconds\n\nwhen I receive [clearstage v]\nset [coin collected? v] to [0]\n\n\n\nwhen [r v] key pressed\nbroadcast (clear v)\n\n@Coin\n\nwhen backdrop switches to [backdrop2 v]\nshow\ngo to x: (155) y: (-99)\n\nwhen backdrop switches to [backdrop3 v]\nshow\ngo to x: (155) y: (-99)\n\nwhen backdrop switches to [backdrop6 v]\nshow\ngo to x: (170) y: (97)\n\nwhen backdrop switches to [backdrop4 v]\nshow\ngo to x: (-14) y: (-5)\n\nwhen backdrop switches to [backdrop5 v]\nshow\ngo to x: (64) y: (36)\n\nwhen backdrop switches to [backdrop7 v]\nshow\ngo to x: (40) y: (-13)\n\nwhen backdrop switches to [backdrop8 v]\nshow\ngo to x: (75) y: (115)\n\nwhen backdrop switches to [backdrop9 v]\nshow\ngo to x: (124) y: (97)\n\nwhen backdrop switches to [backdrop10 v]\nshow\ngo to x: (35) y: (-88)\n\nwhen backdrop switches to [backdrop13 v]\nshow\ngo to x: (190) y: (125)\n\nwhen backdrop switches to [backdrop11 v]\nhide\n\nwhen backdrop switches to [backdrop12 v]\nhide\n\nwhen backdrop switches to [backdrop14 v]\nshow\ngo to x: (-15) y: (151)\n\nwhen backdrop switches to [backdrop15 v]\nshow\ngo to x: (190) y: (78)\n\nwhen backdrop switches to [backdrop16 v]\nshow\ngo to x: (-5) y: (9)\n\nwhen backdrop switches to [backdrop16 v]\nshow\ngo to x: (198) y: (74)\n\nwhen backdrop switches to [backdrop17 v]\nshow\ngo to x: (114) y: (-5)\n\nwhen backdrop switches to [backdrop18 v]\nshow\ngo to x: (73) y: (-67)\n\nwhen backdrop switches to [backdrop19 v]\nshow\ngo to x: (-48) y: (48)\n\nwhen backdrop switches to [backdrop20 v]\nshow\ngo to x: (160) y: (-40)\n\nwhen backdrop switches to [backdrop21 v]\nshow\ngo to x: (50) y: (-75)\n\nwhen backdrop switches to [backdrop22 v]\nshow\ngo to x: (93) y: (145)\n\nwhen backdrop switches to [backdrop23 v]\nshow\ngo to x: (122) y: (-29)\n\nwhen backdrop switches to [backdrop24 v]\nshow\ngo to x: (7) y: (10)\n\nwhen backdrop switches to [backdrop25 v]\nshow\ngo to x: (0) y: (0)\n\nwhen backdrop switches to [backdrop26 v]\nshow\ngo to x: (58) y: (3)\n\nwhen backdrop switches to [backdrop27 v]\nshow\ngo to x: (12) y: (70)\n\nwhen backdrop switches to [backdrop28 v]\nshow\ngo to x: (63) y: (40)\n\nwhen backdrop switches to [backdrop29 v]\nshow\ngo to x: (20) y: (35)\n\nwhen backdrop switches to [backdrop29 v]\nshow\ngo to x: (20) y: (30)\n\nwhen backdrop switches to [backdrop30 v]\nhide\n\nwhen flag clicked\ngo to [back v] layer\nset [coins v] to [0]\nshow\nforever\n    go to [back v] layer\n    if <touching (player v)?> then\n        set [coin collected? v] to [1]\n        hide\n        change [coins v] by (coins per coin)\n        start sound [Coin v]\n    end\nend\n\nwhen backdrop switches to [backdrop1 v]\nshow\ngo to x: (-8) y: (-26)\n\nwhen backdrop switches to [backdrop45 v]\nshow\ngo to x: (51) y: (-35)\n\nwhen backdrop switches to [backdrop46 v]\nshow\ngo to x: (171) y: (-6)\n\nwhen backdrop switches to [backdrop48 v]\nshow\ngo to x: (0) y: (-10)\n\nwhen backdrop switches to [backdrop47 v]\nshow\ngo to x: (-30) y: (82)\n\nwhen backdrop switches to [backdrop49 v]\nhide\n\nwhen backdrop switches to [backdrop59 v]\nhide\n\nwhen backdrop switches to [backdrop61 v]\nshow\ngo to x: (-143) y: (121)\n\nwhen backdrop switches to [backdrop62 v]\nhide\n\nwhen backdrop switches to [backdrop64 v]\nhide\n\nwhen backdrop switches to [backdrop63 v]\nshow\ngo to x: (-8) y: (-26)\n\nwhen flag clicked\nforever\n    next costume\n    wait (0.025) seconds\nend\n\nwhen backdrop switches to [testing v]\nshow\n\nwhen [c v] key pressed\nif <(backdrop [name v]) = [testing]> then\n    go to (mouse-pointer v)\nend\n\nwhen [r v] key pressed\nbroadcast (coinreset v)\n\nwhen I receive [coinreset v]\nif <(coin collected?) = [1]> then\n    show\n    set [coin collected? v] to [0]\n    change [coins v] by (-1)\nend\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (-146) y: (162)\n\nwhen this sprite clicked\nbroadcast (shop v)\n\n@Sprite2\n\nwhen flag clicked\ngo to x: (0) y: (15)\nset [ghost v] effect to (0)\nset [shop v] to [0]\nhide\n\nwhen I receive [shop v]\nif <(shop) = [0]> then\n    set [shop v] to [1]\nelse\n    if <(shop) = [1]> then\n        set [shop v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(shop) = [1]> then\n        show\n    else\n        hide\n        set [demo? v] to [0]\n    end\nend\n\n@Sprite3\n\nwhen flag clicked\ngo to x: (125) y: (25)\nset [coins per coin v] to [1]\nhide\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) > [36]> then\n        if <touching (mouse-pointer v)?> then\n            repeat until <not <touching (mouse-pointer v)?>>\n                say [Weaken Pigs: 10 Coins] for (2) seconds\n                say [Duration: 40 seconds] for (2) seconds\n            end\n        end\n    end\nend\n\nwhen this sprite clicked\nif <(backdrop [number v]) > [36]> then\n    set [demo? v] to [pigdebuff]\nelse\n    think [Unlocks at Level 37] for (2) seconds\nend\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    if <<(shop) = [1]> and <<(demo?) = [0]> or <(demo?) = [pigdebuff]>>> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    if <(demo?) = [pigdebuff]> then\n        go to x: (-165) y: (63)\n    else\n        set x to (125)\n        set y to (25)\n    end\nend\n\nwhen flag clicked\ngo to x: (125) y: (25)\nhide\nforever\n    if <(backdrop [number v]) > [36]> then\n        switch costume to (costume1 v)\n    else\n        switch costume to (costume2 v)\n    end\nend\n\n@Sprite4\n\nwhen flag clicked\ngo to x: (0) y: (25)\nhide\nforever\n    if <(backdrop [number v]) > [31]> then\n        switch costume to (costume1 v)\n    else\n        switch costume to (costume2 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(backdrop [number v]) > [31]> and <(demo?) = [0]>> then\n        if <touching (mouse-pointer v)?> then\n            repeat until <not <touching (mouse-pointer v)?>>\n                say [The Blues: 15 coins] for (2) seconds\n            end\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(shop) = [1]> and <<(demo?) = [0]> or <(demo?) = [blues]>>> then\n        show\n    else\n        hide\n    end\nend\n\nwhen this sprite clicked\nif <(backdrop [number v]) > [31]> then\n    broadcast (shoppreview_blues v)\nelse\n    think [Unlocks at Level 32] for (2) seconds\nend\n\nif <<(Coins) = [15]> or <(Coins) > [15]>> then\n    change [coins v] by (-15)\n    set [shop v] to [0]\n    broadcast (blues v)\nelse\n    say [Insufficient funds.] for (2) seconds\nend\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    if <(demo?) = [blues]> then\n        go to x: (-165) y: (63)\n    else\n        set x to (0)\n        set y to (25)\n    end\nend\n\nhide\n\n@Sprite5\n\nwhen flag clicked\ngo to x: (-125) y: (25)\nhide\n\nwhen flag clicked\ngo to [front v] layer\nset [changecost v] to [0]\nforever\n    if <<(demo?) = [0]> and <touching (mouse-pointer v)?>> then\n        repeat until <not <touching (mouse-pointer v)?>>\n            if <(changecost) = [0]> then\n                say [Change Bird - FREE] for (2) seconds\n            else\n                say (join [Change Bird - ] (join (changecost) [ coins])) for (2) seconds\n            end\n        end\n    end\nend\n\nwhen this sprite clicked\nbroadcast (shoppreview_swap v)\n\nwhen flag clicked\nforever\n    if <<(shop) = [1]> and <<(demo?) = [0]> or <(demo?) = [swap]>>> then\n        show\n    else\n        hide\n    end\nend\n\nif <<(Coins) = (changecost)> or <(Coins) > (changecost)>> then\n    change [coins v] by (join [-] (changecost))\n    if <(changecost) = [0]> then\n        change [changecost v] by (1)\n    else\n        change [changecost v] by ((changecost) * (2))\n    end\n    broadcast (switch bird v)\nelse\n    say [Not enough coins!] for (2) seconds\nend\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    if <(demo?) = [swap]> then\n        go to x: (-165) y: (63)\n    else\n        set x to (-125)\n        set y to (25)\n    end\nend\n\n@Sprite6\n\nwhen flag clicked\nset [counters hidden? v] to [0]\ngo to [front v] layer\nshow\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\ngo to [front v] layer\n\nwhen [0 v] key pressed\ngo to [front v] layer\nif <(counters hidden?) = [0]> then\n    set [counters hidden? v] to [1]\n    hide variable [level v]\n    hide variable [coins v]\nelse\n    set [counters hidden? v] to [0]\n    show variable [level v]\n    show variable [coins v]\nend\n\nbroadcast (switch bird v)\n\n@Sprite7\n\nwhen flag clicked\nif <(username) = []> then\n    go to x: (0) y: (0)\n    go to [front v] layer\n    show\n    switch costume to (costume2 v)\n    wait until <key (l v) pressed?>\n    switch costume to (costume1 v)\n    go to x: (126) y: (154)\n    go to [front v] layer\n    show\n    set [ghost v] effect to (25)\nelse\n    hide\nend\n\n@Robo Pig\n\nwhen backdrop switches to [backdrop37 v]\nplace robo-pig at [154] [-90]\n\nwhen backdrop switches to [backdrop38 v]\nplace robo-pig at [189] [-73]\n\nwhen backdrop switches to [backdrop39 v]\nhide\n\nwhen backdrop switches to [backdrop47 v]\nplace robo-pig at [170] [100]\n\nwhen backdrop switches to [backdrop48 v]\nplace robo-pig at [96] [-125]\n\nwhen backdrop switches to [backdrop40 v]\nhide\n\nwhen backdrop switches to [backdrop59 v]\nplace robo-pig at [126] [-21]\n\ndefine place robo-pig at (x) (y)\nshow\nswitch costume to (costume1 v)\nset [pig = dead? v] to [0]\nset size to (50) %\nif <([costume name v] of [player v]) = [bomb]> then\n    wait until <touching (player v)?>\n    hide\n    set [pig = dead? v] to [1]\n    repeat (3)\n        change [coins v] by (1)\n        wait (0.05) seconds\n    end\nelse\n    if <(pigs weakened?) = [true]> then\n        go to x: (x) y: (y)\n        wait until <touching (player v)?>\n        broadcast (restart v)\n        next costume\n        next costume\n        wait until <touching (player v)?>\n        hide\n        set [pig = dead? v] to [1]\n        repeat (3)\n            change [coins v] by (1)\n            wait (0.05) seconds\n        end\n    else\n        go to x: (x) y: (y)\n        wait until <touching (player v)?>\n        repeat (2)\n            wait until <touching (player v)?>\n            broadcast (restart v)\n            next costume\n        end\n        wait until <touching (player v)?>\n        hide\n        set [pig = dead? v] to [1]\n        repeat (3)\n            change [coins v] by (1)\n            wait (0.05) seconds\n        end\n    end\nend\n\nwhen backdrop switches to [backdrop64 v]\nplace robo-pig at [11] [108]\n\nwhen backdrop switches to [backdrop60 v]\nset [pig = dead? v] to [1]\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\nwait until <touching (player v)?>\nbroadcast (restart v)\n\nwhen flag clicked\nset [coins v] to [0]\nswitch costume to (costume1 v)\nhide\nforever\n    if <([backdrop # v] of [_stage_ v]) < [37]> then\n        set [pig = dead? v] to [1]\n    end\nend\n\n@Sprite8\n\nwhen flag clicked\nerase all\nforever\n    go to (mouse-pointer v)\n    go [backward v] (999) layers\n    set pen size to (7.5)\n    if <(level) = [51]> then\n        set pen color to (#ffffff)\n    else\n        set pen color to (#000000)\n    end\nend\n\nwhen [r v] key pressed\nerase all\n\nwhen I receive [restart v]\n\nerase all\n\nwhen flag clicked\nforever\n    wait until <([x position v] of [player v]) > [186]>\n    broadcast (clear v)\nend\n\nwhen I receive [clear v]\nerase all\n\nwhen backdrop switches to [backdrop42 v]\nerase all\n\nwhen backdrop switches to [backdrop47 v]\nerase all\n\nwhen backdrop switches to [backdrop48 v]\nerase all\n\nwhen backdrop switches to [backdrop49 v]\nerase all\n\nwhen backdrop switches to [backdrop45 v]\nerase all\n\nwhen flag clicked\nforever\n    if <<<([backdrop # v] of [_stage_ v]) > [41]> and <([backdrop # v] of [_stage_ v]) < [62]>> and <mouse down?>> then\n        pen down\n    else\n        pen up\n    end\nend\n\nwhen backdrop switches to [backdrop43 v]\nerase all\n\nwhen backdrop switches to [backdrop44 v]\nerase all\n\nwhen backdrop switches to [backdrop46 v]\nerase all\n\nwhen backdrop switches to [backdrop50 v]\nerase all\n\nwhen backdrop switches to [backdrop51 v]\nerase all\n\nwhen backdrop switches to [backdrop52 v]\nerase all\n\nwhen backdrop switches to [backdrop53 v]\nerase all\n\nerase all\n\nwhen backdrop switches to [backdrop54 v]\nerase all\n\nwhen backdrop switches to [backdrop55 v]\nerase all\n\nwhen backdrop switches to [backdrop56 v]\nerase all\n\nwhen flag clicked\nshow variable [coins v]\nshow variable [level v]\nforever\n    set [level v] to (backdrop [number v])\nend\n\nwhen backdrop switches to [backdrop57 v]\nerase all\n\nwhen backdrop switches to [backdrop58 v]\nerase all\n\nwhen I receive [clear v]\nerase all\n\nwhen flag clicked\nforever\n    if <(username) = [acduckii_rises]> then\n        wait until <key (t v) pressed?>\n        wait until <key (e v) pressed?>\n        wait until <key (s v) pressed?>\n        wait until <key (t v) pressed?>\n        wait until <key (m v) pressed?>\n        wait until <key (o v) pressed?>\n        wait until <key (d v) pressed?>\n        wait until <key (e v) pressed?>\n        ask [Welcome to Testing Mode! Please enter the number of the level you'd like to test below:] and wait\n        switch backdrop to (answer)\n        ask [How many coins do you need?] and wait\n        if <(answer) > [0]> then\n            change [coins v] by (answer)\n        end\n    else\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<(pig = dead?) = [1]> and <(charged pig = dead?) = [1]>> and <([x position v] of [player v]) > [186]>> then\n        erase all\n    end\nend\n\nwhen backdrop switches to [backdrop61 v]\nerase all\n\nwhen backdrop switches to [backdrop60 v]\nerase all\n\nwhen backdrop switches to [backdrop62 v]\nerase all\n\nwhen backdrop switches to [backdrop63 v]\nerase all\n\n@Charged Robo Pig\n\nwhen backdrop switches to [backdrop58 v]\nplace charged pig at [96] [-91]\n\nwhen backdrop switches to [backdrop59 v]\nplace charged pig at [104] [78]\n\nwhen backdrop switches to [backdrop60 v]\nset [charged pig = dead? v] to [1]\n\ndefine place charged pig at (x) (y)\nshow\nswitch costume to (costume1 v)\nset [charged pig = dead? v] to [0]\nset size to (45) %\nif <([costume name v] of [player v]) = [bomb]> then\n    wait until <touching (player v)?>\n    broadcast (restart v)\n    switch costume to (costume5 v)\n    wait until <touching (player v)?>\n    hide\n    set [charged pig = dead? v] to [1]\n    repeat (3)\n        change [coins v] by (1)\n        wait (0.05) seconds\n    end\nelse\n    if <(pigs weakened?) = [true]> then\n        go to x: (x) y: (y)\n        wait until <touching (player v)?>\n        repeat (1)\n            wait until <touching (player v)?>\n            broadcast (restart v)\n            next costume\n            next costume\n        end\n        wait until <touching (player v)?>\n        broadcast (restart v)\n        next costume\n        wait until <touching (player v)?>\n        hide\n        set [charged pig = dead? v] to [1]\n        repeat (3)\n            change [coins v] by (1)\n            wait (0.05) seconds\n        end\n    else\n        go to x: (x) y: (y)\n        wait until <touching (player v)?>\n        repeat (3)\n            wait until <touching (player v)?>\n            broadcast (restart v)\n            next costume\n        end\n        wait until <touching (player v)?>\n        hide\n        set [charged pig = dead? v] to [1]\n        repeat (3)\n            change [coins v] by (1)\n            wait (0.05) seconds\n        end\n    end\nend\n\nwhen backdrop switches to [backdrop67 v]\nplace charged pig at [69] [-111]\n\nwhen backdrop switches to [backdrop68 v]\nset [charged pig = dead? v] to [1]\n\nwhen backdrop switches to [backdrop77 v]\nplace charged pig at [81] [20]\n\nwhen flag clicked\nset [coins v] to [0]\nswitch costume to (costume1 v)\nhide\nforever\n    if <([backdrop # v] of [_stage_ v]) < [58]> then\n        set [charged pig = dead? v] to [1]\n    end\nend\n\n@Diamond\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset rotation style [all around v]\nset size to (32) %\nhide\nforever\n    if <touching (player v)?> then\n        change [coins v] by (10)\n        hide\n        start sound [Jump v]\n    end\nend\n\nwhen backdrop switches to [backdrop64 v]\nshow\ngo to x: (14) y: (0)\n\nwhen backdrop switches to [backdrop1 v]\nhide\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\n    wait (1) seconds\nend\n\nwhen I start as a clone\nset rotation style [all around v]\ngo to [front v] layer\nswitch costume to (costume2 v)\nset [ghost v] effect to (0)\nset size to (100) %\nchange x by (pick random (-10) to (10))\nchange y by (pick random (-10) to (10))\nif <(pick random (1) to (2)) = [2]> then\n    repeat (20)\n        change size by (-5)\n        turn left (2) degrees\n        change [ghost v] effect by (5)\n        wait (0.05) seconds\n    end\nelse\n    repeat (20)\n        change size by (-5)\n        turn left (-2) degrees\n        change [ghost v] effect by (5)\n        wait (0.05) seconds\n    end\nend\ndelete this clone\n\nwhen backdrop switches to [backdrop68 v]\nshow\ngo to x: (81) y: (17)\n\nwhen backdrop switches to [backdrop69 v]\nshow\ngo to x: (0) y: (28)\n\nwhen backdrop switches to [backdrop65 v]\nhide\n\nwhen backdrop switches to [backdrop70 v]\nhide\n\n@Sprite9\n\nwhen flag clicked\ngo to x: (50) y: (-40)\npoint in direction (90)\nforever\n    if <(backdrop [number v]) = [66]> then\n        set [swing v] to [5]\n        show\n        repeat (11)\n            turn right (swing) degrees\n            change [swing v] by (-1)\n        end\n        set [swing v] to [5]\n        repeat (11)\n            turn left (swing) degrees\n            change [swing v] by (-1)\n        end\n    else\n        hide\n    end\nend\n\nwhen backdrop switches to [backdrop67 v]\nhide\nstop [other scripts in sprite v]\n\nwhen flag clicked\ngo to x: (0) y: (0)\npoint in direction (90)\nforever\n    if <not <(backdrop [number v]) = [66]>> then\n        hide\n    else\n        show\n    end\nend\n\n@Sprite12\n\nwhen flag clicked\ngo to x: (-40) y: (0)\npoint in direction (90)\nforever\n    if <(backdrop [number v]) = [71]> then\n        show\n        glide (2) secs to x: (-40) y: (-160)\n        glide (2) secs to x: (-40) y: (0)\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\npoint in direction (90)\nforever\n    if <not <(backdrop [number v]) = [71]>> then\n        hide\n    else\n        show\n    end\nend\n\n@DiamondAdjacent\n\nwhen flag clicked\nset rotation style [all around v]\nhide\nforever\n    if <(backdrop [number v]) = [66]> then\n        go to (sprite9 v)\n        repeat until <touching (player v)?>\n            show\n            turn right (5) degrees\n        end\n        change [coins v] by (10)\n        hide\n        start sound [Jump v]\n        stop [this script v]\n    else\n        hide\n    end\nend\n\nwhen backdrop switches to [backdrop1 v]\nhide\n\nwhen backdrop switches to [backdrop66 v]\npoint in direction (90)\ngo to (sprite9 v)\nshow\n\nwhen flag clicked\ngo to x: (0) y: (0)\npoint in direction (90)\nforever\n    if <not <(backdrop [number v]) = [66]>> then\n        hide\n    end\nend\n\n@Ultra Pig\n\n@Sprite10\n\nwhen flag clicked\ngo to x: (0) y: (0)\npoint in direction (90)\nforever\n    if <(backdrop [number v]) = [69]> then\n        show\n        glide (2) secs to x: (0) y: (-140)\n        glide (2) secs to x: (0) y: (0)\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\npoint in direction (90)\nforever\n    if <not <(backdrop [number v]) = [69]>> then\n        hide\n    else\n        show\n    end\nend\n\n@Sprite11\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (0) y: (0)\nforever\n    if <(backdrop [number v]) = [73]> then\n        show\n    else\n        hide\n    end\nend\n\n@Sprite13\n\nwhen flag clicked\ngo to x: (80) y: (-160)\npoint in direction (90)\nforever\n    if <(backdrop [number v]) = [71]> then\n        show\n        glide (2) secs to x: (80) y: (0)\n        glide (2) secs to x: (80) y: (-160)\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (80) y: (-160)\npoint in direction (90)\nforever\n    if <not <(backdrop [number v]) = [71]>> then\n        hide\n    else\n        show\n    end\nend\n\n@Sprite14\n\nwhen flag clicked\ngo to x: (-40) y: (0)\npoint in direction (90)\nforever\n    if <(backdrop [number v]) = [74]> then\n        show\n        turn right (5) degrees\n    else\n        hide\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\npoint in direction (90)\nset size to (75) %\nforever\n    if <not <(backdrop [number v]) = [74]>> then\n        hide\n    else\n        show\n    end\nend\n\n@bluesdemo\n\nwhen flag clicked\nset [demo? v] to [0]\ngo to x: (150) y: (20)\nhide\nswitch costume to (bluesdemo v)\nforever\n    next costume\nend\n\nwhen flag clicked\nforever\n    if <(demo?) = [blues]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [shoppreview_blues v]\nswitch costume to (bluesdemo v)\nset [demo? v] to [blues]\n\n@Sprite15\n\nwhen flag clicked\ngo to x: (-165) y: (-21)\n\nwhen flag clicked\nforever\n    if <(demo?) = [0]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen this sprite clicked\nif <(demo?) = [blues]> then\n    if <<(Coins) = [15]> or <(Coins) > [15]>> then\n        change [coins v] by (-15)\n        set [shop v] to [0]\n        broadcast (blues v)\n    else\n        say [Insufficient funds.] for (2) seconds\n    end\nelse\n    if <(demo?) = [swap]> then\n        if <<(Coins) = (changecost)> or <(Coins) > (changecost)>> then\n            change [coins v] by (join [-] (changecost))\n            set [shop v] to [0]\n            broadcast (switch bird v)\n        else\n            say [Insufficient funds.] for (2) seconds\n        end\n    else\n        if <(demo?) = [pigdebuff]> then\n            if <<(Coins) = [10]> or <(Coins) > [10]>> then\n                change [coins v] by (-10)\n                set [shop v] to [0]\n                set [pigs weakened? v] to [true]\n                wait (40) seconds\n                set [pigs weakened? v] to [false]\n            else\n                say [Insufficient funds.] for (2) seconds\n            end\n        else\n            say [Something broke.]\n        end\n    end\nend\n\n@Sprite16\n\nwhen flag clicked\nforever\n    if <(demo?) = [0]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (demo?)\nend\n\n@swapdemo\n\nwhen flag clicked\nforever\n    if <(demo?) = [swap]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [shoppreview_swap v]\nswitch costume to (swapdemo v)\nset [demo? v] to [swap]\n\nwhen flag clicked\nset [demo? v] to [0]\ngo to x: (150) y: (27)\nhide\nswitch costume to (swapdemo v)\nforever\n    next costume\nend\n\n@glass block\n\nwhen flag clicked\nswitch costume to (full v)\nhide\n\nwhen I receive [restart v]\nif <([costume name v] of [player v]) = [Bomb]> then\n    set [extrahit_glass? v] to [0]\nelse\n    set [extrahit_glass? v] to [1]\nend\n\ndefine place glass block at x: (x) y: (y) size: (size) angle: (angle) level: (level)\nif <(backdrop [number v]) = (level)> then\n    set [destroyed? v] to [0]\n    switch costume to (full v)\n    set size to (size) %\n    point in direction (angle)\n    go to x: (x) y: (y)\n    repeat until <<(costume [name v]) = [gone]> or <not <(backdrop [number v]) = (level)>>>\n        if <(touchingplayer?) = [true]> then\n            if <(costume [name v]) = [full]> then\n                if <<([costume name v] of [player v]) = [Bomb]> or <([costume name v] of [player v]) = [Chuck]>> then\n                    start sound (join [c] (pick random (1) to (3)))\n                    set [extrahit_glass? v] to [1]\n                else\n                    start sound (join [d] (pick random (1) to (2)))\n                end\n            else\n                if <(costume [name v]) = [damaged]> then\n                    start sound (join [x] (pick random (1) to (2)))\n                end\n            end\n            if <(costume [name v]) = [damaged]> then\n                switch costume to (particles1 v)\n                wait (0.05) seconds\n                switch costume to (particles2 v)\n                wait (0.06) seconds\n                switch costume to (particles3 v)\n                wait (0.07) seconds\n                switch costume to (gone v)\n                set [destroyed? v] to [1]\n            else\n                next costume\n            end\n            wait until <not <(distance to [hitbox v]) < [60]>>\n        end\n    end\n    set [destroyed? v] to [1]\n    stop [this script v]\nelse\n    set [destroyed? v] to [1]\n    stop [this script v]\nend\n\nwhen backdrop switches to [backdrop11 v]\nplace glass block at x: [0] y: [-94] size: [75] angle: [90] level: [11]\n\ndefine respawn all glass blocks\nplace glass block at x: [0] y: [-94] size: [75] angle: [90] level: [11]\nplace glass block at x: [67] y: [158] size: [75] angle: [90] level: [14]\nplace glass block at x: [121] y: [-85] size: [75] angle: [0] level: [23]\nplace glass block at x: [-77] y: [32] size: [65] angle: [90] level: [24]\nplace glass block at x: [-84] y: [-132] size: [75] angle: [10] level: [35]\nplace glass block at x: [46] y: [-85] size: [65] angle: [90] level: [77]\n\nwhen flag clicked\nset [destroyed? v] to [1]\nforever\n    if <(destroyed?) = [0]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [clear v]\nrespawn all glass blocks\n\nwhen backdrop switches to [backdrop14 v]\nplace glass block at x: [67] y: [158] size: [75] angle: [90] level: [14]\n\nwhen backdrop switches to [backdrop23 v]\nplace glass block at x: [121] y: [-85] size: [75] angle: [0] level: [23]\n\nwhen backdrop switches to [backdrop35 v]\nplace glass block at x: [-84] y: [-132] size: [75] angle: [10] level: [35]\n\nwhen backdrop switches to [backdrop77 v]\nplace glass block at x: [46] y: [-85] size: [65] angle: [90] level: [77]\n\nwhen backdrop switches to [testing v]\nplace glass block at x: [0] y: [-70] size: [75] angle: [0] level: [78]\n\nwhen flag clicked\nforever\n    set [touchingplayer? v] to <touching (hitbox v)?>\nend\n\n@wood block\n\nswitch costume to (particles1 v)\nwait (0.05) seconds\nswitch costume to (particles2 v)\nwait (0.06) seconds\nswitch costume to (particles3 v)\nwait (0.07) seconds\nswitch costume to (gone v)\n\nwhen flag clicked\nswitch costume to (full v)\nhide\n\ndefine place wood block at x: (x) y: (y) size: (size) angle: (angle) level: (level)\nif <(backdrop [number v]) = (level)> then\n    set [destroyed? v] to [0]\n    switch costume to (full v)\n    set size to (size) %\n    point in direction (angle)\n    go to x: (x) y: (y)\n    repeat until <<(costume [name v]) = [gone]> or <not <(backdrop [number v]) = (level)>>>\n        if <(touchingplayer?) = [true]> then\n            if <(costume [name v]) = [full]> then\n                if <([costume name v] of [player v]) = [Bomb]> then\n                    start sound (join [c] (pick random (1) to (3)))\n                    set [extrahit_wood? v] to [1]\n                else\n                    start sound (join [d] (pick random (1) to (2)))\n                end\n            else\n                if <(costume [name v]) = [damaged]> then\n                    start sound (join [x] (pick random (1) to (2)))\n                end\n            end\n            if <(costume [name v]) = [damaged]> then\n                switch costume to (particles1 v)\n                wait (0.05) seconds\n                switch costume to (particles2 v)\n                wait (0.06) seconds\n                switch costume to (particles3 v)\n                wait (0.07) seconds\n                switch costume to (gone v)\n                set [destroyed? v] to [1]\n            else\n                next costume\n            end\n            wait until <not <(distance to [hitbox v]) < [50]>>\n        end\n    end\n    set [destroyed? v] to [1]\n    stop [this script v]\nelse\n    set [destroyed? v] to [1]\n    stop [this script v]\nend\n\ndefine respawn all wood blocks\nplace wood block at x: [50] y: [-94] size: [75] angle: [90] level: [11]\nplace wood block at x: [58] y: [16] size: [80] angle: [90] level: [13]\nplace wood block at x: [-10] y: [25] size: [45] angle: [90] level: [29]\nplace wood block at x: [117] y: [-148] size: [65] angle: [0] level: [36]\n\nwhen backdrop switches to [backdrop11 v]\nplace wood block at x: [50] y: [-94] size: [75] angle: [90] level: [11]\n\nwhen flag clicked\nset [destroyed? v] to [1]\nforever\n    if <(destroyed?) = [0]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [clear v]\nrespawn all wood blocks\n\nwhen backdrop switches to [backdrop13 v]\nplace wood block at x: [58] y: [16] size: [80] angle: [90] level: [13]\n\nwhen backdrop switches to [backdrop29 v]\nplace wood block at x: [-10] y: [25] size: [45] angle: [90] level: [29]\n\nwhen backdrop switches to [backdrop36 v]\nplace wood block at x: [117] y: [-148] size: [75] angle: [0] level: [36]\n\nwhen backdrop switches to [backdrop77 v]\nplace wood block at x: [117] y: [-148] size: [65] angle: [0] level: [77]\n\nwhen flag clicked\nforever\n    set [touchingplayer? v] to <touching (hitbox v)?>\nend\n\n@stone block\n\nswitch costume to (particles1 v)\nwait (0.05) seconds\nswitch costume to (particles2 v)\nwait (0.06) seconds\nswitch costume to (particles3 v)\nwait (0.07) seconds\nswitch costume to (gone v)\n\nwhen flag clicked\nswitch costume to (full v)\nhide\n\nif <(costume [name v]) = [full]> then\n    start sound (join [c] (pick random (1) to (3)))\nelse\n    if <(costume [name v]) = [damaged]> then\n        start sound (join [x] (pick random (1) to (2)))\n    else\n        start sound (join [d] (pick random (1) to (2)))\n    end\nend\nnext costume\n\ndefine place stone block at x: (x) y: (y) size: (size) angle: (angle) level: (level)\nif <(backdrop [number v]) = (level)> then\n    set [destroyed? v] to [0]\n    switch costume to (full v)\n    set size to (size) %\n    point in direction (angle)\n    go to x: (x) y: (y)\n    repeat until <<(costume [name v]) = [gone]> or <not <(backdrop [number v]) = (level)>>>\n        if <(touchingplayer?) = [true]> then\n            if <<(costume [name v]) = [damaged]> or <([costume name v] of [player v]) = [Bomb]>> then\n                switch costume to (particles1 v)\n                wait (0.05) seconds\n                switch costume to (particles2 v)\n                wait (0.06) seconds\n                switch costume to (particles3 v)\n                wait (0.07) seconds\n                switch costume to (gone v)\n            else\n                next costume\n            end\n            if <<<(costume [name v]) = [full]> or <(costume [name v]) = [bruised]>> and <not <([costume name v] of [player v]) = [Bomb]>>> then\n                start sound (join [c] (pick random (1) to (3)))\n            else\n                if <<(costume [name v]) = [battered]> and <not <([costume name v] of [player v]) = [Bomb]>>> then\n                    start sound (join [d] (pick random (1) to (2)))\n                else\n                    if <<(costume [name v]) = [damaged]> or <([costume name v] of [player v]) = [Bomb]>> then\n                        start sound (join [x] (pick random (1) to (2)))\n                    end\n                end\n            end\n            wait until <not <(distance to [hitbox v]) < [50]>>\n        end\n    end\n    set [destroyed? v] to [1]\n    stop [this script v]\nelse\n    set [destroyed? v] to [1]\n    stop [this script v]\nend\n\ndefine respawn all stone blocks\nplace stone block at x: [100] y: [-94] size: [75] angle: [90] level: [11]\nplace stone block at x: [-14] y: [-138] size: [75] angle: [-5] level: [16]\n\nwhen backdrop switches to [backdrop11 v]\nplace stone block at x: [100] y: [-94] size: [75] angle: [90] level: [11]\n\n\n\nwhen flag clicked\nset [destroyed? v] to [1]\nforever\n    if <(destroyed?) = [0]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [clear v]\nrespawn all stone blocks\n\nwhen backdrop switches to [backdrop16 v]\nplace stone block at x: [-14] y: [-138] size: [75] angle: [-5] level: [16]\n\nwhen flag clicked\nforever\n    set [touchingplayer? v] to <touching (hitbox v)?>\nend\n\n@debuffdemo\n\nwhen flag clicked\nforever\n    if <(demo?) = [pigdebuff]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [shoppreview_debuff v]\nswitch costume to (swapdemo v)\nset [demo? v] to [pigdebuff]\n\nwhen flag clicked\nset [demo? v] to [0]\ngo to x: (150) y: (20)\nhide\nswitch costume to (byepiggy v)\nforever\n    next costume\nend\n\n@Meteor Pig\n\nwhen backdrop switches to [backdrop71 v]\nshow\nrepeat until <(backdrop [number v]) > [71]>\n    point in direction (-140)\n    set y to (240)\n    set x to (pick random (70) to (400))\n    repeat until <<touching (player v)?> or <(y position) < [-140]>>\n        move (10) steps\n    end\n    if <touching (player v)?> then\n        broadcast (restart v)\n    end\nend\nhide\n\nwhen flag clicked\nset [coins v] to [0]\nswitch costume to (costume1 v)\nhide\n\nwhen flag clicked\npoint in direction (-135)\nset size to (30) %\nforever\n    go to [back v] layer\nend\n\n@glass 2\n\nwhen flag clicked\nswitch costume to (full v)\nhide\n\nwhen I receive [restart v]\nif <([costume name v] of [player v]) = [Bomb]> then\n    set [extrahit_glass? v] to [0]\nelse\n    set [extrahit_glass? v] to [1]\nend\n\ndefine place glass block at x: (x) y: (y) size: (size) angle: (angle) level: (level)\nif <(backdrop [number v]) = (level)> then\n    set [destroyed? v] to [0]\n    switch costume to (full v)\n    set size to (size) %\n    point in direction (angle)\n    go to x: (x) y: (y)\n    repeat until <<(costume [name v]) = [gone]> or <not <(backdrop [number v]) = (level)>>>\n        if <(touchingplayer?) = [true]> then\n            if <(costume [name v]) = [full]> then\n                if <<([costume name v] of [player v]) = [Bomb]> or <([costume name v] of [player v]) = [Chuck]>> then\n                    start sound (join [c] (pick random (1) to (3)))\n                    set [extrahit_glass? v] to [1]\n                else\n                    start sound (join [d] (pick random (1) to (2)))\n                end\n            else\n                if <(costume [name v]) = [damaged]> then\n                    start sound (join [x] (pick random (1) to (2)))\n                end\n            end\n            if <(costume [name v]) = [damaged]> then\n                switch costume to (particles1 v)\n                wait (0.05) seconds\n                switch costume to (particles2 v)\n                wait (0.06) seconds\n                switch costume to (particles3 v)\n                wait (0.07) seconds\n                switch costume to (gone v)\n                set [destroyed? v] to [1]\n            else\n                next costume\n            end\n            wait until <not <(distance to [hitbox v]) < [50]>>\n        end\n    end\n    set [destroyed? v] to [1]\n    stop [this script v]\nelse\n    set [destroyed? v] to [1]\n    stop [this script v]\nend\n\ndefine respawn all glass blocks\nplace glass block at x: [167] y: [-125] size: [75] angle: [-20] level: [35]\nplace glass block at x: [116] y: [-85] size: [65] angle: [90] level: [77]\n\nwhen flag clicked\nset [destroyed? v] to [1]\nforever\n    if <(destroyed?) = [0]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [clear v]\nrespawn all glass blocks\n\nwhen backdrop switches to [backdrop35 v]\nplace glass block at x: [167] y: [-125] size: [75] angle: [-20] level: [35]\n\nwhen backdrop switches to [backdrop77 v]\nplace glass block at x: [116] y: [-85] size: [65] angle: [90] level: [77]\n\nwhen flag clicked\nforever\n    set [touchingplayer? v] to <touching (hitbox v)?>\nend\n\n@wood 2\n\nswitch costume to (particles1 v)\nwait (0.05) seconds\nswitch costume to (particles2 v)\nwait (0.06) seconds\nswitch costume to (particles3 v)\nwait (0.07) seconds\nswitch costume to (gone v)\n\nwhen flag clicked\nswitch costume to (full v)\nhide\n\ndefine place wood block at x: (x) y: (y) size: (size) angle: (angle) level: (level)\nif <(backdrop [number v]) = (level)> then\n    set [destroyed? v] to [0]\n    switch costume to (full v)\n    set size to (size) %\n    point in direction (angle)\n    go to x: (x) y: (y)\n    repeat until <<(costume [name v]) = [gone]> or <not <(backdrop [number v]) = (level)>>>\n        if <(touchingplayer?) = [true]> then\n            if <(costume [name v]) = [full]> then\n                if <([costume name v] of [player v]) = [Bomb]> then\n                    start sound (join [c] (pick random (1) to (3)))\n                    set [extrahit_wood? v] to [1]\n                else\n                    start sound (join [d] (pick random (1) to (2)))\n                end\n            else\n                if <(costume [name v]) = [damaged]> then\n                    start sound (join [x] (pick random (1) to (2)))\n                end\n            end\n            if <(costume [name v]) = [damaged]> then\n                switch costume to (particles1 v)\n                wait (0.05) seconds\n                switch costume to (particles2 v)\n                wait (0.06) seconds\n                switch costume to (particles3 v)\n                wait (0.07) seconds\n                switch costume to (gone v)\n                set [destroyed? v] to [1]\n            else\n                next costume\n            end\n            wait until <not <(distance to [hitbox v]) < [50]>>\n        end\n    end\n    set [destroyed? v] to [1]\n    stop [this script v]\nelse\n    set [destroyed? v] to [1]\n    stop [this script v]\nend\n\ndefine respawn all wood blocks\n\nwhen flag clicked\nset [destroyed? v] to [1]\nforever\n    if <(destroyed?) = [0]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [clear v]\nrespawn all wood blocks\n\nwhen flag clicked\nforever\n    set [touchingplayer? v] to <touching (hitbox v)?>\nend\n\n@stone 2\n\nswitch costume to (particles1 v)\nwait (0.05) seconds\nswitch costume to (particles2 v)\nwait (0.06) seconds\nswitch costume to (particles3 v)\nwait (0.07) seconds\nswitch costume to (gone v)\n\nwhen flag clicked\nswitch costume to (full v)\nhide\n\nif <(costume [name v]) = [full]> then\n    start sound (join [c] (pick random (1) to (3)))\nelse\n    if <(costume [name v]) = [damaged]> then\n        start sound (join [x] (pick random (1) to (2)))\n    else\n        start sound (join [d] (pick random (1) to (2)))\n    end\nend\nnext costume\n\ndefine place stone block at x: (x) y: (y) size: (size) angle: (angle) level: (level)\nif <(backdrop [number v]) = (level)> then\n    set [destroyed? v] to [0]\n    switch costume to (full v)\n    set size to (size) %\n    point in direction (angle)\n    go to x: (x) y: (y)\n    repeat until <<(costume [name v]) = [gone]> or <not <(backdrop [number v]) = (level)>>>\n        if <(touchingplayer?) = [true]> then\n            if <<(costume [name v]) = [damaged]> or <([costume name v] of [player v]) = [Bomb]>> then\n                switch costume to (particles1 v)\n                wait (0.05) seconds\n                switch costume to (particles2 v)\n                wait (0.06) seconds\n                switch costume to (particles3 v)\n                wait (0.07) seconds\n                switch costume to (gone v)\n            else\n                next costume\n            end\n            if <<<(costume [name v]) = [full]> or <(costume [name v]) = [bruised]>> and <not <([costume name v] of [player v]) = [Bomb]>>> then\n                start sound (join [c] (pick random (1) to (3)))\n            else\n                if <<(costume [name v]) = [battered]> and <not <([costume name v] of [player v]) = [Bomb]>>> then\n                    start sound (join [d] (pick random (1) to (2)))\n                else\n                    if <<(costume [name v]) = [damaged]> or <([costume name v] of [player v]) = [Bomb]>> then\n                        start sound (join [x] (pick random (1) to (2)))\n                    end\n                end\n            end\n            wait until <not <(distance to [hitbox v]) < [50]>>\n        end\n    end\n    set [destroyed? v] to [1]\n    stop [this script v]\nelse\n    set [destroyed? v] to [1]\n    stop [this script v]\nend\n\ndefine respawn all stone blocks\n\n\n\nwhen flag clicked\nset [destroyed? v] to [1]\nforever\n    if <(destroyed?) = [0]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [clear v]\nrespawn all stone blocks\n\nwhen backdrop switches to [backdrop16 v]\nplace stone block at x: [140] y: [-20] size: [75] angle: [-40] level: [16]\n\nwhen flag clicked\nforever\n    set [touchingplayer? v] to <touching (hitbox v)?>\nend\n\n@temporary sprite menu buffer\n\n@temporary sprite menu buffer2\n\n@Hitbox\n\nwhen flag clicked\nset rotation style [left-right v]\ngo to [back v] layer\nset [ghost v] effect to (100)\nshow\nforever\n    switch costume to ([costume name v] of [player v])\n    go to (player v)\n    point in direction ([direction v] of [player v])\nend\n\n