Spooky Scary Platformer

Instructions: ***************************************************************\n**WARNING!!  This game may be too scary for some!**\n**   DO NOT PLAY if you are 15 or younger please.    **\n***************************************************************\nRight Arrow or 'D' = Go Right\nLeft Arrow or 'A = Go Left\nUp Arrow or 'W' or Spacebar = Jump\nDown Arrow or 'S' = Run (with movement keys)\n\nGoal: You got lost trick-or-treating and you must find your way home.\n\nDON'T GET SCARED TO DEATH!\n - If you see something spooky, your hair will poof up.  DON'T MOVE!  If you move while your hair is poofed up your heart will beat faster and reality twists.  Your health will go down if your heart beats too fast.  As your health gets lower, Death will get closer to you.\n - Find and eat candy if you need to heal.\n - Some spooky things will scare you if they touch you.\n - Running will make your heart beat faster too!\n - 13 Scary levels of intense fun!

@Stage\n\nwhen flag clicked\nforever\n    if <(Scared Meter) > [25]> then\n        set [fisheye v] effect to ((-25) + (Scared Meter))\n    else\n        set [fisheye v] effect to (0)\n    end\n    if <(Lightning On) = [1]> then\n        set [brightness v] effect to (40)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    switch backdrop to (Level)\nend\n\n@LOGIC\n\nwhen flag clicked\nwait (0.5) seconds\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nshow\nset [all resets v] to [2]\nset [you health v] to [100]\nset [scared meter v] to [0]\nset [spooked v] to [1]\nset [spooking v] to [0]\nset [lightning on v] to [0]\nset [reset v] to (All Resets)\nset [level v] to [1]\nbroadcast (Pause v) and wait\nbroadcast (Reset All v)\n\nwhen I receive [reset all v]\nset [reset v] to (All Resets)\nbroadcast (ChangeLevel v)\nbroadcast (Reset YOU v)\n\nwhen I receive [died v]\nset [you health v] to [100]\nset [scared meter v] to [0]\nset [spooked v] to [1]\nset [reset v] to (All Resets)\nstart sound [Scream1 v]\nwait (0.1) seconds\nstart sound [Scream2 v]\nswitch costume to (2 v)\nset [paused v] to [1]\nwait until <mouse down?>\nset [paused v] to [0]\nswitch costume to (1 v)\nbroadcast (Reset All v)\n\nwhen I receive [pause v]\nset [paused v] to [1]\nswitch costume to (3 v)\ngo to [front v] layer\nwait until <mouse down?>\nswitch costume to (1 v)\nset [paused v] to [0]\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@YOU\n\nwhen flag clicked\nforever\n    if <(Scared Meter) > [25]> then\n        set [fisheye v] effect to ((-25) + ((Scared Meter) / (2)))\n    else\n        set [fisheye v] effect to (0)\n    end\nend\n\ndefine YOU Reset to (x) (y) Size (size) Color (color)\ngo to x: (x) y: (y)\nset size to (size) %\nset [color v] effect to (color)\nset [sizeyou v] to (size)\nset [coloryou v] to (color)\nset [x v] to [0]\nset [y v] to [0]\nset [you xmoved v] to [0]\nset [youxpos5 v] to (x position)\nset [youxpos4 v] to (x position)\nset [youxpos3 v] to (x position)\nset [youxpos2 v] to (x position)\nset [youypos5 v] to (y position)\nset [youypos4 v] to (y position)\nset [youypos3 v] to (y position)\nset [youypos2 v] to (y position)\n\nwhen flag clicked\nforever\n    if <<(Reset) < [1]> and <(Paused) = [0]>> then\n        Moving\n    end\n    switch costume to (Spooked)\nend\n\ndefine Moving\nchange [y v] by (-1)\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    if <<key (down arrow v) pressed?> or <<key (s v) pressed?> or <key (r v) pressed?>>> then\n        change [x v] by (-3)\n        change [scared meter v] by (1)\n    else\n        change [x v] by (-1.5)\n    end\n    set [you facing v] to [LEFT]\n    point in direction (-90)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    if <<key (down arrow v) pressed?> or <<key (s v) pressed?> or <key (r v) pressed?>>> then\n        change [x v] by (3)\n        change [scared meter v] by (1)\n    else\n        change [x v] by (1.5)\n    end\n    set [you facing v] to [RIGHT]\n    point in direction (90)\nend\nset [x v] to (((x) * (0.6)) + (YOU xMoved))\nchange x by (x)\nTest Collisions [0] [0]\nif <(YOU Collision Tested) = [1]> then\n    change y by (1)\nend\nTest Collisions [0] [0]\nif <(YOU Collision Tested) = [1]> then\n    change y by (1)\nend\nTest Collisions [0] [0]\nif <(YOU Collision Tested) = [1]> then\n    change y by (1)\nend\nTest Collisions [0] [0]\nif <(YOU Collision Tested) = [1]> then\n    change y by (1)\nend\nTest Collisions [0] [0]\nif <(YOU Collision Tested) = [1]> then\n    change y by (-4)\n    change x by ((x) * (-1))\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> then\n        set [y v] to [4]\n        if <(x) > [0]> then\n            set [x v] to [-5]\n        else\n            set [x v] to [5]\n        end\n    else\n        set [x v] to [0]\n    end\nend\nchange y by (y)\nTest Collisions [0] [0]\nif <(YOU Collision Tested) = [1]> then\n    change y by ((y) - ((y) * (2)))\n    set [y v] to [0]\nend\nchange y by (-1)\nTest Collisions [0] [0]\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> and <(YOU Collision Tested) = [1]>> then\n    set [y v] to [9]\nend\nchange y by (1)\nTest Fatal Collision\nif <(x position) > [240]> then\n    change [level v] by (1)\n    broadcast (Reset All v)\nend\n\ndefine Test Collisions (min) (max)\nset [you collision tested v] to [0]\nif <touching (ground v)?> then\n    set [you collision tested v] to [1]\nend\n\nwhen flag clicked\nset [you facing v] to [RIGHT]\nset [tail wag counter v] to [1]\nset [tail y dir 2 v] to [1]\nset [tail y dir 3 v] to [2]\nset [tail y dir 4 v] to [3]\nset [tail y dir 5 v] to [4]\nforever\n    if <<(x) = [0]> and <(y) = [0]>> then\n        WagTail\n        wait (0.05) seconds\n    else\n        set x tails\n        set [youypos5 v] to (YOUyPOS4)\n        set [youypos4 v] to (YOUyPOS3)\n        set [youypos3 v] to (YOUyPOS2)\n        set [youypos2 v] to (YOUyPos)\n        set [youxpos v] to (x position)\n        set [youypos v] to (y position)\n    end\n    if <<(x) < [0.05]> and <(x) > [-0.05]>> then\n        set [x v] to [0]\n    end\nend\n\nwhen I receive [reset you v]\nhide\nYOU Reset to [-200] [-110] Size [100] Color [0]\nif <(Level) = [5]> then\n    YOU Reset to [-215] [135] Size [100] Color [0]\nend\nif <(Level) = [6]> then\n    YOU Reset to [-220] [21] Size [100] Color [0]\nend\nif <(Level) = [7]> then\n    YOU Reset to [-220] [-129] Size [100] Color [0]\nend\nif <(Level) = [8]> then\n    YOU Reset to [-215] [135] Size [100] Color [0]\nend\nif <(Level) = [10]> then\n    YOU Reset to [-215] [-90] Size [100] Color [0]\nend\nchange [reset v] by (-1)\nif <(Level) < [15]> then\n    show\nend\nif <(Level) = [1]> then\n    broadcast (Speak v)\nend\nif <(Level) = [12]> then\n    broadcast (Speak v)\nend\nif <(Level) = [14]> then\n    broadcast (Speak v)\nend\nset x tails\n\ndefine Test Fatal Collision\nif <touching (fatal objects v)?> then\n    set [youdamaged v] to [-5]\nend\n\nwhen flag clicked\nforever\n    if <(Scared Meter) > [0]> then\n        change [scared meter v] by (-0.4)\n    end\n    if <(Spooking) > [0]> then\n        set [brightness v] effect to (10)\n        set [spooked v] to [2]\n    else\n        set [brightness v] effect to (0)\n        set [spooked v] to [1]\n    end\nend\n\ndefine WagTail\nchange [tail wag counter v] by (1)\nif <(Tail Wag Counter) > [5]> then\n    set [tail wag counter v] to [2]\nend\nif <(Tail Wag Counter) = [2]> then\n    set [tail y dir 2 v] to ((Tail Y Dir 2) * (-1))\nend\nif <(Tail Wag Counter) = [3]> then\n    set [tail y dir 3 v] to ((Tail Y Dir 3) * (-1))\nend\nif <(Tail Wag Counter) = [4]> then\n    set [tail y dir 4 v] to ((Tail Y Dir 4) * (-1))\nend\nif <(Tail Wag Counter) = [5]> then\n    set [tail y dir 5 v] to ((Tail Y Dir 5) * (-1))\nend\nchange [youypos2 v] by (Tail Y Dir 2)\nchange [youypos3 v] by (Tail Y Dir 3)\nchange [youypos4 v] by (Tail Y Dir 4)\nchange [youypos5 v] by (Tail Y Dir 5)\n\ndefine set x tails\nif <(YOU Facing) = [RIGHT]> then\n    set [youxpos5 v] to ((YOUxPOS4) - (4))\n    set [youxpos4 v] to ((YOUxPOS3) - (4))\n    set [youxpos3 v] to ((YOUxPOS2) - (4))\n    set [youxpos2 v] to ((YOUxPos) - (10))\nelse\n    set [youxpos5 v] to ((YOUxPOS4) + (4))\n    set [youxpos4 v] to ((YOUxPOS3) + (4))\n    set [youxpos3 v] to ((YOUxPOS2) + (4))\n    set [youxpos2 v] to ((YOUxPos) + (10))\nend\n\nwhen flag clicked\nforever\n    if <(Paused) = [0]> then\n        if <not <(YouDamaged) = [0]>> then\n            change [you health v] by (YouDamaged)\n            set [y v] to [10]\n            start sound [Scream2 v]\n            set [brightness v] effect to (50)\n            wait (0.5) seconds\n            set [brightness v] effect to (0)\n            wait (0.5) seconds\n            set [youdamaged v] to [0]\n        end\n    end\nend\n\nwhen I receive [speak v]\nwait (2) seconds\nif <(Level) = [1]> then\n    say [I have to get back home!] for (3) seconds\nend\nif <(Level) = [12]> then\n    say [Almost there!] for (3) seconds\nend\nif <(Level) = [14]> then\n    say [My House!  I made it!] for (3) seconds\nend\n\nif <touching (mouse-pointer v)?> then\n    set [y v] to [15]\nend\n\n@TAIL FOLLOW\n\nwhen flag clicked\nhide\nset [tail id v] to [2]\ncreate clone of (_myself_ v)\nwait (0.5) seconds\nset [tail id v] to [3]\ncreate clone of (_myself_ v)\nwait (0.5) seconds\nset [tail id v] to [4]\ncreate clone of (_myself_ v)\nwait (0.5) seconds\nset [tail id v] to [5]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nset [mytailid v] to (Tail ID)\nshow\nforever\n    if <(MyTailID) = [2]> then\n        go to x: (YOUxPOS2) y: (YOUyPOS2)\n    end\n    if <(MyTailID) = [3]> then\n        go to x: (YOUxPOS3) y: (YOUyPOS3)\n    end\n    if <(MyTailID) = [4]> then\n        go to x: (YOUxPOS4) y: (YOUyPOS4)\n    end\n    if <(MyTailID) = [5]> then\n        go to x: (YOUxPOS5) y: (YOUyPOS5)\n    end\n    if <(Level) > [13]> then\n        hide\n    else\n        show\n    end\nend\n\ngo to [front v] layer\n\nset [spooked v] to [2]\nwait (1) seconds\nset [spooked v] to [1]\n\nwhen I start as a clone\nwait (0.5) seconds\nif <(MyTailID) = [2]> then\n    set size to (100) %\nend\nif <(MyTailID) = [3]> then\n    set size to (115) %\nend\nif <(MyTailID) = [4]> then\n    set size to (130) %\nend\nif <(MyTailID) = [5]> then\n    set size to (145) %\nend\nforever\n    if <not <(Spooked) = [1]>> then\n        change size by (60)\n        wait (1) seconds\n        change size by (-60)\n    end\nend\n\n@GROUND\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nforever\n    if <(Scared Meter) > [25]> then\n        set [pixelate v] effect to ((-25) + ((Scared Meter) / (2)))\n    else\n        set [pixelate v] effect to (0)\n    end\n    if <(Lightning On) = [1]> then\n        set [brightness v] effect to (40)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [changelevel v]\nset [spooking v] to [0]\nif <(Level) = [1]> then\n    Place Grass [-170] [-148] [8] [32] [0]\n    Place Grass [175] [-148] [3] [32] [0]\n    Place Slenderman [172] [-69]\n    Place Ghostly1 [-141] [-68]\nend\nif <(Level) = [2]> then\n    Place Grass [-230] [-150] [3] [30] [0]\n    Place Grass [100] [-150] [5] [30] [0]\n    Place Slenderman [-115] [-58]\n    Place Wolf Eyes [120] [-40]\nend\nif <(Level) = [3]> then\n    Place Grass [-230] [-145] [8] [30] [-2]\n    Place Grass [30] [-150] [4] [30] [-2]\n    Place Grass [200] [-150] [2] [30] [0]\n    Place Ghostly1 [120] [-80]\n    Place Lighning Flash [1]\n    Place Candy [41] [-151]\nend\nif <(Level) = [4]> then\n    Place Grass [-230] [-145] [5] [30] [0]\n    Place Statue Scare [135] [61]\n    Place Spider Legs 1\nend\nif <(Level) = [5]> then\n    Place Bone Head [-13] [-58]\n    Place Bone Head [202] [-102]\n    Place Bone Head [194] [33]\n    Place Bone Head [-197] [-147]\n    Place Candy [11] [111]\n    create clone of (banshee v)\nend\nif <(Level) = [6]> then\n    Place Spider Drop [-22] [137] [100]\n    Place Rat [-69] [-143] [100] [200]\n    Place Rat [-69] [-143] [100] [200]\nend\nif <(Level) = [7]> then\n    Place Spider Drop [220] [45] [20]\n    Place Rat [-154] [-143] [70] [145]\n    Place Rat [81] [-143] [70] [150]\n    Place Mirror [-75] [-2]\n    Place Candy [-215] [-40]\nend\nif <(Level) = [8]> then\n    Place Shadow Girl [-128] [-130]\n    Place Rat [-154] [-143] [50] [200]\n    Place Rat [-154] [-143] [50] [300]\n    create clone of (rocking chair v)\nend\nif <(Level) = [9]> then\n    Place Rat [-109] [120] [50] [200]\n    Place Rat [-109] [120] [50] [200]\n    Place Statue Scare [-28] [-141]\n    Place Candy [217] [-32]\n    create clone of (window figure v)\n    create clone of (banshee v)\nend\nif <(Level) = [10]> then\n    Place Grass [-210] [-152] [15] [32] [0]\n    Place Rat [-163] [-143] [70] [350]\n    Place Rat [-163] [-143] [50] [350]\n    Place Rat [-163] [-143] [100] [400]\n    Place Lighning Flash [1]\n    Place Shadow Girl [-128] [-130]\n    create clone of (banshee v)\nend\nif <(Level) = [11]> then\n    Place Grass [-220] [-152] [1] [0] [0]\n    Place Grass [130] [-152] [3] [32] [0]\n    Place Bone Head [-36] [-169]\n    Place Bone Head [12] [-170]\n    Place Wolf Eyes [10] [-22]\n    Place Wolf Eyes [91] [-57]\n    Place Candy [116] [-144]\n    create clone of (banshee v)\nend\nif <(Level) = [12]> then\n    Place Grass [-220] [-152] [8] [32] [0]\n    Place Ghostly1 [-67] [-80]\n    Place Slenderman [10] [-74]\n    create clone of (banshee v)\n    create clone of (banshee v)\nend\nif <(Level) = [13]> then\n    Place Grass [-220] [-152] [16] [32] [0]\n    Place Rat [-80] [-143] [100] [290]\n    Place Lighning Flash [1]\n    Place Lighning Flash [1]\n    Place Candy [-138] [-141]\n    create clone of (banshee v)\n    create clone of (banshee v)\n    create clone of (banshee v)\nend\nif <(Level) = [14]> then\n    Place Candy [67] [-139]\n    Place Candy [-30] [-140]\n    Place Grass [-220] [-150] [10] [32] [0]\nend\nchange [reset v] by (-1)\n\ndefine Place Grass (x) (y) (howmany) (xdir) (ydir)\nset [placex v] to (x)\nset [placey v] to (y)\nrepeat (howmany)\n    create clone of (grass v)\n    wait (0) seconds\n    change [placex v] by (xdir)\n    change [placey v] by (ydir)\nend\nwait (0.01) seconds\n\ndefine Place Slenderman (x) (y)\nset [placex v] to (x)\nset [placey v] to (y)\ncreate clone of (slenderman v)\nwait (0.01) seconds\n\ndefine Place Ghostly1 (x) (y)\nset [placex v] to (x)\nset [placey v] to (y)\nset [place costume v] to [3]\ncreate clone of (ghostly1 v)\nset [place costume v] to [1]\ncreate clone of (ghostly1 v)\nwait (0.01) seconds\n\ndefine Place Wolf Eyes (x) (y)\nset [placex v] to (x)\nset [placey v] to (y)\ncreate clone of (wolf eyes v)\nwait (0.01) seconds\n\ndefine Place Lighning Flash (costume)\nset [place costume v] to (costume)\ncreate clone of (lightning flash v)\nwait (0.01) seconds\n\ndefine Place Candy (x) (y)\nset [placex v] to (x)\nset [placey v] to (y)\ncreate clone of (candy v)\nwait (0.01) seconds\n\ndefine Place Statue Scare (x) (y)\nset [placex v] to (x)\nset [placey v] to (y)\ncreate clone of (statue scare v)\nwait (0.01) seconds\n\ndefine Place Spider Legs 1\ncreate clone of (spider legs v)\n\ndefine Place Bone Head (x) (y)\nset [placex v] to (x)\nset [placey v] to (y)\ncreate clone of (bone head v)\nwait (0.01) seconds\n\ndefine Place Spider Drop (x) (y) (size)\nset [placex v] to (x)\nset [placey v] to (y)\nset [place size v] to (size)\ncreate clone of (spider drop v)\nwait (0.01) seconds\n\ndefine Place Rat (x) (y) (size) (range)\nset [placex v] to (x)\nset [placey v] to (y)\nset [place size v] to (size)\nset [place range v] to (range)\ncreate clone of (rat v)\nwait (0.01) seconds\n\ndefine Place Mirror (x) (y)\nset [placex v] to (x)\nset [placey v] to (y)\ncreate clone of (mirror v)\nwait (0.01) seconds\n\ndefine Place Shadow Girl (x) (y)\nset [placex v] to (x)\nset [placey v] to (y)\ncreate clone of (shadow girl v)\nwait (0.01) seconds\n\ngo to x: (0) y: (0)\n\n@FATAL OBJECTS\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@HEART PUMPING\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nforever\n    if <(Paused) = [0]> then\n        set [heartbeat timer v] to ((0.4) - ((Scared Meter) / (250)))\n        wait (HeartBeat Timer) seconds\n        next costume\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Paused) = [0]> then\n        if <(Level) < [14]> then\n            wait ((HeartBeat Timer) * (4)) seconds\n            set volume to ((40) + (Scared Meter)) %\n            set [pitch v] effect to (20)\n            play sound [HeartBeat v] until done\n            set [pitch v] effect to (0)\n            start sound [HeartBeat v]\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Paused) = [0]> then\n        if <(Level) > [13]> then\n            set [scared meter v] to [0]\n            hide\n        else\n            show\n            if <(Scared Meter) > [100]> then\n                change [you health v] by (-1)\n                wait (0.1) seconds\n            end\n            if <(Scared Meter) > [150]> then\n                set [scared meter v] to [150]\n            end\n        end\n        if <(YOU Health) < [1]> then\n            broadcast (Died v)\n        end\n    end\nend\n\n@REAPER\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    next costume\n    wait (0.1) seconds\nend\n\nwhen flag clicked\nset [reaper y dir v] to [1]\nset [reaper y adjust v] to [-3]\nforever\n    repeat (8)\n        change [reaper y adjust v] by (Reaper Y Dir)\n        wait (0.1) seconds\n    end\n    set [reaper y dir v] to ((Reaper Y Dir) * (-1))\nend\n\nwhen flag clicked\nforever\n    go to x: (((YOUxPos) - ((YOU Health) * (4))) - (63)) y: ((YOUyPos) + (Reaper Y Adjust))\n    if <(x position) < [-210]> then\n        hide\n    else\n        show\n        set [ghost v] effect to (YOU Health)\n    end\nend\n\nset [you health v] to [100]\n\n@GRASS\n\nwhen flag clicked\ngo to x: (320) y: (320)\nhide\n\nwhen I start as a clone\ngo to x: (PlaceX) y: (PlaceY)\nshow\nforever\n    if <<<touching (you v)?> or <touching (mouse-pointer v)?>> or <touching (rat v)?>> then\n        repeat (8)\n            next costume\n            wait (0.05) seconds\n        end\n        wait until <not <touching (you v)?>>\n    end\nend\n\ngo to [front v] layer\n\nwhen I receive [changelevel v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(Scared Meter) > [25]> then\n        set [pixelate v] effect to ((-25) + (Scared Meter))\n    else\n        set [pixelate v] effect to (0)\n    end\nend\n\n@SLENDERMAN\n\nwhen flag clicked\ngo to x: (320) y: (320)\nswitch costume to (1 v)\nhide\n\nwhen I start as a clone\nset [my showing v] to [0]\ngo to x: (PlaceX) y: (PlaceY)\ngo to [back v] layer\nshow\nforever\n    if <(Paused) = [0]> then\n        wait (pick random (5) to (10)) seconds\n        start sound [Static v]\n        switch costume to (2 v)\n        change [spooking v] by (1)\n        set [my showing v] to [1]\n        wait (pick random (3) to (6)) seconds\n        set [my showing v] to [0]\n        change [spooking v] by (-1)\n        switch costume to (1 v)\n        wait (6) seconds\n    end\nend\n\nwhen I receive [changelevel v]\ndelete this clone\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(My Showing) = [1]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                change [scared meter v] by (2)\n            end\n        end\n    end\nend\n\ngo to x: (0) y: (0)\nshow\n\n@GHOSTLY1\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(My Showing) = [1]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                change [scared meter v] by (3)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (320)\nhide\n\nwhen I start as a clone\ngo to x: (PlaceX) y: (PlaceY)\nswitch costume to (Place Costume)\nset [ghost v] effect to (100)\nshow\nset rotation style [left-right v]\nforever\n    if <(Paused) = [0]> then\n        set [ghost v] effect to (100)\n        wait (7) seconds\n        change [spooking v] by (1)\n        point in direction (90)\n        start sound [Singer1 v]\n        repeat (10)\n            change [ghost v] effect by (-2)\n            change x by (-2)\n            wait (0.1) seconds\n        end\n        set [my showing v] to [1]\n        repeat (10)\n            change [ghost v] effect by (-3)\n            change x by (-2)\n            wait (0.1) seconds\n        end\n        wait (1) seconds\n        point in direction (-90)\n        repeat (10)\n            change [ghost v] effect by (5)\n            change x by (4)\n            wait (0.1) seconds\n        end\n        set [my showing v] to [0]\n        change [spooking v] by (-1)\n    end\nend\n\nwhen I start as a clone\nset [my showing v] to [0]\nforever\n    if <(Paused) = [0]> then\n        next costume\n        wait (0.1) seconds\n    end\nend\n\nwhen I receive [changelevel v]\ndelete this clone\n\nset [ghost v] effect to (0)\nshow\ngo to x: (0) y: (0)\n\n@WOLF EYES\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(My Showing) = [1]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                change [scared meter v] by (2)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [my showing v] to [0]\ngo to x: (320) y: (320)\nhide\n\nwhen I start as a clone\ngo to x: (PlaceX) y: (PlaceY)\nswitch costume to (1 v)\nshow\nforever\n    if <(Paused) = [0]> then\n        wait (pick random (5) to (10)) seconds\n        change [spooking v] by (1)\n        set [my showing v] to [1]\n        broadcast (Wolf Howl v)\n        repeat (20)\n            next costume\n            wait (0.3) seconds\n        end\n        set [my showing v] to [0]\n        change [spooking v] by (-1)\n        wait (3) seconds\n    end\nend\n\nwhen I receive [changelevel v]\ndelete this clone\n\nwhen I receive [wolf howl v]\nrepeat (3)\n    set [pitch v] effect to (pick random (-20) to (30))\n    start sound [Wolf 1 v]\n    wait (pick random (0.4) to (0.8)) seconds\n    set [pitch v] effect to (pick random (-20) to (30))\n    start sound [Wolf 2 v]\n    wait (pick random (0.2) to (0.5)) seconds\nend\n\ngo to x: (0) y: (0)\nshow\n\n@LIGHTNING FLASH\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(My Showing) = [1]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                change [scared meter v] by (4)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nswitch costume to (1 v)\nhide\n\nwhen I start as a clone\ngo to x: (0) y: (0)\nswitch costume to (Place Costume)\ngo to [back v] layer\nhide\nif <(Place Costume) = [1]> then\n    set [ghost v] effect to (70)\nend\nforever\n    if <(Paused) = [0]> then\n        wait (pick random (6) to (10)) seconds\n        change [spooking v] by (1)\n        wait (0.5) seconds\n        set [lightning on v] to [1]\n        set [my showing v] to [1]\n        start sound [Thunder v]\n        repeat (pick random (3) to (5))\n            set [lightning on v] to [1]\n            show\n            wait (0.05) seconds\n            set [lightning on v] to [0]\n            hide\n            wait (pick random (0.1) to (0.3)) seconds\n        end\n        set [my showing v] to [0]\n        set [lightning on v] to [0]\n        change [spooking v] by (-1)\n    end\nend\n\nwhen I receive [changelevel v]\nset [lightning on v] to [0]\ndelete this clone\n\ngo to x: (0) y: (0)\nshow\n\n@CANDY\n\nwhen flag clicked\ngo to x: (320) y: (320)\nswitch costume to (1 v)\nhide\n\nwhen I start as a clone\ngo to x: (PlaceX) y: (PlaceY)\nset [my costume v] to [1]\nshow\nforever\n    if <(Paused) = [0]> then\n        if <<touching (you v)?> and <(My Costume) < [14]>> then\n            if <(YOU Health) < [100]> then\n                start sound [Bite v]\n                change [you health v] by (5)\n                change [my costume v] by (1)\n                wait (0.4) seconds\n            else\n                if <(YOU Health) > [100]> then\n                    set [you health v] to [100]\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [changelevel v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    switch costume to (My Costume)\nend\n\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nshow\n\nwhen I start as a clone\nforever\n    if <(Level) = [14]> then\n        if <(My Costume) > [13]> then\n            wait (5) seconds\n            set [ghost v] effect to (100)\n            set [my costume v] to [1]\n            repeat (50)\n                change [ghost v] effect by (-2)\n                wait (0.1) seconds\n            end\n        end\n    end\nend\n\n@STATUE SCARE\n\nwhen I start as a clone\nset [my showing v] to [0]\ngo to x: (PlaceX) y: (PlaceY)\ngo to [back v] layer\nshow\nforever\n    if <(Paused) = [0]> then\n        wait (pick random (5) to (12)) seconds\n        switch costume to (2 v)\n        change [spooking v] by (1)\n        set [my showing v] to [1]\n        start sound [ScreamOldSchool v]\n        wait (pick random (3) to (6)) seconds\n        set [my showing v] to [0]\n        change [spooking v] by (-1)\n        switch costume to (1 v)\n        wait (6) seconds\n    end\nend\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(My Showing) = [1]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                change [scared meter v] by (2)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (320)\nswitch costume to (1 v)\nhide\n\nwhen I receive [changelevel v]\ndelete this clone\n\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nshow\n\n@SPIDER LEGS\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(My Showing) = [1]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                change [scared meter v] by (2)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (320)\nswitch costume to (1 v)\nhide\n\nwhen I start as a clone\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nshow\nforever\n    if <(Paused) = [0]> then\n        wait (pick random (3) to (7)) seconds\n        change [spooking v] by (1)\n        set [my showing v] to [1]\n        start sound [Bugs v]\n        repeat (13)\n            next costume\n            wait (0.1) seconds\n        end\n        wait (1) seconds\n        repeat (11)\n            next costume\n            wait (0.1) seconds\n        end\n        switch costume to (1 v)\n        set [my showing v] to [0]\n        change [spooking v] by (-1)\n        wait (2) seconds\n    end\nend\n\nwhen I receive [changelevel v]\ndelete this clone\n\n@BONE HEAD\n\nwhen flag clicked\ngo to x: (320) y: (320)\nswitch costume to (1 v)\nhide\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(My Showing) = [1]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                change [scared meter v] by (1)\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nset [my showing v] to [0]\ngo to x: (PlaceX) y: (PlaceY)\nshow\nwait (3) seconds\nforever\n    if <(Paused) = [0]> then\n        wait (pick random (5) to (10)) seconds\n        change [spooking v] by (1)\n        set [my showing v] to [1]\n        set [pitch v] effect to ((pick random (-3) to (3)) * (20))\n        start sound [MaleLaugh v]\n        repeat (12)\n            wait (0.3) seconds\n            next costume\n        end\n        switch costume to (1 v)\n        set [my showing v] to [0]\n        change [spooking v] by (-1)\n        wait (5) seconds\n    end\nend\n\nwhen I receive [changelevel v]\ndelete this clone\n\ngo to x: (0) y: (0)\nshow\n\n@BANSHEE\n\nwhen flag clicked\ngo to x: (320) y: (320)\nhide\n\nwhen I start as a clone\nset [my showing v] to [0]\nset [banshee counter v] to [0]\nwait (pick random (1) to (3)) seconds\nforever\n    if <(Paused) = [0]> then\n        set [ghost v] effect to (100)\n        wait (pick random (5) to (9)) seconds\n        if <(pick random (1) to (2)) = [1]> then\n            go to x: ((YOUxPos) - ((pick random (5) to (7)) * (30))) y: ((YOUyPos) + (pick random (-20) to (20)))\n        else\n            go to x: ((YOUxPos) + ((pick random (5) to (7)) * (30))) y: ((YOUyPos) + (pick random (-20) to (20)))\n        end\n        show\n        set [banshee counter v] to (pick random (10) to (30))\n        set [my showing v] to [1]\n        start sound [Banshee v]\n        repeat (Banshee Counter)\n            change [ghost v] effect by (((100) / (Banshee Counter)) * (-1))\n            move (8) steps\n            wait (0.2) seconds\n        end\n        repeat (Banshee Counter)\n            change [ghost v] effect by ((100) / (Banshee Counter))\n            wait (0.03) seconds\n        end\n        set [my showing v] to [0]\n    end\nend\n\nswitch costume to (1 v)\n\nwhen I receive [changelevel v]\ndelete this clone\n\nwhen I start as a clone\nset rotation style [left-right v]\nforever\n    point towards (you v)\nend\n\nwhen I start as a clone\nforever\n    if <(Paused) = [0]> then\n        if <<(My Showing) = [1]> and <touching (you v)?>> then\n            change [scared meter v] by (50)\n            hide\n            go to x: (320) y: (320)\n            play sound [FemaleScream v] until done\n        end\n    end\nend\n\n@SPIDER DROP\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(My Showing) = [1]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                change [scared meter v] by (2)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (320)\nswitch costume to (1 v)\nhide\n\nwhen I receive [changelevel v]\ndelete this clone\n\nwhen I start as a clone\ngo to x: (PlaceX) y: (PlaceY)\nset [my size v] to (Place Size)\nset size to (My Size) %\nset [my showing v] to [0]\nforever\n    if <(Paused) = [0]> then\n        wait (pick random (4) to (8)) seconds\n        change [spooking v] by (1)\n        set [my showing v] to [1]\n        switch costume to (1 v)\n        show\n        start sound [Bugs v]\n        repeat (9)\n            next costume\n            wait (0.3) seconds\n        end\n        wait (0.5) seconds\n        repeat (6)\n            next costume\n            wait (0.1) seconds\n        end\n        hide\n        set [my showing v] to [0]\n        change [spooking v] by (-1)\n        if <<(Level) = [7]> and <(YOUyPos) < [150]>> then\n            wait (8) seconds\n        end\n    end\nend\n\ngo to x: (0) y: (0)\nswitch costume to (2 v)\nshow\n\n@RAT\n\nwhen I start as a clone\nforever\n    if <(Paused) = [0]> then\n        if <touching (you v)?> then\n            change [scared meter v] by (30)\n            start sound [Scream2 v]\n            wait (1) seconds\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (320)\nhide\n\nwhen I start as a clone\nset rotation style [left-right v]\ngo to x: (PlaceX) y: (PlaceY)\nset [my rat size v] to (Place Size)\nset [rat x start v] to (PlaceX)\nset [my rat range v] to (Place Range)\nset size to (My Rat Size) %\ngo to [back v] layer\nswitch costume to (1 v)\nshow\nset [ratxdir v] to [1]\nforever\n    if <(Paused) = [0]> then\n        change x by ((RATxDIR) * (pick random (8) to (12)))\n        if <(RATxDIR) = [1]> then\n            if <(x position) > ((RAT x Start) + (My Rat Range))> then\n                set x to ((RAT x Start) + (My Rat Range))\n                set [ratxdir v] to [-1]\n            end\n        else\n            if <(x position) < (RAT x Start)> then\n                set x to (RAT x Start)\n                set [ratxdir v] to [1]\n            end\n        end\n        if <(pick random (1) to (25)) = [1]> then\n            switch costume to (2 v)\n            wait (pick random (1) to (2)) seconds\n            switch costume to (1 v)\n        end\n        wait (0.01) seconds\n    end\nend\n\nwhen I receive [changelevel v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(RATxDIR) = [1]> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(Paused) = [0]> then\n        if <(pick random (1) to (30)) = [1]> then\n            start sound [Rat v]\n        end\n    end\nend\n\ngo to x: (0) y: (0)\nshow\n\n@MIRROR\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(My Showing) = [1]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                change [scared meter v] by (2)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (320)\nhide\n\nwhen I start as a clone\ngo to x: (PlaceX) y: (PlaceY)\nswitch costume to (1 v)\nshow\nset [my showing v] to [0]\nforever\n    if <(Paused) = [0]> then\n        wait (pick random (9) to (13)) seconds\n        change [spooking v] by (1)\n        set [my showing v] to [1]\n        if <(pick random (1) to (2)) = [1]> then\n            start sound [CryingGirl v]\n            switch costume to (2 v)\n            wait (2) seconds\n        else\n            start sound [ScaryScreem v]\n            switch costume to (3 v)\n        end\n        wait (3) seconds\n        switch costume to (1 v)\n        set [my showing v] to [0]\n        change [spooking v] by (-1)\n    end\nend\n\nwhen I receive [changelevel v]\ndelete this clone\n\n@SHADOW GIRL\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(My Showing) = [1]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                change [scared meter v] by (2)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (320) y: (320)\nswitch costume to (1 v)\nhide\n\nwhen I receive [changelevel v]\ndelete this clone\n\nwhen I start as a clone\ngo to x: (PlaceX) y: (PlaceY)\nset [my speed v] to [0.08]\nset rotation style [left-right v]\nset [ghost v] effect to (50)\nhide\nset [my showing v] to [0]\nforever\n    if <(Paused) = [0]> then\n        wait (pick random (8) to (15)) seconds\n        change [spooking v] by (1)\n        set [my showing v] to [1]\n        Run Back and Forth\n        point in direction (90)\n        repeat (7)\n            next costume\n        end\n        hide\n        set [my showing v] to [0]\n        change [spooking v] by (-1)\n    end\nend\n\npoint in direction (90)\n\ndefine Run Back and Forth\npoint in direction (90)\nstart sound [BabyLaughing v]\nrepeat (8)\n    show\n    switch costume to (1 v)\n    change x by (15)\n    wait (My Speed) seconds\n    switch costume to (2 v)\n    change x by (15)\n    wait (My Speed) seconds\n    switch costume to (3 v)\n    change x by (15)\n    wait (My Speed) seconds\nend\npoint in direction (-90)\nrepeat (8)\n    show\n    switch costume to (1 v)\n    change x by (-15)\n    wait (My Speed) seconds\n    switch costume to (2 v)\n    change x by (-15)\n    wait (My Speed) seconds\n    switch costume to (3 v)\n    change x by (-15)\n    wait (My Speed) seconds\nend\npoint in direction (90)\nstart sound [BabyLaughing v]\nrepeat (6)\n    show\n    switch costume to (1 v)\n    change x by (15)\n    wait (My Speed) seconds\n    switch costume to (2 v)\n    change x by (15)\n    wait (My Speed) seconds\n    switch costume to (3 v)\n    change x by (15)\n    wait (My Speed) seconds\nend\npoint in direction (-90)\nrepeat (pick random (4) to (8))\n    show\n    switch costume to (1 v)\n    change x by (-15)\n    wait (My Speed) seconds\n    switch costume to (2 v)\n    change x by (-15)\n    wait (My Speed) seconds\n    switch costume to (3 v)\n    change x by (-15)\n    wait (My Speed) seconds\nend\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(pick random (1) to (300)) = [1]> then\n            play sound [BabyCrying v] until done\n        end\n    end\nend\n\n@ROCKING CHAIR\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(My Showing) = [1]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                change [scared meter v] by (2)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nhide\n\nwhen I start as a clone\nset [my showing v] to [0]\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nshow\nwait (4) seconds\nforever\n    if <(Paused) = [0]> then\n        wait (pick random (7) to (10)) seconds\n        change [spooking v] by (1)\n        set [my showing v] to [1]\n        start sound [BabyTalk1 v]\n        repeat (3)\n            switch costume to (2 v)\n            repeat (16)\n                next costume\n                wait (0.1) seconds\n            end\n        end\n        set [my showing v] to [0]\n        change [spooking v] by (-1)\n    end\nend\n\nwhen I receive [changelevel v]\ndelete this clone\n\n@WINDOW FIGURE\n\nwhen I start as a clone\nwait (1) seconds\nforever\n    if <(Paused) = [0]> then\n        if <(My Showing) = [1]> then\n            if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                change [scared meter v] by (3)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I start as a clone\nset [my showing v] to [0]\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nshow\nforever\n    if <(Paused) = [0]> then\n        wait (pick random (8) to (12)) seconds\n        change [spooking v] by (1)\n        set [my showing v] to [1]\n        repeat (3)\n            switch costume to (1 v)\n            repeat (3)\n                start sound [Banging v]\n                next costume\n                wait (0.05) seconds\n            end\n        end\n        start sound [ScaryScreem v]\n        switch costume to (5 v)\n        wait (1) seconds\n        switch costume to (1 v)\n        set [my showing v] to [0]\n        change [spooking v] by (-1)\n    end\nend\n\nwhen I receive [changelevel v]\ndelete this clone\n\n@DOOR\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nhide\nforever\n    if <(Level) = [14]> then\n        show\n    else\n        hide\n    end\n    if <touching (you v)?> then\n        switch costume to (2 v)\n        wait (0.5) seconds\n        set [level v] to [15]\n        broadcast (Reset All v)\n    end\nend\n\nhide\n\n@MUSIC\n\nwhen flag clicked\nstop all sounds\nwait (10) seconds\nforever\n    if <(Level) < [14]> then\n        play sound [ScaryMusic v] until done\n        wait (5) seconds\n        play sound [Tention v] until done\n        wait (5) seconds\n    end\nend\n\nwhen flag clicked\nset [endmusic v] to [0]\nforever\n    if <<(Level) > [13]> and <(EndMusic) = [0]>> then\n        set [endmusic v] to [1]\n        stop all sounds\n        play sound [SweetDreams v] until done\n    end\nend\n\n@LOAD SCREEN\n\nwhen flag clicked\ngo to x: (0) y: (0)\nwait (1) seconds\ngo to [front v] layer\nforever\n    if <(Reset) = [0]> then\n        hide\n    else\n        show\n    end\nend\n\n@SPLASH SCREEN\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\ngo to [front v] layer\nshow\n\n