|| The Cave || Platformer ||

Instructions: • Arrow Keys or W, A, S, D to move. \n• R to reset.\n• R to stop glitches\n• Thank you for viewing! Leave a Love and Favorite!!\n\nNOTE: This is a very generic platformer! Please check out my profile for more non-generic platformers. :)

@Stage\n\nwhen flag clicked\nswitch backdrop to (black v)\n\nwhen I receive [start game v]\nstop all sounds\nswitch backdrop to (black v)\n\nwhen I receive [backdrop switch v]\nstop all sounds\nswitch backdrop to (blue v)\nforever\n    play sound [Main Title. v] until done\nend\n\nwhen I receive [stop all! v]\nswitch backdrop to (red v)\n\nwhen I receive [explode v]\nstop [other scripts in sprite v]\nstop all sounds\nwait (1.2) seconds\nplay sound [Explode v] until done\n\nwhen I receive [boss begin! v]\nstop [other scripts in sprite v]\nstop all sounds\nforever\n    play sound [Boss Fight v] until done\nend\n\nwhen I receive [game complete! v]\nswitch backdrop to (black v)\n\nwhen I receive [game complete! v]\nstop [other scripts in sprite v]\nforever\n    set volume to (10) %\n    play sound [Crab Rave v] until done\nend\n\nwhen I receive [sans v]\nswitch backdrop to (sans v)\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nforever\n    set volume to (60) %\n    play sound [Undertale Megolovania v] until done\nend\n\nbroadcast (Game Complete! v)\n\nforever\n    set volume to (0) %\nend\n\nplay sound [Undertale Megolovania v] until done\n\nwhen [g v] key pressed\nif <(Game On?) = [On]> then\n    wait until <key (o v) pressed?>\n    wait until <key (t v) pressed?>\n    wait until <key (o v) pressed?>\n    wait until <key (b v) pressed?>\n    wait until <key (o v) pressed?>\n    wait until <key (s v) pressed?>\n    wait until <key (s v) pressed?>\n    wait until <key (n v) pressed?>\n    wait until <key (o v) pressed?>\n    wait until <key (w v) pressed?>\n    set [level v] to [29]\nend\n\nwhen I receive [start game 1 v]\nset volume to (40) %\nswitch backdrop to (start screen v)\nplay sound [Start Screen Music v] until done\n\n@Player\n\nwhen flag clicked\ngo to [front v] layer\nset size to (30) %\nset [ghost v] effect to (0)\nhide\nset volume to (20) %\ngo to x: (-213) y: (-106)\npoint in direction (90)\nset [x v] to [0]\nset [y v] to [0]\nset [able to jump left? v] to [0]\nset [able to jump right? v] to [0]\nforever\n    if <(Game On?) = [On]> then\n        change x by (X)\n        change y by (Y)\n    else\n        set [x v] to [0]\n        set [y v] to [0]\n        set [able to jump left? v] to [0]\n        set [able to jump right? v] to [0]\n    end\nend\n\ndefine Jump\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    if <<touching (platforms v)?> or <<(Able to Jump Right?) = [Yes]> or <(Able to Jump Left?) = [Yes]>>> then\n        set [y v] to [12]\n    end\nend\n\ndefine Gravity\nif <not <touching (platforms v)?>> then\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        change [y v] by (-0.8)\n    else\n        change [y v] by (-1)\n    end\nend\n\ndefine Left/Right Move\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x v] by (-1.3)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x v] by (1.3)\nend\nif <<(X) > [-0.2]> and <(X) < [0.2]>> then\n    set [x v] to [0]\nelse\n    set [x v] to ((X) * (0.9))\nend\nif <(X) > [10]> then\n    set [x v] to [10]\nend\nif <(X) < [-10]> then\n    set [x v] to [-10]\nend\n\ndefine Don't Sink Into the Ground\nif <touching (platforms v)?> then\n    if <(Y) < [0]> then\n        set [y v] to [0]\n        repeat until <not <touching (platforms v)?>>\n            change y by (1)\n        end\n    end\n    if <(Y) = [0]> then\n        set [y v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Game On?) = [On]> then\n        Left/Right Move\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Game On?) = [On]> then\n        Gravity\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Game On?) = [On]> then\n        Jump\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Game On?) = [On]> then\n        Don't Sink Into the Ground\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Game On?) = [On]> then\n        Kill\n    end\nend\n\ndefine Kill\nif <touching color (#800000)?> then\n    set [game on? v] to [Off]\n    set [ghost v] effect to (0)\n    point in direction (90)\n    repeat (9)\n        turn right (20) degrees\n    end\n    repeat (20)\n        change y by (-5)\n        change [ghost v] effect by (5)\n    end\n    hide\n    wait (0.5) seconds\n    go to x: (-213) y: (-106)\n    point in direction (90)\n    set [ghost v] effect to (0)\n    show\n    set [game on? v] to [On]\nend\n\ndefine Trampoline\nforever\n    if <(Sans) = [0]> then\n        if <not <(Boss Fight) = [On]>> then\n            if <touching color (#8d00ff)?> then\n                set [y v] to [20]\n                start sound [Jump v]\n            end\n        else\n            if <touching color (#8d00ff)?> then\n                broadcast (Powerup! v)\n            end\n        end\n    else\n        if <touching color (#8d00ff)?> then\n            wait (0.5) seconds\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Game On?) = [On]> then\n        Trampoline\n    end\nend\n\nwhen [r v] key pressed\ngo to x: (-213) y: (-106)\n\nwhen flag clicked\nset [sans v] to [0]\nforever\n    if <(Sans) = [0]> then\n        if <touching (flag v)?> then\n            wait (0.6) seconds\n            change [level v] by (1)\n            set [x v] to [0]\n            set [y v] to [0]\n            go to x: (-213) y: (-106)\n            wait (0.5) seconds\n        end\n    else\n        stop [this script v]\n    end\nend\n\nif <(Game On?) = [On]> then\n    show\nelse\n    hide\nend\n\nwhen I receive [backdrop switch v]\nshow\ngo to [front v] layer\n\nwhen I receive [weak spot v]\ngo to x: (-213) y: (-106)\n\nwhen I receive [stop all! v]\nhide\n\nwhen I receive [back to start v]\ngo to x: (-213) y: (-106)\n\nshow\ngo to [front v] layer\n\nwhen I receive [sans v]\ngo to x: (-213) y: (-106)\nset [game on? v] to [Off]\nwait (2) seconds\nset [game on? v] to [On]\n\nset [game on? v] to [On]\n\nwhen I receive [sans v]\ngo to x: (-213) y: (-106)\ngo to [front v] layer\nshow\n\nwhen I receive [game complete! v]\nhide\n\nwhen I receive [game complete! v]\nhide\nstop [other scripts in sprite v]\nhide\nstop [this script v]\n\nset [level v] to [29]\n\n@Platforms\n\nwhen flag clicked\ngo to [front v] layer\nset [level v] to [1]\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\n\nforever\n    if <(Game On?) = [On]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [backdrop switch v]\nshow\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [sans v]\n\nwhen I receive [sans v]\n\nwhen I receive [game complete! v]\nhide\n\nwhen I receive [sans v]\n\n\nwhen I receive [sans 3 v]\n\nwhen I receive [sans change v]\nswitch costume to (sans 2 v)\n\nwhen I receive [sans change 2 v]\nswitch costume to (sans 3 v)\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nset [sans 2 v] to [1]\nset [sans v] to [1]\nshow\nswitch costume to (sans 1 v)\nforever\n    if <(Sans 2) = [2]> then\n        switch costume to (sans v)\n        wait until <(Sans 2) = [3]>\n        switch costume to (sans v)\n        wait until <(Sans 2) = [4]>\n        switch costume to (sans v)\n        wait until <(Sans 2) = [5]>\n        switch costume to (sans v)\n    end\nend\n\nswitch costume to (sans v)\n\nbroadcast (Game Complete! v)\n\nbroadcast (sans change v)\n\nchange [level v] by (1)\n\n@Flag\n\nwhen flag clicked\nswitch costume to (green flag v)\nset [ghost v] effect to (0)\nforever\n    if <(Level) = [1]> then\n        go to x: (218) y: (-102)\n    end\n    if <(Level) = [2]> then\n        go to x: (218) y: (-102)\n    end\n    if <(Level) = [3]> then\n        go to x: (214) y: (125)\n    end\n    if <(Level) = [4]> then\n        go to x: (76) y: (-99)\n    end\n    if <(Level) = [5]> then\n        go to x: (183) y: (142)\n    end\n    if <(Level) = [6]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [7]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [8]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [9]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [10]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [11]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [12]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [13]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [14]> then\n        go to x: (154) y: (-101)\n    end\n    if <(Level) = [15]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [16]> then\n        go to x: (210) y: (130)\n    end\n    if <(Level) = [17]> then\n        go to x: (210) y: (130)\n    end\n    if <(Level) = [18]> then\n        go to x: (164) y: (103)\n    end\n    if <(Level) = [19]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [20]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [21]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [22]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [23]> then\n        go to x: (216) y: (90)\n    end\n    if <(Level) = [24]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [25]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [26]> then\n        go to x: (212) y: (143)\n    end\n    if <(Level) = [27]> then\n        go to x: (211) y: (-101)\n    end\n    if <(Level) = [28]> then\n        go to x: (223) y: (-10)\n    end\n    if <(Level) = [29]> then\n        go to x: (160) y: (108)\n        show\n    end\n    if <(Level) = [30]> then\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\nforever\n    if <(Game On?) = [On]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        set [game on? v] to [Off]\n        broadcast (Next Level v)\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        repeat (20)\n            change [ghost v] effect by (-5)\n        end\n        if <not <(Level) = [30]>> then\n            set [game on? v] to [On]\n        end\n    end\nend\n\nwait (0.5) seconds\n\nwhen I receive [backdrop switch v]\nshow\n\nwhen I receive [next level v]\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nshow\ngo to x: (-6) y: (146)\nwait until <touching (player v)?>\ngo to x: (90) y: (70)\ngo to [back v] layer\nbroadcast (sans change v)\nwait until <touching (player v)?>\ngo to x: (-22) y: (-3)\ngo to [back v] layer\nbroadcast (Sans change 2 v)\nwait until <touching (player v)?>\nhide\nset [x v] to [0]\nset [y v] to [0]\nbroadcast (Game Complete! v) and wait\nstop [this script v]\n\nwhen flag clicked\nforever\n\n@Red/Trampoline\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [backdrop switch v]\nshow\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nbroadcast (If Touching Player... v)\nshow\nswitch costume to (32 v)\nforever\n    if <(Sans 2) = [2]> then\n        switch costume to (sans v)\n        wait until <(Sans 2) = [3]>\n        switch costume to (sans v)\n        wait until <(Sans 2) = [4]>\n        switch costume to (sans v)\n        wait until <(Sans 2) = [5]>\n        switch costume to (sans v)\n    end\nend\n\nwhen I receive [sans change v]\nshow\nswitch costume to (33 v)\n\nwhen I receive [sans change 2 v]\nshow\nswitch costume to (34 v)\n\nswitch costume to (32 v)\n\nwhen I receive [if touching player... v]\nforever\n    if <touching (player v)?> then\n        change [sans 2 v] by (1)\n        hide\n        wait (0.5) seconds\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [game over v]\nswitch costume to (costume2 v)\n\nwhen I receive [end v]\nswitch costume to (costume3 v)\n\n@Sensor Left\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nforever\n    go to (player v)\nend\n\nwhen flag clicked\nforever\n    if <touching (platforms v)?> then\n        set [x v] to [4]\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (platforms v)?> then\n        set [able to jump left? v] to [Yes]\n    else\n        set [able to jump left? v] to [No]\n    end\nend\n\nwhen I receive [stop all! v]\nhide\n\n@Sensor Right\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nforever\n    go to (player v)\nend\n\nwhen flag clicked\nforever\n    if <touching (platforms v)?> then\n        set [x v] to [-4]\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (platforms v)?> then\n        set [able to jump right? v] to [Yes]\n    else\n        set [able to jump right? v] to [No]\n    end\nend\n\nwhen I receive [stop all! v]\nhide\n\n@Sensor Up\n\nwhen flag clicked\nset size to (30) %\nshow\nset [ghost v] effect to (100)\nforever\n    go to (player v)\nend\n\nwhen flag clicked\nforever\n    if <touching (platforms v)?> then\n        set [y v] to [-3]\n    end\nend\n\nwhen I receive [stop all! v]\nhide\n\n@Cutscene 1\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [start game v]\ngo to [front v] layer\nwait (2) seconds\nstart sound [Suspense v]\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (8) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\n@Cutscene 2\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [start game v]\ngo to [front v] layer\nwait (4) seconds\nstart sound [Dun Dun Dunnn v]\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (6) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\n@Cutscene 3\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [start game v]\ngo to [front v] layer\nwait (6) seconds\nstart sound [Clock Ticking v]\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (4) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\n\nset [level v] to [6]\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\n@Cutscene 4\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\n\nwhen I receive [start game v]\ngo to [front v] layer\nwait (8) seconds\nstart sound [Lose v]\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (2) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nset [game on? v] to [On]\nbroadcast (Backdrop Switch v)\n\nwhen I receive [backdrop switch v]\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\n@Play Button\n\nwhen flag clicked\nshow\nhide\nset [game on? v] to [Off]\nset [ghost v] effect to (0)\ngo to x: (0) y: (-100)\n\nwhen this sprite clicked\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (Start Game v)\nhide\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [start game 1 v]\nshow\nset [game on? v] to [Off]\nset [ghost v] effect to (0)\ngo to x: (0) y: (-100)\n\n@White Hider\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nrepeat (30)\n    change [ghost v] effect by (-2.5)\nend\nrepeat (40)\n    change [ghost v] effect by (2.5)\nend\n\nwhen I receive [next level v]\nstart sound [High Whoosh v]\ngo to [front v] layer\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (0.3) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\nwhen I receive [weak spot v]\nif <(Round) = [5]> then\n    go to [front v] layer\n    repeat (20)\n        change [ghost v] effect by (-5)\n    end\n    wait (0.3) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\nend\n\nwhen I receive [explode v]\nset [ghost v] effect to (100)\nshow\nwait (1) seconds\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (0.3) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\nwhen I receive [back to start v]\nset [game on? v] to [Off]\nset [level v] to [29]\ngo to [front v] layer\nset [ghost v] effect to (0)\nshow\nwait (0.3) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nset [ghost v] effect to (100)\nset [game on? v] to [On]\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\nrepeat (2)\n    change [ghost v] effect by (-50)\nend\n\nwhen I receive [start game 1 v]\ngo to x: (0) y: (0)\nshow\ngo to [back v] layer\nset [ghost v] effect to (75)\n\n@Start Screen\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nhide\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [start game 1 v]\ngo to x: (0) y: (70)\nshow\n\n@Twonerds Logo\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nhide\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [start game 1 v]\ngo to x: (-213) y: (-153)\nshow\nset size to (60) %\n\n@Boss\n\nwhen flag clicked\nhide\nset [boss fight v] to [Off]\n\nwhen I receive [next level v]\nwait (0.7) seconds\nif <(Level) = [30]> then\n    show\n    broadcast (Boss Begin! v)\nend\n\nwhen I receive [boss begin! v]\nset [weak spot got? v] to [No]\nset [shot? v] to [No]\nset [round v] to [1]\nset [brightness v] effect to (0)\nset [ghost v] effect to (0)\nset size to (120) %\ngo to x: (100) y: (70)\nset [game on? v] to [Off]\nset [boss fight v] to [On]\nswitch costume to (happy v)\nwait (2.1) seconds\nswitch costume to (text 1 v)\nwait (2) seconds\nswitch costume to (text 2 v)\nwait (2) seconds\nswitch costume to (text 3 v)\nwait (2) seconds\nswitch costume to (text 4 v)\nbroadcast (Shake v)\nwait (4) seconds\nswitch costume to (text 5 v)\nwait (2) seconds\nswitch costume to (text 6 v)\nwait (2) seconds\nswitch costume to (text 7 v)\nwait (2) seconds\nswitch costume to (happy v)\nset [game on? v] to [On]\nbroadcast (Boss Fight Begin! v)\n\nwhen I receive [boss fight begin! v]\nforever\n    switch costume to (happy v)\n    if <(Shot?) = [No]> then\n        broadcast (Boss Shoot v)\n        wait (4) seconds\n    end\n    glide (3) secs to x: (150) y: (70)\n    glide (3) secs to x: (100) y: (70)\nend\n\nset [level v] to [29]\n\nwhen I receive [weak spot v]\nif <(Round) = [5]> then\n    set [game on? v] to [Off]\n    broadcast (Stop All! v)\nelse\n    set [game on? v] to [Off]\n    switch costume to (ouch! v)\n    wait (0.5) seconds\n    set [weak spot got? v] to [Yes]\n    switch costume to (recovery v)\n    stop [other scripts in sprite v]\n    wait (2) seconds\n    glide (1) secs to x: (100) y: (70)\n    set [game on? v] to [On]\n    broadcast (Boss Back v)\n    set [weak spot got? v] to [No]\nend\n\nwhen I receive [boss back v]\nforever\n    switch costume to (happy v)\n    if <(Shot?) = [No]> then\n        broadcast (Boss Shoot v)\n        wait (4) seconds\n    end\n    glide (3) secs to x: (150) y: (70)\n    glide (3) secs to x: (100) y: (70)\nend\n\nwhen I receive [stop all! v]\nhide\nwait (1) seconds\nstop [other scripts in sprite v]\nshow\ngo to x: (0) y: (0)\nswitch costume to (dead v)\nset size to (120) %\nset [ghost v] effect to (0)\nset [brightness v] effect to (0)\npoint in direction (90)\nwait (3) seconds\nbroadcast (Explode v)\nrepeat (40)\n    change [brightness v] effect by (2.5)\n    change size by (5)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (Game Complete! v)\n\nwhen I receive [back to start v]\nstop [other scripts in sprite v]\nhide\n\nwhen I receive [sans v]\nforever\n    stop [other scripts in sprite v]\n    hide\nend\n\n@Cannon 1\n\nwhen flag clicked\nset [ghost v] effect to (0)\npoint in direction (90)\nforever\n    if <(Boss Fight) = [On]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nset [cannons down v] to [1]\nforever\n    go to (boss v)\nend\n\nwhen I receive [shake v]\npoint in direction (90)\nrepeat (11)\n    repeat (5)\n        turn right (2) degrees\n    end\n    repeat (5)\n        turn left (2) degrees\n    end\nend\n\nwhen I receive [cannon down v]\nif <(Cannons Down) = [1]> then\n    point in direction (90)\n    go to (boss v)\n    set [ghost v] effect to (0)\n    repeat (40)\n        change [ghost v] effect by (2.5)\n        change y by (-5)\n    end\n    change [cannons down v] by (1)\nend\n\nwhen I receive [boss begin! v]\nshow\nset [ghost v] effect to (0)\npoint in direction (90)\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [back to start v]\nhide\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\n@Cannon 2\n\nwhen flag clicked\nforever\n    if <(Boss Fight) = [On]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    go to (boss v)\nend\n\nwhen I receive [shake v]\npoint in direction (90)\nrepeat (11)\n    repeat (5)\n        turn right (2) degrees\n    end\n    repeat (5)\n        turn left (2) degrees\n    end\nend\n\nwhen I receive [cannon down v]\nif <(Cannons Down) = [2]> then\n    point in direction (90)\n    go to (boss v)\n    set [ghost v] effect to (0)\n    repeat (40)\n        change [ghost v] effect by (2.5)\n        change y by (-5)\n    end\n    change [cannons down v] by (1)\nend\n\nwhen I receive [boss begin! v]\nshow\nset [ghost v] effect to (0)\npoint in direction (90)\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [back to start v]\nhide\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\n@Cannon 3\n\nwhen flag clicked\nforever\n    if <(Boss Fight) = [On]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    go to (boss v)\nend\n\nwhen I receive [shake v]\npoint in direction (90)\nrepeat (11)\n    repeat (5)\n        turn right (2) degrees\n    end\n    repeat (5)\n        turn left (2) degrees\n    end\nend\n\nwhen I receive [cannon down v]\nif <(Cannons Down) = [3]> then\n    point in direction (90)\n    go to (boss v)\n    set [ghost v] effect to (0)\n    repeat (40)\n        change [ghost v] effect by (2.5)\n        change y by (-5)\n    end\n    change [cannons down v] by (1)\nend\n\nwhen I receive [boss begin! v]\nshow\nset [ghost v] effect to (0)\npoint in direction (90)\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [back to start v]\nhide\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\n@Cannon 4\n\nwhen flag clicked\nforever\n    if <(Boss Fight) = [On]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    go to (boss v)\nend\n\nwhen I receive [shake v]\npoint in direction (90)\nrepeat (11)\n    repeat (5)\n        turn right (2) degrees\n    end\n    repeat (5)\n        turn left (2) degrees\n    end\nend\n\nwhen I receive [cannon down v]\nif <(Cannons Down) = [4]> then\n    point in direction (90)\n    go to (boss v)\n    set [ghost v] effect to (0)\n    repeat (40)\n        change [ghost v] effect by (2.5)\n        change y by (-5)\n    end\n    change [cannons down v] by (1)\nend\n\nwhen I receive [boss begin! v]\nshow\nset [ghost v] effect to (0)\npoint in direction (90)\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [back to start v]\nhide\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\n@Weak Spot\n\nwhen flag clicked\nset [powerup got? v] to [No]\nhide\n\nwhen I receive [powerup! v]\nrepeat until <(Powerup Got?) = [No]>\n    go to x: ([x position v] of [boss v]) y: (18)\nend\nhide\n\nwhen I receive [powerup! v]\nshow\nswitch costume to (regular v)\n\nwhen I receive [powerup! v]\nwait until <touching (player v)?>\nbroadcast (Cannon Down v)\nhide\nset [shot? v] to [No]\nchange [round v] by (1)\nset [clones v] to [Dead]\nbroadcast (Weak Spot v)\n\nwhen I receive [powerup! v]\nset [powerup got? v] to [Yes]\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [back to start v]\nhide\n\nwhen I receive [sans v]\nforever\n    stop [other scripts in sprite v]\n    hide\nend\n\n@Cannonball\n\nwhen I start as a clone\nrepeat until <(Clones) = [Dead]>\n    move (3) steps\nend\ndelete this clone\n\nwhen I start as a clone\nrepeat until <(Clones) = [Dead]>\n    if on edge, bounce\nend\ndelete this clone\n\nwhen I start as a clone\nrepeat until <(Clones) = [Dead]>\n    if <touching (platforms v)?> then\n        turn left (90) degrees\n    end\nend\ndelete this clone\n\nwhen I start as a clone\nrepeat until <(Clones) = [Dead]>\n    if <touching (player v)?> then\n        change [player health v] by (-1)\n        delete this clone\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [boss shoot v]\nshow\nset [shot? v] to [Yes]\nif <(Round) = [1]> then\n    set [clones v] to [Alive]\n    point in direction (-50)\n    go to x: (66) y: (103)\n    create clone of (_myself_ v)\n    point in direction (50)\n    go to x: (146) y: (102)\n    create clone of (_myself_ v)\n    point in direction (120)\n    go to x: (146) y: (27)\n    create clone of (_myself_ v)\n    point in direction (-120)\n    go to x: (66) y: (27)\n    create clone of (_myself_ v)\nend\nif <(Round) = [2]> then\n    set [clones v] to [Alive]\n    point in direction (50)\n    go to x: (146) y: (102)\n    create clone of (_myself_ v)\n    point in direction (120)\n    go to x: (146) y: (27)\n    create clone of (_myself_ v)\n    point in direction (-120)\n    go to x: (66) y: (27)\n    create clone of (_myself_ v)\nend\nif <(Round) = [3]> then\n    set [clones v] to [Alive]\n    point in direction (120)\n    go to x: (146) y: (27)\n    create clone of (_myself_ v)\n    wait (0.5) seconds\n    create clone of (_myself_ v)\n    wait (0.5) seconds\n    point in direction (-120)\n    go to x: (66) y: (27)\n    create clone of (_myself_ v)\n    wait (0.5) seconds\n    create clone of (_myself_ v)\nend\nif <(Round) = [4]> then\n    set [clones v] to [Alive]\n    point in direction (-120)\n    go to x: (66) y: (27)\n    repeat (6)\n        set [ball direction v] to (pick random (1) to (3))\n        if <(Ball Direction) = [1]> then\n            point in direction (-105)\n        end\n        if <(Ball Direction) = [2]> then\n            point in direction (-135)\n        end\n        if <(Ball Direction) = [3]> then\n            point in direction (150)\n        end\n        create clone of (_myself_ v)\n        wait (0.5) seconds\n    end\nend\nhide\n\nchange [round v] by (1)\n\nset [clones v] to [Dead]\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\npoint in direction (0)\nrepeat (10)\n    turn right (-1) degrees\n    create clone of (_myself_ v)\nend\nrepeat (20)\nend\n\nwhen I receive [back to start v]\nhide\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\n@Credits\n\nwhen flag clicked\nhide\n\nwhen I receive [game complete! v]\ngo to x: (0) y: (-408)\nshow\ngo to [front v] layer\nglide (20) secs to x: (0) y: (450)\nbroadcast (End v) and wait\nstop [all v]\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\n@Player Health\n\nwhen flag clicked\ngo to x: (-204) y: (-150)\nset size to (50) %\ngo to [front v] layer\nhide\nforever\n    switch costume to (Player Health)\nend\n\nwhen I receive [boss begin! v]\nshow\ngo to [front v] layer\nset [player health v] to [4]\n\nwhen flag clicked\nforever\n    if <<(Player Health) = [0]> or <(Player Health) < [0]>> then\n        broadcast (Game Over v)\n        stop [all v]\n    end\nend\n\nset [player health v] to [4]\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\n@Boss Health\n\nwhen flag clicked\ngo to x: (107) y: (-150)\nset [player health v] to [4]\nset size to (50) %\ngo to [front v] layer\nhide\nforever\n    switch costume to (((Round) * (-1)) + (5))\nend\n\nwhen I receive [boss begin! v]\ngo to [front v] layer\nshow\n\nwhen I receive [back to start v]\nhide\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen flag clicked\nforever\n    set size to (50) %\nend\n\nwhen I receive [sans v]\nstop [other scripts in sprite v]\nhide\n\n@Sans Ball\n\nwhen I start as a clone\nshow\nrepeat until <(x position) < [-239]>\n    change x by (-5)\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\nset [clones v] to [Dead]\n\nchange [round v] by (1)\n\nset [clones v] to [Dead]\n\nwhen I receive [stop all! v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [back to start v]\nhide\n\nwhen I receive [sans v]\nhide\n\nstop [all v]\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        broadcast (Back to Start v)\n    end\nend\n\nbroadcast (Sans v)\n\nwhen [l v] key pressed\n\nwhen I receive [sans v]\nforever\n    wait (.7) seconds\n    wait (pick random (1) to (3)) seconds\n    set [clones v] to [0]\n    create clone of (_myself_ v)\n    point in direction (-90)\n    go to x: (186) y: (-67)\nend\n\nwhen I receive [sans v]\nforever\n    wait (.5) seconds\n    wait (pick random (1) to (3)) seconds\n    set [clones v] to [0]\n    create clone of (_myself_ v)\n    point in direction (-90)\n    go to x: (186) y: (7)\nend\n\nwhen I receive [sans v]\nforever\n    wait (.6) seconds\n    wait (pick random (1) to (3)) seconds\n    set [clones v] to [0]\n    create clone of (_myself_ v)\n    point in direction (-90)\n    go to x: (186) y: (85)\nend\n\nwhen I receive [game complete! v]\nstop [other scripts in sprite v]\ndelete this clone\n\n\n\nwhen [s v] key pressed\nwait until <key (a v) pressed?>\nwait until <key (n v) pressed?>\nwait until <key (s v) pressed?>\nbroadcast (Sans v)\nset [boss fight v] to [On]\nset [sans v] to [0]\n\n@Intro\n\nwhen flag clicked\nbroadcast (Start Game 1 v)\n\nhide\nswitch costume to (doorway 1 v)\ncreate clone of (_myself_ v)\nswitch costume to (doorway 2 v)\ncreate clone of (_myself_ v)\nif <<(current [date v]) = [1]> and <(current [month v]) = [1]>> then\n    switch costume to (happy new year v)\n    create clone of (_myself_ v)\nend\nif <<(current [date v]) = [14]> and <(current [month v]) = [2]>> then\n    switch costume to (valentines v)\n    create clone of (_myself_ v)\nend\nif <<(current [date v]) = [17]> and <(current [month v]) = [3]>> then\n    switch costume to (st. patricks day v)\n    create clone of (_myself_ v)\nend\nif <<(current [date v]) = [4]> and <(current [month v]) = [7]>> then\n    switch costume to (4th of july v)\n    create clone of (_myself_ v)\nend\nif <<(current [date v]) = [31]> and <(current [month v]) = [10]>> then\n    switch costume to (halloween v)\n    create clone of (_myself_ v)\nend\nif <<<(current [dayofweek v]) = [4]> and <(current [month v]) = [11]>> and <<(current [date v]) > [21]> and <(current [date v]) < [28]>>> then\n    switch costume to (thanksgiving v)\n    create clone of (_myself_ v)\nend\nif <<<(current [date v]) > [9]> and <(current [date v]) < [19]>> and <(current [month v]) = [12]>> then\n    switch costume to (hannukah v)\n    create clone of (_myself_ v)\nend\nif <<(current [date v]) = [25]> and <(current [month v]) = [12]>> then\n    switch costume to (christmas v)\n    create clone of (_myself_ v)\nend\nif <<<<not <<(current [date v]) = [1]> and <(current [month v]) = [1]>>> and <not <<(current [date v]) = [14]> and <(current [month v]) = [2]>>>> and <<not <<(current [date v]) = [17]> and <(current [month v]) = [3]>>> and <not <<(current [date v]) = [4]> and <(current [month v]) = [7]>>>>> and <<<not <<(current [date v]) = [31]> and <(current [month v]) = [10]>>> and <not <<<(current [dayofweek v]) = [4]> and <(current [month v]) = [11]>> and <<(current [date v]) > [21]> and <(current [date v]) < [28]>>>>> and <<not <<<(current [date v]) > [9]> and <(current [date v]) < [19]>> and <(current [month v]) = [12]>>> and <not <<(current [date v]) = [25]> and <(current [month v]) = [12]>>>>>> then\n    switch costume to (logo v)\n    create clone of (_myself_ v)\nend\nswitch costume to (text v)\ncreate clone of (_myself_ v)\nstart sound [Intro Sound v]\nset volume to (100) %\nwait (4) seconds\nrepeat (100)\n    change volume by (-1)\nend\nstop all sounds\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (0)\nif <<(costume [number v]) = [1]> or <<(costume [number v]) > [4]> and <(costume [number v]) < [13]>>> then\n    point in direction (90)\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    set [brightness v] effect to (0)\n    set size to (100) %\n    repeat (20)\n        change size by (25)\n        change [ghost v] effect by (-5)\n    end\n    repeat (10)\n        change [brightness v] effect by (10)\n    end\n    repeat (10)\n        change [brightness v] effect by (-10)\n    end\n    repeat (10)\n        change y by (2)\n    end\n    wait (2) seconds\n    repeat (10)\n        change y by (-2)\n    end\n    wait (1) seconds\n    hide\n    delete this clone\nend\nif <(costume [number v]) = [2]> then\n    point in direction (80)\n    go to [front v] layer\n    go to x: (0) y: (0)\n    glide (1) secs to x: (-300) y: (0)\n    hide\n    wait (3) seconds\n    show\n    glide (1) secs to x: (0) y: (0)\n    wait (0.5) seconds\n    glide (1) secs to x: (-300) y: (0)\n    hide\n    delete this clone\nend\nif <(costume [number v]) = [3]> then\n    point in direction (80)\n    go to [front v] layer\n    go to x: (0) y: (0)\n    glide (1) secs to x: (300) y: (0)\n    hide\n    wait (3) seconds\n    show\n    glide (1) secs to x: (0) y: (0)\n    wait (0.5) seconds\n    glide (1) secs to x: (300) y: (0)\n    hide\n    delete this clone\nend\nif <(costume [number v]) = [4]> then\n    hide\n    wait (1.5) seconds\n    change [ghost v] effect by (100)\n    show\n    set size to (200) %\n    point in direction (90)\n    go to [front v] layer\n    go to x: (-300) y: (-140)\n    repeat (12)\n        change x by (20)\n        change [ghost v] effect by (-12.5)\n    end\n    repeat (50)\n        change x by (2.5)\n    end\n    repeat (12)\n        change x by (20)\n        change [ghost v] effect by (12.5)\n    end\n    hide\n    delete this clone\nend\n\nwhen flag clicked\n\nwait (5.5) seconds\nbroadcast (Start Game 1 v)\n\n