PRISON ESCAPE <a platformer>
@Stage\n\nwhen I receive [change scene v]\nif <<(Scene#) = [5]> or <(Scene#) = [9]>> then\n    broadcast (CCTV v)\nend\n\nwhen I receive [change scene v]\nif <not <<(Scene#) = [5]> or <(Scene#) = [9]>>> then\n    stop [other scripts in sprite v]\nend\n\n@Blank\n\n@Guy\n\nwhen flag clicked\nshow\npoint in direction (90)\ngo to x: (-220) y: (-70)\npoint in direction (90)\nSet ability\n\nwhen I receive [loop game v]\nforever\n    broadcast (Tick-First v)\n    broadcast (Set Player v)\n    broadcast (Tick-Last v)\n    if <(Wood?) = [1]> then\n        if <key (space v) pressed?> then\n            broadcast (Hit v)\n        end\n    end\nend\n\nwhen I receive [tick-first v]\ngo to [front v] layer\ngo [backward v] (4) layers\nset size to (80) %\nif <(Scene#) > [8]> then\n    set size to (60) %\nend\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\n\nwhen I receive [set player v]\nUp controls\nLeft and Right control\nMOVE (([abs v] of (Speed Y) ) + ([abs v] of (Speed X) ))\nSet Costume\n\nBoom!\n\ndefine Set Costume\nset rotation style [left-right v]\nif <(Wall Slide) > [0]> then\n    switch costume to (hangon01 v)\n    stop [this script v]\nend\nif <(Falling) > [1]> then\n    if <(Speed Y) > [0]> then\n        if <(Wood?) = [1]> then\n            switch costume to (jump2 v)\n        else\n            switch costume to (jump01 v)\n        end\n    else\n        if <(Wood?) = [1]> then\n            switch costume to (run_j3 v)\n        else\n            switch costume to (run_j2 v)\n        end\n    end\n    stop [this script v]\nend\nif <(Frame) = [0]> then\n    if <(Wood?) = [1]> then\n        switch costume to (stand+wood v)\n    else\n        switch costume to (hit angle 0 v)\n        repeat (5)\n            Check Touching Solid\n            if <(touching) < [1]> then\n                switch costume to ((costume [number v]) + (6))\n                stop [this script v]\n            end\n            next costume\n        end\n        switch costume to (stand v)\n    end\nelse\n    if <(Wood?) = [1]> then\n        switch costume to ((17) + ([floor v] of ((Frame) mod (16)) ))\n    else\n        switch costume to ((1) + ([floor v] of ((Frame) mod (16)) ))\n    end\nend\n\ndefine Set Game\nset [scene# v] to [1]\nset [speed y v] to [0]\nset [speed x v] to [0]\nset [jump duration v] to [6]\nset [falling v] to [0]\nbroadcast (Change Scene v)\nbroadcast (Loop Game v)\n\ndefine Up controls\nif <([y v] of [controls v]) > [0]> then\n    if <<(Wall Slide) > [0]> and <(Jumping) = [0]>> then\n        set [falling v] to [3]\n        set [jumping v] to [1]\n        set [wall slide v] to [0]\n        turn right (180) degrees\n        set [speed x v] to (((direction) / (90)) * (7))\n        set [long jump v] to [12]\n    end\n    if <<(Falling) < [3]> and <(Jumping) = [0]>> then\n        set [falling v] to [3]\n        set [jumping v] to [1]\n    end\n    if <<(Jumping) > [0]> and <(Jumping) < (Jump duration)>> then\n        change [jumping v] by (1)\n        set [speed y v] to (Jump power)\n    end\nelse\n    set [jumping v] to [0]\nend\nchange [speed y v] by (Gravity)\nif <(Wall Slide) > [0]> then\n    Check can wall slide\n    if <(Speed Y) < [0]> then\n        set [speed y v] to ((Speed Y) * (0.6))\n    end\nend\n\ndefine Left and Right control\nif <(Long jump) > [0]> then\n    change [long jump v] by (-1)\n    stop [this script v]\nend\nset [key x v] to ([x v] of [controls v])\nif <(KEY X) = [0]> then\n    if <<(Falling) > [2]> and <(Wall Slide) < [1]>> then\n        set [speed x v] to ((Speed X) * (0.96))\n        stop [this script v]\n    end\n    if <([abs v] of (Speed X) ) < [1]> then\n        set [frame v] to [0]\n        set [speed x v] to [0]\n    else\n        change [frame v] by (0.5)\n    end\nelse\n    change [speed x v] by ((KEY X) * (Acceleration))\n    point in direction ((KEY X) * (90))\n    change [frame v] by (1)\nend\nset [speed x v] to ((Speed X) * (Friction))\n\ndefine Begin Scene# (scene) Go to x (x) y (y)\nset [scene# v] to (scene)\nset x to (x)\nset y to (y)\nbroadcast (Change Scene v)\nstop [other scripts in sprite v]\nwait (0) seconds\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\nFix Collisions in direction [0]\nbroadcast (Loop Game v)\n\ndefine MOVE (steps)\nchange [falling v] by (1)\nrepeat (steps)\n    set [last value v] to (x position)\n    change x by ((Speed X) / (steps))\n    Check Touching Solid\n    if <(touching) = [1]> then\n        Collide X- Slope or Wall?\n    end\n    set [last value v] to (y position)\n    change y by ((Speed Y) / (steps))\n    Check Touching Solid\n    if <(touching) = [1]> then\n        Collide Y- Celling or Wall?\n    end\nend\n\ndefine Fix Collisions in direction (dir)\nset [temporary dir v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (128)\n    Check Touching Solid\n    if <(touching) < [1]> then\n        point in direction (temporary dir)\n        stop [this script v]\n    end\n    move (distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\ndefine Check Touching Solid\nif <<<<<touching (level v)?> or <touching (lock v)?>> or <touching (gate v)?>> or <touching (block v)?>> or <touching (crumbled floor v)?>> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nwhen I receive [tick-last v]\nif <(Scene#) = [11]> then\n    if <(y position) > [175]> then\n        Begin Scene# ((Scene#) + (1)) Go to x (x position) y [-174]\n    end\nend\nif <(Scene#) = [12]> then\n    if <(y position) < [-175]> then\n        Begin Scene# ((Scene#) - (1)) Go to x (x position) y [174]\n    end\nend\nif <(Scene#) = [12]> then\n    if <(x position) > [235]> then\n        Begin Scene# ((Scene#) + (1)) Go to x [-235] y (y position)\n    end\nend\nif <(Scene#) = [13]> then\n    if <(x position) < [-235]> then\n        Begin Scene# ((Scene#) - (1)) Go to x [235] y (y position)\n    end\nend\nif <(Scene#) = [11]> then\n    if <(x position) > [235]> then\n        Begin Scene# ((Scene#) + (3)) Go to x [-235] y (y position)\n    end\nend\nif <(Scene#) = [14]> then\n    if <(x position) < [-235]> then\n        Begin Scene# ((Scene#) - (3)) Go to x [235] y (y position)\n    end\nend\nif <(Scene#) = [13]> then\n    if <(y position) < [-175]> then\n        Begin Scene# ((Scene#) + (1)) Go to x (x position) y [174]\n    end\nend\nif <(Scene#) = [14]> then\n    if <(y position) > [175]> then\n        Begin Scene# ((Scene#) - (1)) Go to x (x position) y [-174]\n    end\nend\nif <(Scene#) = [14]> then\n    if <(x position) > [235]> then\n        Begin Scene# ((Scene#) + (1)) Go to x [-234] y (y position)\n    end\nend\nif <(Scene#) = [15]> then\n    if <(x position) < [-235]> then\n        Begin Scene# ((Scene#) - (1)) Go to x [234] y (y position)\n    end\nend\nif <touching (door v)?> then\n    Begin Scene# ((Scene#) + (1)) Go to x [-235] y [-70]\n    set [wood? v] to [0]\nend\n\nwhen I receive [die v]\nswitch costume to (stand v)\nstop [other scripts in sprite v]\nDie\n\ndefine Die\nset [guy die v] to [DIE]\nset rotation style [all around v]\nif <<([direction v] of [arrow v]) = [-90]> or <([direction v] of [bullet v]) = [-90]>> then\n    if <(direction) = [90]> then\n        repeat until <(direction) = [0]>\n            turn left (30) degrees\n        end\n    end\n    if <(direction) = [-90]> then\n        point in direction (90)\n        repeat until <(direction) = [0]>\n            turn left (30) degrees\n        end\n    end\n    repeat until <touching (level v)?>\n        change y by (-2)\n    end\nend\nif <<([direction v] of [bullet v]) = [90]> or <([x position v] of [arrow v]) = [90]>> then\n    if <(direction) = [90]> then\n        repeat until <(direction) = [180]>\n            turn right (30) degrees\n        end\n    end\n    if <(direction) = [-90]> then\n        point in direction (90)\n        repeat until <(direction) = [180]>\n            turn right (30) degrees\n        end\n    end\n    repeat until <touching (level v)?>\n        change y by (-2)\n    end\nend\nFix collision\nwait (1) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nbroadcast (Reset Level v)\n\ndefine Boom!\nstop [other scripts in sprite v]\nset size to (150) %\nswitch costume to (boom v)\nset rotation style [all around v]\nrepeat (5)\n    turn right (2) degrees\nend\nwait (0.1) seconds\nhide\nbroadcast (Reset Level v)\nstop [this script v]\n\nwhen I receive [zap v]\nstop [other scripts in sprite v]\nadd [1] to [bang v]\nadd (x position) to [bang v]\nadd (y position) to [bang v]\nhide\n\nwhen I receive [reset level v]\nif <<(Scene#) > [10]> and <(Scene#) < [16]>> then\n    Begin Scene# [11] Go to x [-235] y [-70]\nelse\n    Begin Scene# (Scene#) Go to x [-235] y [-70]\nend\nset [key get v] to [0]\nset [guy die v] to []\nshow\nset [ghost v] effect to (0)\nbroadcast (Loop Game v)\n\ndefine Set ability\nset [guy die v] to []\nset [gravity v] to [-1.5]\nset [acceleration v] to [2]\nset [friction v] to [0.8]\nset [jump power v] to [12]\nSet Game\n\nwhen I receive [hit v]\nset [guy x v] to (x position)\nset [guy y v] to (y position)\nset [ghost v] effect to (100)\n\nwhen I receive [done hit v]\nshow\nset [ghost v] effect to (0)\nset x to (Guy X)\nset y to (Guy Y)\n\nwhen I receive [shoot arrow v]\nforever\n    if <touching (arrow v)?> then\n        stop [other scripts in sprite v]\n        switch costume to (stand v)\n        Die\n    end\nend\n\ndefine Collide X- Slope or Wall?\nCheck can wall slide\nchange y by (1)\nCheck Touching Solid\nif <(touching) > [0]> then\n    change y by (1)\n    Check Touching Solid\n    if <(touching) > [0]> then\n        change y by (-2)\n        set x to (Last value)\n        set [speed x v] to [0]\n        stop [this script v]\n    end\n    set [speed x v] to ((Speed X) * (0.8))\nend\nset [speed x v] to ((Speed X) * (0.95))\nSlip\n\ndefine Collide Y- Celling or Wall?\nset y to (Last value)\nif <(Speed Y) > [0]> then\n    set [speed y v] to [0]\n    stop [this script v]\nend\nif <(Falling) > [0]> then\n    set [falling v] to [0]\n    Slip\nend\nset [speed y v] to ((Speed Y) * (0.8))\n\ndefine Slip\nchange y by (-2)\nchange x by (1)\nCheck Touching Solid\nif <(touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (1)\n    stop [this script v]\nend\nchange x by (-2)\nCheck Touching Solid\nif <(touching) < [1]> then\n    set [falling v] to [9]\n    change [speed x v] by (-1)\n    stop [this script v]\nend\nchange y by (2)\nchange x by (1)\n\nchange [falling v] by (1)\nrepeat (steps)\n    set [last value v] to (x position)\n    change x by ((Speed X) / (steps))\n    Check Touching Solid\n    if <(touching) = [1]> then\n        set x to (Last value)\n        set [speed x v] to [0]\n    end\n    set [last value v] to (y position)\n    change y by ((Speed Y) / (steps))\n    Check Touching Solid\n    if <(touching) = [1]> then\n        set y to (Last value)\n        if <(Speed Y) < [0]> then\n            set [falling v] to [0]\n        end\n        set [speed y v] to [0]\n    end\nend\n\nswitch costume to ((costume [number v]) + (6))\nstop [this script v]\n\ndefine Check can wall slide\nif <(Falling) < [2]> then\n    set [wall slide v] to [0]\n    stop [this script v]\nend\nswitch costume to (hitbox wallslide v)\nset rotation style [left-right v]\nCheck Touching Solid\nset [wall slide v] to (touching)\nswitch costume to (hitbox v2 v)\nset rotation style [don't rotate v]\n\ndefine Fix collision\nrepeat until <touching (level v)?>\n    change [speed y v] by (Gravity)\n    change y by (Speed Y)\nend\nrepeat until <not <touching (level v)?>>\n    change y by (1)\nend\n\nwhen I receive [boom v]\nstop [other scripts in sprite v]\nadd [2] to [bang v]\nadd (x position) to [bang v]\nadd (y position) to [bang v]\nhide\nstop [this script v]\n\nforever\n    go to [front v] layer\nend\n\n@Level\n\nwhen I receive [change scene v]\ngo to [back v] layer\nswitch costume to (join [Level] (Scene#))\n\nwhen flag clicked\ngo to [back v] layer\ngo to x: (0) y: (0)\n\ngo [backward v] (1) layers\n\nwhen flag clicked\nforever\n    play sound [audiohub__4066141015217_the-mission__testversion v] until done\nend\n\n@Door\n\nwhen flag clicked\ngo to x: (215) y: (-60)\n\nwhen I receive [change scene v]\nif <<(Scene#) > [10]> and <(Scene#) < [15]>> then\n    hide\nelse\n    show\n    if <(Scene#) = [7]> then\n        go to x: (215) y: (115)\n    else\n        go to x: (215) y: (-60)\n    end\nend\n\nif <(Scene#) = [14]> then\n    go to x: (213) y: (100)\nelse\nend\n\nset [whirl v] effect to (0)\n\nwhen I receive [change scene v]\nif <(Scene#) > [15]> then\n    hide\nend\n\n@Police\n\nwhen flag clicked\nset rotation style [left-right v]\npoint in direction (90)\nhide\n\ndefine Walk (steps) (speed)\nset rotation style [left-right v]\nswitch costume to (run-01 v)\nrepeat (steps)\n    change x by (((direction) / (90)) * (speed))\n    if <(costume [number v]) = [15]> then\n        switch costume to (run-01 v)\n    else\n        next costume\n    end\n    wait (0.02) seconds\nend\nswitch costume to (shoot v)\nwait (1) seconds\nturn right (180) degrees\nwait (1) seconds\n\nwhen I receive [change scene v]\nclear graphic effects\nbroadcast (Patrol v)\nif <(Scene#) = [7]> then\n    go to x: (-80) y: (42)\nelse\n    if <(Scene#) = [8]> then\n        go to x: (134) y: (-64)\n    else\n        if <(Scene#) = [9]> then\n            go to x: (-75) y: (110)\n            point in direction (90)\n        else\n            if <(Scene#) = [13]> then\n                point in direction (90)\n                go to x: (-110) y: (-1)\n            else\n                hide\n            end\n        end\n    end\nend\n\ngo to x: (10) y: (-1)\n\nwhen I receive [shoot v]\ncreate clone of (bullet v)\nwait (0.2) seconds\ncreate clone of (bullet v)\nwait (0.2) seconds\ncreate clone of (bullet v)\n\nwhen I receive [hit v]\nif <touching color (#904f00)?> then\n    broadcast (Police hit v)\n    stop [this script v]\nend\n\nwhen I receive [done die v]\nstop [other scripts in sprite v]\nswitch costume to (stand v)\nset rotation style [all around v]\nif <(Side) = [Left]> then\n    repeat (3)\n        turn left (30) degrees\n    end\n    repeat until <touching (level v)?>\n        change y by (Gravity)\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    stop [this script v]\nend\nif <(Side) = [Right]> then\n    repeat (3)\n        turn right (30) degrees\n    end\n    repeat until <touching (level v)?>\n        change y by (Gravity)\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    stop [this script v]\nend\n\ndefine Patrol\n\nwhen I receive [patrol v]\nforever\n    if <(Scene#) = [7]> then\n        set size to (100) %\n        show\n        forever\n            Walk [25] [5]\n        end\n    else\n        if <(Scene#) = [8]> then\n            show\n            point in direction (90)\n            switch costume to (sleep v)\n        else\n            if <(Scene#) = [9]> then\n                set size to (80) %\n                show\n                forever\n                    Walk [25] [5]\n                end\n            else\n                if <(Scene#) = [13]> then\n                    set size to (80) %\n                    show\n                    forever\n                        Walk [36] [5]\n                    end\n                else\n                    hide\n                end\n            end\n        end\n    end\nend\n\nwait (1) seconds\n\nhide\n\nrepeat until <touching (level v)?>\n    change y by (Gravity)\nend\n\nshow\n\ngo to x: (-75) y: (105)\n\ngo to x: (45) y: (114)\n\nrepeat until <not <touching (line v)?>>\n    move (5) steps\nend\nrepeat until <touching (line v)?>\n\nPatrol\n\ngo to x: (70) y: (42)\n\ngo to x: (-8) y: (42)\n\nwait (1) seconds\nturn right (180) degrees\nwait (1) seconds\n\nif <(direction) > [0]> then\n    Walk ([floor v] of ((distance to [dot 1 v]) / (5)) ) [5]\nelse\n    Walk ([floor v] of ((distance to [dot 2 v]) / (5)) ) [5]\nend\n\nswitch costume to (shoot v)\ncreate clone of (bullet v)\nwait (0.2) seconds\ncreate clone of (bullet v)\nwait (0.2) seconds\ncreate clone of (bullet v)\nswitch costume to (stand v)\n\nchange x by (4)\n\ngo to x: (90) y: (-1)\n\nwhen I receive [reset level v]\nstop [other scripts in sprite v]\npoint in direction (90)\nclear graphic effects\nbroadcast (Patrol v)\nif <(Scene#) = [7]> then\n    go to x: (-80) y: (42)\nelse\n    if <(Scene#) = [8]> then\n        go to x: (134) y: (-64)\n    else\n        if <(Scene#) = [9]> then\n            go to x: (-75) y: (105)\n            point in direction (90)\n        else\n            if <(Scene#) = [13]> then\n                point in direction (90)\n                go to x: (-110) y: (-1)\n            else\n                hide\n            end\n        end\n    end\nend\n\nPatrol\n\nwait (0.02) seconds\n\nif <(costume [name v]) = [stand]> then\n    create clone of (bullet v)\n    wait (0.2) seconds\n    create clone of (bullet v)\n    wait (0.2) seconds\n    create clone of (bullet v)\n    broadcast (Patrol v)\n    stop [other scripts in sprite v]\n    switch costume to (shoot v)\nend\n\nwhen I receive [change scene v]\nclear graphic effects\n\n@sensor\n\nwhen I receive [change scene v]\nif <(Scene#) = [7]> then\n    Stand by\n    stop [this script v]\nend\nif <(Scene#) = [9]> then\n    Stand by\n    stop [this script v]\nend\nif <(Scene#) = [13]> then\n    Stand by\n    stop [this script v]\nend\nhide\n\nwhen I receive [die v]\nstop [other scripts in sprite v]\nhide\n\ndefine Stand by\nshow\nset [ghost v] effect to (100)\nforever\n    go to (police v)\n    point in direction ([direction v] of [police v])\n    if <touching (guy v)?> then\n        broadcast (Shoot v)\n        hide\n        wait (1) seconds\n        show\n    end\nend\n\nset [ghost v] effect to (100)\n\n@Bullet\n\nwhen flag clicked\nhide\nforever\n    point in direction ([direction v] of [police v])\nend\n\nwhen I start as a clone\nshow\ngo to (police v)\nrepeat until <<<touching (_edge_ v)?> or <touching (guy v)?>> or <touching (level v)?>>\n    if <(direction) < [0]> then\n        change x by (-20)\n    else\n        change x by (20)\n    end\nend\nif <touching (guy v)?> then\n    broadcast (Die v)\nend\ndelete this clone\n\n@CCTV\n\nwhen flag clicked\nhide\n\nwhen I receive [change scene v]\nforever\n    if <(Scene#) = [5]> then\n        go to [back v] layer\n        show\n        go to (pen v)\n        forever\n            point towards (huh v)\n        end\n    end\n    if <(Scene#) = [6]> then\n        hide\n    end\nend\n\nrepeat (10)\n\nwhen I receive [change scene v]\nforever\n    if <(Scene#) = [9]> then\n        show\n        go to (pen v)\n        forever\n            point towards (huh v)\n        end\n    end\nend\n\nwhen flag clicked\n\ndefine light\n\nif <not <touching (level v)?>> then\n    repeat (16)\n        pen down\n        repeat until <touching (level v)?>\n            move (8) steps\n        end\n        pen up\n        set pen (transparency v) to (70)\n        point in direction ((direction) + (0.8))\n        go to x: (0) y: (170)\n    end\nend\n\ndefine loop\nerase all\npen up\nshow\nswitch costume to (costume2 v)\npoint towards (huh v)\nset pen (transparency v) to (100)\nlight\npoint in direction (90)\ngo to x: (0) y: (170)\nswitch costume to (costume1 v)\n\nrepeat until <(direction) = [90]>\n    turn right (1) degrees\nend\nrepeat until <(direction) = [0]>\n    turn left (1) degrees\nend\nwait (1) seconds\n\ngo to x: (246) y: (184)\ngo to [front v] layer\ngo [backward v] (1) layers\npoint in direction (45)\nforever\n    loop\nend\n\ngo to [front v] layer\ngo [backward v] (1) layers\npoint in direction (-60)\n\nforever\n    repeat until <(direction) = [0]>\n        turn right (1) degrees\n    end\n    repeat until <(direction) = [-90]>\n        turn left (1) degrees\n    end\nend\n\nwhen I receive [change scene v]\nif <(Scene#) = [10]> then\n    hide\nend\n\n@Key\n\nwhen flag clicked\nset size to (50) %\nhide\n\nwhen I receive [change scene v]\nforever\n    if <(Key get) = [yes]> then\n    else\n        set [key get v] to [0]\n    end\n    show\n    if <not <<<(Scene#) = [4]> or <(Scene#) = [9]>> or <(Scene#) = [13]>>> then\n        hide\n    end\n    Go to Scene [4] x [35] y [-70]\n    Go to Scene [9] x [46] y [39]\n    Go to Scene [13] x [-220] y [130]\n    forever\n        Get Key?\n    end\nend\n\ndefine Get Key?\nif <touching (guy v)?> then\n    if <<(Scene#) > [10]> and <(Scene#) < [15]>> then\n        set [key get v] to [yes]\n    else\n        set [key get v] to [1]\n    end\n    stop [other scripts in sprite v]\n    glide (1) secs to x: (-210) y: (160)\n    forever\n        if <(Key get) = [no]> then\n            stop [other scripts in sprite v]\n            hide\n            stop [this script v]\n        end\n    end\nend\n\nshow\n\ndefine Go to Scene (scene) x (x) y (y)\nif <(Scene#) = (scene)> then\n    show\n    go to x: (x) y: (y)\nend\n\nif <not <<<(Scene#) = [4]> or <(Scene#) = [9]>> or <(Scene#) = [13]>>> then\n    hide\nend\n\nif <<(x position) = [-210]> and <(y position) = [160]>> then\n    set [key get v] to [1]\nend\n\nwhen I receive [change scene v]\nforever\n    if <(Key get) = [yes]> then\n        show\n        go to x: (-210) y: (160)\n    end\nend\n\nshow\n\nif <(Key get) = [yes]> then\nend\n\nwhen flag clicked\nset [key get v] to [0]\n\n@Boom\n\nwhen flag clicked\nhide\nset [clone# v] to [0]\ndelete all of [bang v]\nforever\n    if <(length of [bang v]) > [0]> then\n        switch costume to (item ((length of [bang v]) - (2)) of [bang v])\n        set x to (item ((length of [bang v]) - (1)) of [bang v])\n        set y to (item (length of [bang v]) of [bang v])\n        if <(costume [number v]) = [1]> then\n            repeat (5)\n                create clone of (_myself_ v)\n                change [clone# v] by (1)\n            end\n        else\n            create clone of (_myself_ v)\n        end\n        delete all of [bang v]\n        stop [this script v]\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (0)\nshow\nset [dir v] to (((Clone#) * (45)) - (135))\npoint in direction (dir)\nrepeat (100)\n    if <(costume [number v]) = [1]> then\n        change x by ((4) * ([sin v] of (dir) ))\n        change y by ((3) * ([cos v] of (dir) ))\n    end\n    change [ghost v] effect by (1)\nend\nhide\nbroadcast (Reset Level v)\n\nwhen I receive [reset level v]\nset [clone# v] to [0]\nforever\n    if <(length of [bang v]) > [0]> then\n        switch costume to (item ((length of [bang v]) - (2)) of [bang v])\n        set x to (item ((length of [bang v]) - (1)) of [bang v])\n        set y to (item (length of [bang v]) of [bang v])\n        if <(costume [number v]) = [1]> then\n            repeat (5)\n                create clone of (_myself_ v)\n                change [clone# v] by (1)\n            end\n        else\n            create clone of (_myself_ v)\n        end\n        delete all of [bang v]\n        stop [this script v]\n    end\nend\n\n@Lock\n\nwhen flag clicked\nhide\n\nwhen I receive [change scene v]\nif <not <<(Scene#) > [10]> and <(Scene#) < [16]>>> then\n    set [condition v] to [lock]\nend\nswitch costume to (door v)\nif <not <<<(Scene#) = [4]> or <(Scene#) = [9]>> or <(Scene#) = [14]>>> then\n    hide\nend\nrepeat until <<touching (guy v)?> and <<(Key get) = [1]> or <(Key get) = [yes]>>>\n    Show, go to Scene [4] x [62] y [76] Size [100]\n    Show, go to Scene [9] x [-154] y [-11] Size [70]\n    Show, go to Scene [14] x [-154] y [-76] Size [70]\nend\nhide\nset [condition v] to [unlock]\nset [key get v] to [no]\n\ndefine Show, go to Scene (scene) x (x) y (y) Size (size)\nif <(Scene#) = (scene)> then\n    if <(Condition) = [unlock]> then\n        hide\n    else\n        show\n    end\n    set size to (size) %\n    go to x: (x) y: (y)\nend\n\nshow\n\nif <touching (guy v)?> then\n    if <<(Key get) = [1]> or <(Key get) = [yes]>> then\n        stop [other scripts in sprite v]\n        hide\n        set [key get v] to [no]\n        stop [this script v]\n    end\nend\n\nif <(Scene#) = [9]> then\n    show\n    set size to (70) %\n    go to x: (-154) y: (-11)\n    if <touching (guy v)?> then\n        if <(Key get) = [1]> then\n            switch costume to (blink v)\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            hide\n            stop [this script v]\n        end\n    end\nend\n\nif <(Scene#) = [4]> then\n    show\n    go to x: (62) y: (76)\n    if <touching (guy v)?> then\n        if <(Key get) = [1]> then\n            switch costume to (blink v)\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            hide\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [change scene v]\n\nif <(Scene#) = [14]> then\n    if <(Condition) = [unlock]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen flag clicked\nset [condition v] to [lock]\n\n@Words?\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\n    switch costume to (Scene#)\nend\n\n@Laser shooter\n\nwhen I receive [change scene v]\nif <(Scene#) = [6]> then\n    switch costume to (costume1 v)\n    go to [front v] layer\n    go [backward v] (1) layers\n    show\nelse\n    if <(Scene#) = [9]> then\n        go to x: (36) y: (28)\n        switch costume to (costume2 v)\n        go to [front v] layer\n        show\n    else\n        if <(Scene#) = [12]> then\n            go to [front v] layer\n            switch costume to (costume3 v)\n            go to x: (36) y: (28)\n            show\n        else\n            if <(Scene#) = [13]> then\n                go to [front v] layer\n                go to x: (0) y: (0)\n                if <([costume name v] of [laser v]) = [L13-2]> then\n                    switch costume to (costume5 v)\n                else\n                    switch costume to (costume4 v)\n                end\n                show\n            else\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [reset level v]\nforever\n    go to [front v] layer\nend\n\ngo to x: (0) y: (0)\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@Laser\n\nwhen I receive [change scene v]\nif <(Scene#) = [6]> then\n    show\n    forever\n        switch costume to (l6-1 v)\n        wait (2) seconds\n        switch costume to (l6-2 v)\n        wait (0.1) seconds\n        switch costume to (l6-1 v)\n        wait (0.1) seconds\n        switch costume to (l6-2 v)\n        wait (0.1) seconds\n        switch costume to (l6-1 v)\n        wait (0.1) seconds\n        switch costume to (l6-2 v)\n        wait (2) seconds\n        switch costume to (l6-1 v)\n        wait (0.1) seconds\n        switch costume to (l6-2 v)\n        wait (0.1) seconds\n        switch costume to (l6-1 v)\n        wait (0.1) seconds\n        switch costume to (l6-2 v)\n        wait (0.1) seconds\n    end\nelse\n    if <(Scene#) = [9]> then\n        switch costume to (l9-1 v)\n        show\n        forever\n            show\n            wait (2) seconds\n            hide\n            wait (0.1) seconds\n            show\n            wait (0.1) seconds\n            hide\n            wait (0.1) seconds\n            show\n            wait (0.1) seconds\n            hide\n            wait (2) seconds\n            show\n            wait (0.1) seconds\n            hide\n            wait (0.1) seconds\n            show\n            wait (0.1) seconds\n            hide\n            wait (0.1) seconds\n        end\n    else\n        if <(Scene#) = [12]> then\n            switch costume to (l12-1 v)\n            show\n        else\n            if <(Scene#) = [13]> then\n                switch costume to (l13-1 v)\n                show\n            else\n                hide\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [change scene v]\nforever\n    if <touching (guy v)?> then\n        broadcast (Zap v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [reset level v]\nforever\n    if <touching (guy v)?> then\n        broadcast (Zap v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [hide laser v]\nif <(Scene#) = [6]> then\n    stop [other scripts in sprite v]\n    switch costume to (l6-3 v)\n    forever\n        show\n        wait (2) seconds\n        hide\n        wait (0.1) seconds\n        show\n        wait (0.1) seconds\n        hide\n        wait (0.1) seconds\n        show\n        wait (0.1) seconds\n        hide\n        wait (2) seconds\n        show\n        wait (0.1) seconds\n        hide\n        wait (0.1) seconds\n        show\n        wait (0.1) seconds\n        hide\n        wait (0.1) seconds\n    end\nelse\n    hide\nend\n\nwhen I receive [change scene v]\nforever\n    if <(Scene#) = [7]> then\n        stop [other scripts in sprite v]\n        hide\n    end\nend\n\nwhen I receive [change scene v]\n\n\n\nwhen I receive [hide laser v]\nif <(Scene#) = [14]> then\n    stop [other scripts in sprite v]\n    set [costume# v] to [L13-2]\n    hide\nend\n\nwhen flag clicked\nset [costume# v] to []\n\nwhen I receive [change scene v]\nif <<(Scene#) = [13]> and <(Costume#) > []>> then\n    switch costume to (Costume#)\nend\n\n@Wood\n\nwhen I receive [change scene v]\nforever\n    if <(Scene#) = [8]> then\n        show\n    else\n        hide\n    end\n    if <touching (guy v)?> then\n        say [Press "E" to pick up.]\n        set [touch v] to [1]\n        if <key (e v) pressed?> then\n            hide\n            set [wood? v] to [1]\n            stop [this script v]\n        end\n    else\n        say [Pick this to hit people!]\n        set [touch v] to [0]\n    end\nend\n\nwhen flag clicked\nset [wood? v] to [0]\nhide\n\n@Hit it!!!\n\nwhen flag clicked\nhide\n\nwhen I receive [show it v]\nshow\ngo to [front v] layer\nif <(Scene#) = [3]> then\n    go to x: (-55) y: (-21)\nend\nif <(Scene#) = [9]> then\n    go to x: (164) y: (-111)\nend\nif <(Scene#) = [12]> then\n    go to x: (188) y: (100)\nend\nforever\n    switch costume to (Break it!!!)\n    if <(costume [number v]) = [20]> then\n        wait (0) seconds\n        hide\n        stop [this script v]\n    end\nend\n\n@Gate\n\nwhen flag clicked\nset [multi-level break v] to [0]\nhide\n\ndefine Break Gate\nforever\n    change [break it!!! v] by (1)\n    stop [this script v]\nend\n\nwhen I receive [change scene v]\nforever\n    clear graphic effects\n    if <(Scene#) = [3]> then\n        show\n        go to x: (-66) y: (-73)\n        set [break it!!! v] to [0]\n        forever\n            Breaking...\n            Done Break\n        end\n    end\n    if <(Scene#) = [9]> then\n        show\n        go to x: (153) y: (-76)\n        set [break it!!! v] to [0]\n        forever\n            Breaking...\n            Done Break\n        end\n    end\n    if <(Scene#) = [12]> then\n        if <(Multi-level break) = [1]> then\n            hide\n        else\n            show\n            go to x: (150) y: (64)\n            set [break it!!! v] to [0]\n            forever\n                Breaking...\n                Done Break\n            end\n        end\n    end\nend\n\nwhen I receive [change scene v]\nif <(Scene#) = [3]> then\n    show\n    forever\n        if <touching (guy v)?> then\n            forever\n                if <(Break it!!!) = [0]> then\n                    set [break it!!! v] to [0]\n                else\n                    wait (0.7) seconds\n                    change [break it!!! v] by (-1)\n                end\n            end\n        end\n    end\nelse\n    if <(Scene#) = [9]> then\n        show\n        forever\n            if <touching (guy v)?> then\n                forever\n                    if <(Break it!!!) = [0]> then\n                        set [break it!!! v] to [0]\n                    else\n                        wait (0.7) seconds\n                        change [break it!!! v] by (-1)\n                    end\n                end\n            end\n        end\n    else\n        if <(Scene#) = [12]> then\n            show\n            forever\n                if <touching (guy v)?> then\n                    forever\n                        if <(Break it!!!) = [0]> then\n                            set [break it!!! v] to [0]\n                        else\n                            wait (0.7) seconds\n                            change [break it!!! v] by (-1)\n                        end\n                    end\n                end\n            end\n        else\n            hide\n        end\n    end\nend\n\ndefine Done Break\nif <(Break it!!!) > [19]> then\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\n    hide\n    if <(Scene#) = [12]> then\n        set [multi-level break v] to [1]\n    end\nend\n\ndefine Breaking...\nif <touching (guy v)?> then\n    broadcast (Show it v)\n    if <key (space v) pressed?> then\n        Break Gate\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I receive [reset level v]\nclear graphic effects\nif <(Scene#) = [3]> then\n    show\n    go to x: (-66) y: (-73)\n    set [break it!!! v] to [0]\n    forever\n        Breaking...\n        Done Break\n    end\nend\nif <(Scene#) = [9]> then\n    show\n    go to x: (153) y: (-76)\n    set [break it!!! v] to [0]\n    forever\n        Breaking...\n        Done Break\n    end\nend\nif <(Scene#) = [12]> then\n    if <(Multi-level break) = [1]> then\n        hide\n    else\n        show\n        go to x: (150) y: (64)\n        set [break it!!! v] to [0]\n        forever\n            Breaking...\n            Done Break\n        end\n    end\nend\n\nforever\n\n@Wood Guy\n\nwhen I receive [hit v]\nshow\nset size to (80) %\nset x to (Guy X)\nset y to (Guy Y)\npoint in direction ([direction v] of [guy v])\nswitch costume to (stand+wood v)\nrepeat (12)\n    next costume\nend\nhide\nbroadcast (Done Hit v)\n\nwhen flag clicked\nhide\n\ndefine Fix Collisions in direction (dir)\nset [temporary dir v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (128)\n    Check Touching Solid\n    if <(touching) < [1]> then\n        point in direction (temporary dir)\n        stop [this script v]\n    end\n    Fix Collisions in direction [0]\n    move (distance) steps\n    turn right (180) degrees\n    change [distance v] by (1)\nend\n\ndefine Check Touching Solid\nif <<<touching (level v)?> or <touching (lock v)?>> or <touching (gate v)?>> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nCheck Touching Solid\n\nFix Collisions in direction [0]\n\n@Block\n\nwhen I receive [hit v]\ngo to (door v)\nset [ghost v] effect to (100)\nshow\n\nwhen I receive [done hit v]\nhide\n\nwhen flag clicked\nhide\n\n@Hit side\n\nwhen I receive [police hit v]\nshow\nset [ghost v] effect to (100)\ngo to [back v] layer\nset [side v] to [Left]\ngo to (police v)\nswitch costume to (Side)\nif <not <<touching (guy v)?> or <touching (wood guy v)?>>> then\n    set [side v] to [Right]\nelse\n    broadcast (Done die v)\n    hide\nend\n\nwhen flag clicked\nhide\n\n@Button\n\nwhen flag clicked\nhide\n\nwhen I receive [change scene v]\nforever\n    if <(Scene#) = [6]> then\n        show\n        go to x: (26) y: (-34)\n        if <touching (guy v)?> then\n            set [touch v] to [1]\n            if <key (space v) pressed?> then\n                broadcast (Hide laser v)\n            end\n        else\n            set [touch v] to [0]\n        end\n    else\n        if <(Scene#) = [14]> then\n            show\n            set size to (70) %\n            go to x: (-117) y: (-73)\n            if <touching (guy v)?> then\n                set [touch v] to [1]\n                if <key (space v) pressed?> then\n                    broadcast (Hide laser v)\n                end\n            else\n                set [touch v] to [0]\n            end\n        else\n            hide\n        end\n    end\nend\n\ngo to (guy v)\n\n@Archery Guy\n\nwhen I receive [change scene v]\nif <(Scene#) = [10]> then\n    go to x: (-206) y: (104)\n    show\nelse\n    hide\nend\n\nwhen I receive [shoot arrow v]\nnext costume\nrepeat until <(costume [number v]) = [1]>\n    next costume\nend\n\n@Arrow sensor\n\nwhen I receive [change scene v]\nforever\n    go to (archery guy v)\n    go to [back v] layer\n    set [ghost v] effect to (100)\n    if <(Scene#) = [10]> then\n        show\n        if <<touching (guy v)?> and <(Guy Die) = []>> then\n            broadcast (Shoot Arrow v)\n        end\n    else\n        hide\n    end\nend\n\nwhen I receive [shoot arrow v]\nstop [other scripts in sprite v]\nhide\nwait (1) seconds\nshow\ngo to (archery guy v)\nforever\n    if <(Scene#) = [10]> then\n        show\n        if <<touching (guy v)?> and <(Guy Die) = []>> then\n            broadcast (Shoot Arrow v)\n        end\n    else\n        hide\n    end\nend\n\nhide\n\n@Arrow\n\nwhen I receive [change scene v]\nhide\n\nwhen I receive [shoot arrow v]\ngo to x: (([x position v] of [archery guy v]) + (2)) y: ([y position v] of [archery guy v])\nshow\nrepeat until <<<touching (_edge_ v)?> or <touching (guy v)?>> or <touching (level v)?>>\n    change x by (50)\nend\nhide\n\nchange x by (10)\n\n@Shooting stand\n\nwhen I receive [change scene v]\nif <(Scene#) = [10]> then\n    show\n    go to x: (36) y: (5)\nelse\n    hide\nend\n\n@Shooting thingy\n\nwhen I receive [change scene v]\nif <(Scene#) = [10]> then\n    show\n    go to x: (36) y: (5)\n    forever\n        point towards (guy v)\n        if <(distance to [guy v]) < [180]> then\n            create clone of (laser shootdwdw v)\n            wait (0.1) seconds\n        end\n    end\nelse\n    hide\nend\n\nwhen I receive [die v]\nstop [other scripts in sprite v]\nstop [this script v]\n\n@Laser shootdwdw\n\nwhen I start as a clone\nshow\ngo to [back v] layer\ngo to (shooting thingy v)\npoint in direction ([direction v] of [shooting thingy v])\nrepeat until <<touching (guy v)?> or <<touching (level v)?> or <touching (_edge_ v)?>>>\n    move (10) steps\n    if <touching (guy v)?> then\n        broadcast (Die v)\n        delete this clone\n    end\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\n@crumbled floor\n\nwhen I receive [change scene v]\nif <(Scene#) = [13]> then\n    go to x: (-53) y: (71)\n    switch costume to (crumble-0011-8 v)\n    show\n    forever\n        switch costume to (check box v)\n        change x by (2)\n        if <touching (guy v)?> then\n            change x by (-2)\n            repeat (9)\n                next costume\n                create clone of (crumbled floor2 v)\n            end\n            hide\n            wait (2) seconds\n            show\n            repeat (8)\n                switch costume to ((costume [number v]) - (1))\n            end\n        else\n            change x by (-2)\n            switch costume to (crumble-0011-8 v)\n        end\n    end\nelse\n    hide\nend\n\nif  then\nend\n\nshow\n\nwhen flag clicked\nhide\n\nshow\ngo to x: (0) y: (-60)\nforever\n    switch costume to (check box v)\n    if <touching (guy v)?> then\n        repeat (9)\n            next costume\n            create clone of (crumbled floor2 v)\n        end\n        hide\n        wait (2) seconds\n        show\n        repeat (8)\n            switch costume to ((costume [number v]) - (1))\n        end\n    end\n    switch costume to (crumble-0011-8 v)\nend\n\n@crumbled floor2\n\nwhen I receive [change scene v]\n\nif <(Scene#) = [13]> then\n    if <([costume # v] of [crumbled floor v]) = [3]> then\n        go to x: (-24) y: (-36)\n    end\nelse\n    hide\nend\n\nwhen flag clicked\nhide\n\nshow\n\ngo to x: (-53) y: (71)\nswitch costume to (crumble-0011-8 v)\nshow\nforever\n    switch costume to (check box v)\n    if <touching (guy v)?> then\n        repeat (8)\n            next costume\n        end\n        hide\n        wait (2) seconds\n        show\n        repeat (8)\n            switch costume to ((costume [number v]) - (1))\n        end\n    end\n    switch costume to (crumble-0011-8 v)\nend\n\nwhen I start as a clone\nshow\nif <([costume # v] of [crumbled floor v]) = [9]> then\n    switch costume to (crumble-0010d2 v)\n    go to x: (-24) y: (-36)\nend\nif <([costume # v] of [crumbled floor v]) = [7]> then\n    switch costume to (crumble-0010d v)\n    go to x: (-8) y: (-36)\nend\nif <([costume # v] of [crumbled floor v]) = [10]> then\n    switch costume to (crumble-0010d2 v)\n    go to x: (8) y: (-36)\nend\nif <([costume # v] of [crumbled floor v]) = [8]> then\n    switch costume to (crumble-0010d v)\n    go to x: (24) y: (-36)\nend\nif <([costume # v] of [crumbled floor v]) = [4]> then\n    switch costume to (crumble-0010d v)\n    go to x: (-24) y: (-53)\nend\nif <([costume # v] of [crumbled floor v]) = [6]> then\n    switch costume to (crumble-0010d2 v)\n    go to x: (-8) y: (-53)\nend\nif <([costume # v] of [crumbled floor v]) = [3]> then\n    switch costume to (crumble-0010d v)\n    go to x: (8) y: (-53)\nend\nif <([costume # v] of [crumbled floor v]) = [5]> then\n    switch costume to (crumble-0010d2 v)\n    go to x: (24) y: (-53)\nend\nrepeat (10)\n    change y by (pick random (-1.0) to (-2.5))\n    change [ghost v] effect by (10)\nend\nhide\n\ngo to x: (0) y: (-60)\n\n@Saw\n\nwhen I receive [change scene v]\nif <(Scene#) = [14]> then\n    show\n    point in direction (90)\n    go to x: (40) y: (80)\n    forever\n        turn right (8) degrees\n        move (10) steps\n    end\nelse\n    hide\nend\n\nwhen flag clicked\nset [clone# v] to [1]\nhide\n\nwhen I start as a clone\n\nif <(Clone#) > [2]> then\n    change [clone# v] by (-1)\n    delete this clone\nend\nshow\npoint in direction (-90)\ngo to x: (40) y: (-50)\nforever\n    turn right (8) degrees\n    move (10) steps\nend\n\nturn left (8) degrees\n\nhide\n\nwhen I receive [change scene v]\nforever\n    if <touching (guy v)?> then\n        broadcast (Reset Level v)\n    end\nend\n\nwhen I receive [reset level v]\nforever\n    if  then\n        broadcast (Reset Level v)\n    end\nend\n\ncreate clone of (_myself_ v)\n\n@Saw2\n\nwhen I receive [change scene v]\nif <(Scene#) = [14]> then\n    clear graphic effects\n    show\n    point in direction (-90)\n    go to x: (40) y: (-50)\n    forever\n        turn right (8) degrees\n        move (10) steps\n    end\nelse\n    hide\nend\n\nwhen flag clicked\nset [clone# v] to [1]\nhide\n\nwhen I start as a clone\n\nif <(Clone#) > [2]> then\n    change [clone# v] by (-1)\n    delete this clone\nend\nshow\npoint in direction (-90)\ngo to x: (40) y: (-50)\nforever\n    turn right (8) degrees\n    move (10) steps\nend\n\nturn left (8) degrees\n\nwhen I start as a clone\nforever\n    if <(Scene#) = [14]> then\n        clear graphic effects\n    else\n        set [ghost v] effect to (100)\n    end\n    if <touching (guy v)?> then\n        broadcast (Reset Level v)\n    end\nend\n\nwhen I receive [change scene v]\nforever\n    if <touching (guy v)?> then\n        broadcast (Reset Level v)\n    end\nend\n\nwhen I receive [reset level v]\nforever\n    if  then\n        broadcast (Reset Level v)\n    end\nend\n\n@Black2\n\nwhen I receive [change scene v]\nif <(Scene#) = [14]> then\n    show\n    go to x: (0) y: (0)\n    go to [front v] layer\n    forever\n        if <([costume name v] of [bulb v]) = [on]> then\n            repeat (4)\n                change [ghost v] effect by (25)\n            end\n            hide\n        else\n            clear graphic effects\n            show\n        end\n    end\nelse\n    hide\nend\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\nend\n\nstop [this script v]\n\nwhen I receive [change scene v]\n\n@Bulb\n\nwhen flag clicked\nswitch costume to (off v)\nhide\n\nwhen I receive [change scene v]\nif <(Scene#) = [14]> then\n    set size to (20) %\n    show\n    point in direction (-90)\n    go to x: (34) y: (152)\n    forever\n        go to [front v] layer\n        switch costume to ([costume name v] of [switch v])\n    end\nelse\n    hide\nend\n\nwhen I receive [change scene v]\nforever\n    set [bulb v] to (costume [name v])\nend\n\n@Switch\n\nwhen I receive [change scene v]\nif <(Bulb) = [On]> then\n    switch costume to (on v)\nelse\n    switch costume to (off v)\nend\nif <(Scene#) = [14]> then\n    go to x: (-206) y: (147)\n    show\n    forever\n        if <touching (guy v)?> then\n            set [switch v] to [1]\n            if <key (space v) pressed?> then\n                wait until <not <key (space v) pressed?>>\n                next costume\n            end\n        else\n            set [switch v] to [0]\n        end\n    end\nelse\n    hide\nend\n\nwhen flag clicked\nset [bulb v] to [Off]\nswitch costume to (off v)\n\nwait (0) seconds\n\n@pen\n\nwhen flag clicked\nset [ghost v] effect to (100)\nerase all\n\ndefine light\nif <not <touching (level v)?>> then\n    repeat (16)\n        pen down\n        repeat until <touching (level v)?>\n            move (8) steps\n            if <touching (guy v)?> then\n                broadcast (Boom v)\n            end\n        end\n        pen up\n        set pen (transparency v) to (70)\n        point in direction ((direction) + (0.8))\n        if <(Scene#) = [9]> then\n            go to x: (235) y: (170)\n        else\n            go to x: (12) y: (90)\n        end\n    end\nend\n\ndefine loop\nerase all\npen up\nshow\nswitch costume to (costume1 v)\npoint towards (huh v)\nset pen (transparency v) to (100)\nlight\npoint in direction (90)\nif <(Scene#) = [9]> then\n    go to x: (235) y: (170)\nelse\n    go to x: (12) y: (90)\nend\nswitch costume to (costume2 v)\n\nwhen I receive [cctv v]\nerase all\nset [direction v] to [1]\nset pen color to (#7fff00)\nset pen size to (3)\nif <<(Scene#) = [5]> or <(Scene#) = [9]>> then\n    show\n    if <(Scene#) = [9]> then\n        go to x: (235) y: (170)\n    else\n        go to x: (12) y: (90)\n    end\n    repeat until <not <<(Scene#) = [5]> or <(Scene#) = [9]>>>\n        loop\n    end\n    erase all\nelse\n    hide\nend\n\nif  then\n\nwhen I receive [change scene v]\nhide\n\n@Huh\n\nwhen flag clicked\n\ngo to [front v] layer\n\nwhen I receive [change scene v]\nif <(Scene#) = [5]> then\n    go to x: (-100) y: (-175)\n    forever\n        repeat (67)\n            change x by (5)\n        end\n        repeat (50)\n            change y by (5)\n        end\n        wait (1) seconds\n        repeat (50)\n            change y by (-5)\n        end\n        repeat (67)\n            change x by (-5)\n        end\n        wait (1) seconds\n    end\nend\n\nwhen I receive [change scene v]\nif <(Scene#) = [9]> then\n    go to x: (-235) y: (-175)\n    forever\n        repeat (95)\n            change x by (5)\n        end\n        wait (1) seconds\n        repeat (98)\n            change x by (-5)\n        end\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n@Call man\n\nwhen flag clicked\nswitch costume to (normal v)\nset rotation style [left-right v]\npoint in direction (90)\n\nwhen I receive [change scene v]\nif <(Scene#) = [15]> then\n    show\n    forever\n        switch costume to (checkbox v)\n        if <touching (guy v)?> then\n            switch costume to (normal v)\n            say [!!!] for (0.1) seconds\n            repeat (5)\n                next costume\n                wait (0) seconds\n            end\n            stop [other scripts in sprite v]\n            stop [this script v]\n        end\n        switch costume to (normal v)\n    end\nelse\n    hide\nend\n\nwhen I receive [change scene v]\nif <(Scene#) = [15]> then\n    forever\n        turn right (180) degrees\n        wait (2) seconds\n    end\nend\n\nwhen I receive [reset level v]\nswitch costume to (normal v)\n\n@Bomb\n\nwhen flag clicked\nhide\n\ndefine Escape stuck\nrepeat until <not <touching (level v)?>>\n    change x by (pick random (-1.0) to (1.0))\n    change y by (pick random (-1.0) to (1.0))\nend\n\nrepeat (5)\n\nwait (0) seconds\n\nset [brightness v] effect to (100)\n\nwhen I receive [change scene v]\nBomb appear\n\nwhen I receive [reset level v]\nset size to (100) %\nswitch costume to (costume1 v)\ngo to (random position v)\nBomb appear\n\ndefine Bomb appear\nif <(Scene#) = [15]> then\n    hide\n    switch costume to (costume1 v)\n    set [whirl v] effect to (600)\n    set size to (100) %\n    forever\n        if <([costume # v] of [call man v]) = [7]> then\n            show\n            go to (random position v)\n            if <touching (level v)?> then\n                Escape stuck\n            end\n            repeat (5)\n                change [whirl v] effect by (50)\n                change [ghost v] effect by (20)\n            end\n            set [whirl v] effect to (0)\n            repeat (5)\n                change [ghost v] effect by (-20)\n            end\n            switch costume to (download-removebg-preview v)\n            set [fall speed v] to [-1]\n            repeat until <touching (level v)?>\n                change y by (fall speed)\n                change [fall speed v] by (Gravity)\n            end\n            set [fall speed v] to [0]\n            switch costume to (download-removebg-preview2 v)\n            wait (0.3) seconds\n            switch costume to (download-removebg-preview v)\n            wait (0.5) seconds\n            switch costume to (download-removebg-preview2 v)\n            wait (0.3) seconds\n            switch costume to (download-removebg-preview v)\n            wait (0.5) seconds\n            switch costume to (download-removebg-preview2 v)\n            wait (0.3) seconds\n            switch costume to (costume2 v)\n            repeat (2)\n                switch costume to (costume3 v)\n                change size by (500)\n                switch costume to (costume2 v)\n            end\n            wait (0) seconds\n            hide\n            broadcast (Reset Level v)\n            stop [this script v]\n        end\n    end\nelse\n    hide\n    stop [this script v]\nend\n\nwhen I receive [reset level v]\n\nforever\nend\n\nstop [this script v]\n\n@danger\n\nwhen I receive [change scene v]\nforever\n    if <(Scene#) = [15]> then\n        forever\n            if <<([costume # v] of [call man v]) = [7]> and <<([costume # v] of [bomb v]) = [2]> or <([costume # v] of [bomb v]) = [3]>>> then\n                show\n            else\n                hide\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Controls\n\nwhen this sprite clicked\nCheck Movement\n\nwhen flag clicked\nforever\n    if <([costume # v] of [sprite2 v]) = [1]> then\n        switch costume to (costume1 v)\n    else\n        switch costume to (all v)\n    end\nend\n\nset [controls: x v] to [0]\n\n\n\nswitch costume to (all v)\n\ndefine Check Movement\nrepeat (4)\n    next costume\n    if <touching (mouse-pointer v)?> then\n        if <(costume [number v]) = [4]> then\n            if <(Wood?) > [0]> then\n                broadcast (Hit v)\n            else\n                if <([touch v] of [wood v]) = [1]> then\n                    set [wood? v] to [1]\n                    stop [this script v]\n                end\n                if <([touch v] of [button v]) = [1]> then\n                    broadcast (Hide laser v)\n                    stop [this script v]\n                end\n                if <([switch v] of [switch v]) = [1]> then\n                    if <(Bulb) = [Off]> then\n                        set [bulb v] to [On]\n                    else\n                        set [bulb v] to [Off]\n                    end\n                else\n                    change [break it!!! v] by (1)\n                end\n            end\n        end\n        if <(costume [number v]) = [3]> then\n            set [x v] to [1]\n        end\n        if <(costume [number v]) = [2]> then\n            set [x v] to [-1]\n        end\n        if <(costume [number v]) = [5]> then\n            set [y v] to [1]\n        end\n        switch costume to (all v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <mouse down?>> then\n        set [x v] to (<<key (right arrow v) pressed?> or <key (d v) pressed?>> - <<key (left arrow v) pressed?> or <key (a v) pressed?>>)\n        set [y v] to (<<key (up arrow v) pressed?> or <key (w v) pressed?>> - ())\n    end\nend\n\n\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    show\n    go to x: (0) y: (0)\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\n\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\n\n@Sprite2\n\nwhen this sprite clicked\nnext costume\n\nwhen flag clicked\ngo to x: (-164) y: (0)\nswitch costume to (costume1 v)\ngo to [front v] layer\nshow\n\nwhen I receive [change scene v]\nif <(Scene#) = [16]> then\n    hide\nend\n\n
---------------------PLEASE READ THIS-----------------------\nTHIS PROJECT MAY LOOK LIKE (escape ||a platformer|| ) by @hern1, BUT I AM NOT COPYING HIS. AS SAID IN HIS PROFILE, I AM HIS BROTHER, SO I TEACH AND GAVE HIM SOME OF THE IDEAS. MY PROJECT IS MORE COMPLEX, SO HE POST HIS PROJECT EARLIER THEN MINE.SO, DON'T SAID I AM COPYING.THANKS.\n\n                                   *Controls*\nWASD or arrow keys to move.\nPress show to show mobile controls.\nE to pick up wooden stick and space to hit.\nSpace to press button (turning off laser and turning on light.)\nSpace to also hit the gate.\nGet to the exit.\nAvoid getting caught by CCTV, police and lasers.\nBoss level will be out later, but not too soon.