ADVENTURE 4 \Down the Mountain/ <a platformer> 

Instructions: Part 1: https://scratch.mit.edu/projects/590261836/\nPart 2: https://scratch.mit.edu/projects/624411056/\nWASD or arrow keys to move.\nIt is mobile friendly.\nI've added UFO and gun.\nSpace to swing sword or shoot.\nR to reload.\n1 to switch to sword\n2 to switch to gun.\nSword and gun can take away enemy's weapon and kill them.\nSword can also reflect arrows.\nTips are super useful.\n800 loves for part 5.( very high :O)\nFollow me --@Tao196\n\nGame contest\nhttps://scratch.mit.edu/projects/629319208/

@Stage\n\nwhen flag clicked\nswitch backdrop to (temple v)\nforever\n    play sound [song v] until done\nend\n\nwhen I receive [next level v]\nif <(Level) = [4]> then\n    switch backdrop to (slopes v)\nend\n\n@Guy\n\nwhen I start as a clone\nswitch costume to (trail1 v)\nclear graphic effects\nrepeat (8)\n    change size by (-4)\n    change [ghost v] effect by (10)\n    change [brightness v] effect by (10)\nend\ndelete this clone\n\nwhen flag clicked\nSetup\nbroadcast (Game Loop v)\n\ngo to x: (-190) y: (-24)\ngo to x: (-201) y: (14)\n\nwhen flag clicked\n\ndefine Fix Collisions in direction (dir)\nset [temporary dir v] to (direction)\nset [distance v] to [1]\npoint in direction (dir)\nrepeat (168)\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 (ground v)?> or <touching (sword button v)?>> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\nend\n\nhide variable [speed x v]\n\nwhen flag clicked\nforever\n    Check Touching Solid\n    if <(touching) > [0]> then\n        Fix Collisions in direction [0]\n        Fix Collisions in direction [90]\n    end\nend\n\ndefine Setup\ngo to x: (-200) y: (50)\npoint in direction (90)\nshow\ngo to [front v] layer\nclear graphic effects\nset size to (45) %\nswitch costume to (middle v)\nset drag mode [not draggable v]\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [level v] to [1]\n\ndefine Left / Right Movement\nif <<<mouse down?> and <(x position) > (mouse x)>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    change [speed x v] by (-1)\n    point in direction (-90)\nend\nif <<<mouse down?> and <(x position) < (mouse x)>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    change [speed x v] by (1)\n    point in direction (90)\nend\nset [speed x v] to ((speed x) * (0.9))\nchange x by (speed x)\n\nwhen I receive [game loop v]\nset [dead? v] to [0]\nforever\n    create clone of (_myself_ v)\n    Set Costume\n    Left / Right Movement\n    Horizontal Collision and Wall Jump\n    Up / Down Movement\n    Check Death / Win\nend\n\ndefine Horizontal Collision and Wall Jump\nCheck Touching Solid\nif <(touching) = [1]> then\n    change y by (1)\n    Check Touching Solid\n    if <(touching) = [1]> then\n        change y by (1)\n        Check Touching Solid\n        if <(touching) = [1]> then\n            change y by (1)\n            Check Touching Solid\n            if <(touching) = [1]> then\n                change y by (1)\n                Check Touching Solid\n                if <(touching) = [1]> then\n                    change y by (1)\n                    Check Touching Solid\n                    if <(touching) = [1]> then\n                        change x by ((speed x) * (-1))\n                        change y by (-5)\n                        if <<<mouse down?> and <(y position) < (mouse y)>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n                            if <(speed x) > [0]> then\n                                set [speed x v] to [-7]\n                            else\n                                set [speed x v] to [7]\n                            end\n                            set [speed y v] to [14]\n                        else\n                            set [speed x v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (-3)\n\ndefine Up / Down Movement\nCheck Touching Solid\nif <(touching) = [1]> then\n    if <<<mouse down?> and <(y position) < (mouse y)>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        set [speed y v] to [14]\n    end\nend\nchange y by (3)\nchange [speed y v] by (-1)\nchange y by (speed y)\nCheck Touching Solid\nif <(touching) = [1]> then\n    change y by ((speed y) * (-1))\n    set [speed y v] to [0]\nend\n\ndefine Check Death / Win\nif <(x position) > [230]> then\n    change [level v] by (1)\n    broadcast (next level v)\nend\nif <(y position) < [-170]> then\n    broadcast (Death v)\nend\nif <touching (spike v)?> then\n    broadcast (Death v)\nend\nif <touching (lava v)?> then\n    broadcast (Death v)\nend\nif <touching (saw v)?> then\n    broadcast (Death v)\nend\n\nwhen I receive [next level v]\nset [speed y v] to [0]\nset [speed x v] to [0]\nif <(Level) = [12]> then\n    go to x: (-235) y: (100)\nelse\n    go to x: (-245) y: (-50)\nend\n\nwhen I receive [death v]\nstop [other scripts in sprite v]\nset [dead? v] to [1]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nclear graphic effects\nif <(Level) = [12]> then\n    go to x: (-235) y: (100)\nelse\n    go to x: (-235) y: (-50)\nend\nset [speed y v] to [0]\nset [speed x v] to [0]\nshow\nbroadcast (Game Loop v)\ndelete this clone\n\ndefine Set Costume\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<((mouse y) + (-20)) > (y position)> and <mouse down?>>> and <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<((mouse x) + (15)) > (x position)> and <mouse down?>>>> then\n    switch costume to (right v)\nelse\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<((mouse y) + (-20)) > (y position)> and <mouse down?>>> and <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<((mouse x) - (15)) < (x position)> and <mouse down?>>>> then\n        switch costume to (left v)\n    else\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<((mouse y) + (-20)) > (y position)> and <mouse down?>>> then\n            switch costume to (up v)\n        else\n            if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<((mouse x) - (-20)) > (x position)> and <mouse down?>>> then\n                switch costume to (right v)\n            else\n                if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<((mouse x) + (-20)) < (x position)> and <mouse down?>>> then\n                    switch costume to (left v)\n                else\n                    switch costume to (middle v)\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [death v]\n\nwhen I receive [game loop v]\ndelete this clone\n\nwhen I receive [game loop v]\n\nFix Collisions in direction [0]\nFix Collisions in direction [90]\n\nwhen I receive [next level v]\nwait (0.01) seconds\nFix Collisions in direction [0]\n\nwhen I receive [90 v]\nset [speed y v] to [20]\nchange y by (speed y)\n\nwhen I receive [-90 v]\nset [speed y v] to [-20]\nchange y by (speed y)\n\nstop [this script v]\n\nwhen I receive [180 v]\nset [speed x v] to [25]\n\nwhen I receive [next level v]\nFix Collisions in direction [0]\n\nwhen I receive [game loop v]\nFix Collisions in direction [0]\nforever\n    Check Touching Solid\n    if <(touching) > [0]> then\n        Fix Collisions in direction [0]\n        Fix Collisions in direction [90]\n    end\nend\n\nwhen I receive [bounce v]\nset [speed y v] to [10]\n\ngo to [back v] layer\n\n@ground\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\npoint in direction (90)\ngo to [front v] layer\ngo [backward v] (2) layers\nswitch costume to (join [Level] (Level))\n\nwhen I receive [next level v]\nswitch costume to (join [Level] (Level))\n\nswitch costume to (level1 v)\n\nnext costume\n\n@Lava\n\nwhen I receive [next level v]\ngo to [back v] layer\ngo to x: (0) y: (0)\n\nif <(Level) = [4]> then\n    show\n    switch costume to (lava0 v)\n    forever\n        change [frame v] by (0.4)\n        set y to ((5) * ([sin v] of ((timer) * (150)) ))\n        switch costume to (join [lava] (([floor v] of (frame) ) mod (4)))\n    end\nend\nif <(Level) = [5]> then\n    show\n    switch costume to (lava2.0 v)\n    forever\n        change [frame v] by (0.4)\n        set y to ((5) * ([sin v] of ((timer) * (150)) ))\n        switch costume to (join [lava2.] (([floor v] of (frame) ) mod (4)))\n    end\nend\nif <(Level) = [7]> then\n    show\n    switch costume to (costume3 v)\n    forever\n        change [frame v] by (0.4)\n        set y to ((5) * ([sin v] of ((timer) * (150)) ))\n        switch costume to (join [lava3.] (([floor v] of (frame) ) mod (4)))\n    end\nend\nhide\n\nwhen flag clicked\nhide\n\nnext costume\n\n@Spike\n\nwhen flag clicked\nshow\nswitch costume to (1 v)\n\nwhen I receive [next level v]\ngo to [back v] layer\nclear graphic effects\ngo to [back v] layer\nif <(Level) = [4]> then\n    show\n    switch costume to (4 v)\n    stop [this script v]\nend\nif <(Level) = [8]> then\n    show\n    switch costume to (8 v)\n    stop [this script v]\nend\nif <(Level) = [9]> then\n    show\n    switch costume to (9 v)\n    stop [this script v]\nend\nhide\n\n@Trampoline\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nif <[] < [50]> then\n    delete this clone\nend\ngo to [back v] layer\nClone at [15] [-48] level [9] dir [90]\n\nwait (0) seconds\n\nwhen I start as a clone\nshow\nforever\n    go to [back v] layer\n    if <touching (guy v)?> then\n        switch costume to (costume1 v)\n        broadcast (direction)\n        wait (0.08) seconds\n        switch costume to (spring2 v)\n        wait (0.05) seconds\n    end\nend\n\nwhen I receive [next level v]\n\nchange y by (50)\n\ndefine Clone at (x) (y) level (level) dir (dir)\nif <(Level) = (level)> then\n    go to x: (x) y: (y)\n    point in direction (dir)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [next level v]\nwait (0) seconds\n\ngo to x: (-60) y: (-60)\n\n@Saw\n\nwhen I receive [next level v]\ngo to [back v] layer\nif  then\n    delete this clone\nend\nClone at [-89] [-87] size [120] level [4]\nClone at [180] [-87] size [80] level [4]\n\nwait (0) seconds\n\ngo to x: (-120) y: (-106)\nset size to (150) %\ncreate clone of (_myself_ v)\n\nif <(Level) = [14]> then\n    set size to (80) %\n    go to x: (-23) y: (123)\n    create clone of (_myself_ v)\nend\nif <(Level) = [16]> then\n    set size to (120) %\n    go to x: (-71) y: (-118)\n    create clone of (_myself_ v)\n    go to x: (131) y: (-57)\n    create clone of (_myself_ v)\nend\nhide\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nforever\n    turn left (15) degrees\nend\n\ndelete this clone\n\nwhen I receive [next level v]\n\ndefine Clone at (x) (y) size (size) level (level)\nif <(Level) = (level)> then\n    go to x: (x) y: (y)\n    set size to (size) %\n    create clone of (_myself_ v)\nend\n\nset size to (140) %\n\nchange x by (-20)\n\nchange y by (-10)\n\nClone at [-76] [-118] size [120] level [2]\nClone at [-8] [68] size [120] level [2]\nClone at [-240] [68] size [120] level [2]\nClone at [200] [68] size [120] level [2]\nClone at [-93] [-93] size [120] level [7]\nClone at [-72] [67] size [120] level [12]\nClone at [144] [21] size [120] level [13]\ngo to x: (131) y: (-57)\nset size to (120) %\n\n@Cloud\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\nswitch costume to (big v)\nset x to (280)\n\nwhen I start as a clone\nshow\nswitch costume to (pick random (1) to (5))\nset [costume v] to (costume [number v])\nset [ghost v] effect to (pick random (30) to (70))\nset y to (pick random (80) to (180))\nset [sx v] to (pick random (3.) to (5.))\nrepeat ((600) / (sx))\n    go to [front v] layer\n    switch costume to (big v)\n    change x by ((-1) * (sx))\n    switch costume to (costume)\nend\ndelete this clone\n\nwhen I receive [next level v]\nif <(Level) = [3]> then\nend\n\nCreate Cloud\n\nstop [other scripts in sprite v]\ndelete this clone\n\nset [ghost v] effect to (20)\nshow\n\ndefine Create Cloud\nforever\n    switch costume to (big v)\n    create clone of (_myself_ v)\n    wait (pick random (1.) to (2.)) seconds\nend\n\nforever\n\n@Word\n\nwhen flag clicked\ngo to x: (0) y: (0)\npoint in direction (90)\nshow\nswitch costume to (join [Level] (Level))\ngo to [front v] layer\ngo [backward v] (1) layers\n\nwhen I receive [next level v]\nswitch costume to (join [Level] (Level))\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\ngo to x: (0) y: (0)\npoint in direction (90)\ngo to [front v] layer\nshow\n\n@Enemy\n\ndefine Spawn (type) at (x) (y) level (level) dir (dir) size (size) with (weapon) size (weapon size)\nif <(type) = []> then\n    if <(level) = (Level)> then\n        switch costume to (type)\n        go to x: (x) y: (y)\n        point in direction (dir)\n        set size to (size) %\n        set [type v] to (type)\n        create clone of (_myself_ v)\n        if <(weapon) > []> then\n            switch costume to (weapon)\n            set [type v] to (weapon)\n            set size to (weapon size) %\n            create clone of (_myself_ v)\n        end\n        set [type v] to []\n    end\nend\n\nwhen I start as a clone\nshow\nclear graphic effects\nset [frame v] to []\nset [touching v] to [0]\nif <(type) = [Slime]> then\n    Spawn Slime\nend\nif <(type) = [Tall]> then\n    Spawn Tall\nend\nif <(type) = [Spiky]> then\n    Spawn Spiky\nend\nif <(type) = [spear*]> then\n    set rotation style [all around v]\n    Spawn spear\nend\nif <(type) = [sword*]> then\n    spawn sword*\nend\nif <(type) = [UFO]> then\n    Spawn UFO\nend\nif <(type) = [saw*]> then\n    Spawn saw*\nend\nMove - Down\nforever\n    point towards (guy v)\nend\n\nwhen I receive [next level v]\nwait (0) seconds\nSpawn All Enemies\n\nwhen flag clicked\nset [frame v] to [0]\nset [type v] to []\nset rotation style [left-right v]\nhide\n\ndefine Move - Down\nchange [sy v] by (-1)\nchange y by (sy)\nrepeat until <not <touching (ground v)?>>\n    change y by (1)\n    set [sy v] to [0]\n    set [touching v] to [1]\nend\n\ndefine Move - Left or Right\nmove (2) steps\nrepeat (4)\n    if <not <<touching (ground v)?> or <<touching (_edge_ v)?> or <touching (invisible enemy wall v)?>>>> then\n        stop [this script v]\n    end\n    change y by (1)\nend\nchange y by (-4)\nmove (-2) steps\nturn right (180) degrees\n\ndefine Touching Player?\nif <touching (guy v)?> then\n    if <(speed y) < [-2]> then\n        switch costume to (join (costume [name v]) [Squish])\n        broadcast (Bounce v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        delete this clone\n    else\n        if <(DEAD?) = [0]> then\n            broadcast (Death v)\n        end\n    end\nend\n\nwhen I receive [game loop v]\nwait (0) seconds\nSpawn All Enemies\n\nwhen I receive [game loop v]\ndelete this clone\n\ndefine Spawn Slime\nforever\n    if <(frame) = [20]> then\n        set [sy v] to [8]\n        set [frame v] to [0]\n    end\n    Move - Down\n    Move - Left or Right\n    Touching Player?\n    change [frame v] by (0.5)\nend\n\ndefine Spawn Tall\nforever\n    Move - Down\n    Move - Left or Right\n    Touching Player?\nend\n\nwhen I receive [next level v]\ndelete this clone\n\ndefine Spawn All Enemies\nSpawn [Sword] at [0] [-70] level [2] dir [-90] size [60] with [sword*] size [70]\nSpawn [Sword] at [50] [-75] level [3] dir [-90] size [60] with [sword*] size [70]\nSpawn [Spear] at [-70] [-75] level [3] dir [-90] size [60] with [spear*] size [70]\nSpawn [UFO] at [-50] [120] level [5] dir [-90] size [60] with [] size []\nSpawn [UFO] at [140] [120] level [5] dir [-90] size [60] with [] size []\nSpawn [UFO] at [140] [120] level [6] dir [-90] size [60] with [] size []\nSpawn [Spear] at [0] [-72] level [6] dir [-90] size [60] with [spear*] size [70]\nSpawn [UFO] at [-20] [120] level [7] dir [-90] size [60] with [] size []\nSpawn [Sword] at [-8] [-70] level [7] dir [-90] size [60] with [sword*] size [70]\nSpawn [Slime] at [-80] [40] level [8] dir [90] size [60] with [] size []\nSpawn [Spiky] at [-2] [-60] level [8] dir [-90] size [60] with [] size []\nSpawn [Slime] at [180] [-80] level [8] dir [-90] size [60] with [] size []\nSpawn [Tall] at [-54] [-31] level [9] dir [-90] size [60] with [] size []\nSpawn [Sword] at [-24] [-68] level [10] dir [-90] size [60] with [sword*] size [70]\nSpawn [Spear] at [132] [-92] level [10] dir [-90] size [60] with [spear*] size [70]\nSpawn [UFO] at [-20] [120] level [11] dir [-90] size [60] with [] size []\nSpawn [Sword] at [-24] [-68] level [13] dir [-90] size [60] with [sword*] size [70]\nSpawn [Spear] at [132] [-92] level [13] dir [-90] size [60] with [spear*] size [70]\nSpawn [UFO] at [-20] [120] level [13] dir [-90] size [60] with [] size []\nSpawn [UFO] at [-20] [120] level [14] dir [-90] size [60] with [] size []\nSpawn [UFO] at [-100] [120] level [14] dir [-90] size [60] with [] size []\nSpawn [UFO] at [100] [120] level [14] dir [-90] size [60] with [] size []\nSpawn [UFO] at [200] [120] level [14] dir [-90] size [60] with [] size []\nSpawn [UFO] at [20] [120] level [14] dir [-90] size [60] with [] size []\nSpawn [UFO] at [-200] [120] level [14] dir [-90] size [60] with [] size []\n\ndefine Spawn Spiky\nforever\n    if <(frame) = [20]> then\n        set [sy v] to [8]\n        set [frame v] to [0]\n    end\n    Move - Down\n    Move - Left or Right\n    if <<touching (guy v)?> and <(DEAD?) = [0]>> then\n        broadcast (Death v)\n    end\n    change [frame v] by (0.5)\nend\n\nbroadcast (next level v)\n\ndefine Spawn spear\nforever\n    go to [back v] layer\n    point towards (guy v)\n    if <(distance to [guy v]) < [120]> then\n        Poke them\n    end\nend\n\ndefine Poke them\nrepeat (4)\n    move (2) steps\nend\nrepeat (4)\n    move (-2) steps\nend\n\ndelete this clone\n\nset [type v] to []\n\nwait (0.2) seconds\n\ndefine Check Death\nforever\n    if <<<touching (guy v)?> and <(DEAD?) = [0]>> and <(can use?) = [1]>> then\n        broadcast (Death v)\n    end\nend\n\nwhen I start as a clone\nset [can use? v] to [1]\nif < (type) contains [*]?> then\n    set rotation style [all around v]\n    Check Death\nend\n\nSpawn spear\n\nbroadcast (next level v)\n\ndefine spawn sword*\nforever\n    go to [back v] layer\n    if <([x position v] of [guy v]) > (x position)> then\n        point in direction (90)\n    else\n        point in direction (-90)\n    end\n    set rotation style [all around v]\n    if <(distance to [guy v]) < [120]> then\n        repeat (36)\n            turn right (10) degrees\n        end\n    end\nend\n\nwhen I start as a clone\nset [life v] to [3]\nforever\n    if <touching (weapon v)?> then\n        if <not <(type) = [saw*]>> then\n            set [can use? v] to [0]\n            if <(WEAPON) = [gun]> then\n                change [life v] by (-1)\n                if <(life) = [0]> then\n                    repeat (10)\n                        change [ghost v] effect by (10)\n                    end\n                    delete this clone\n                end\n                wait until <not <touching (weapon v)?>>\n            else\n                repeat (10)\n                    change [ghost v] effect by (10)\n                end\n                delete this clone\n            end\n        end\n    end\nend\n\ndefine Spawn UFO\nforever\n    if <(([x position v] of [guy v]) - (x position)) > [0]> then\n        change x by (2)\n    else\n        if <(([x position v] of [guy v]) - (x position)) < [0]> then\n            change x by (-2)\n        end\n    end\n    if <([abs v] of (([x position v] of [guy v]) - (x position)) ) < [80]> then\n        change [frame v] by (0.2)\n        if <(frame) > [2]> then\n            set [frame v] to [0]\n            set [shoot saw v] to [1]\n            set [type v] to [saw*]\n            create clone of (_myself_ v)\n            set [type v] to [UFO]\n        end\n    end\nend\n\ndefine Spawn saw*\nswitch costume to (saw* v)\nforever\n    if <(Shoot saw) = [1]> then\n        set [shoot saw v] to [0]\n        repeat until <<(touching) = [1]> or <touching (guy v)?>>\n            turn right (5) degrees\n            Move - Down\n        end\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        delete this clone\n    end\nend\n\ndefine Spawn shuriken*\nforever\n    point towards (guy v)\nend\n\n@Glow\n\nwhen I receive [next level v]\nhide\n\nif <(Level) = [14]> then\n\nset [ghost v] effect to (50)\nshow\n\nwhen flag clicked\nshow\nswitch costume to (download-removebg-preview v)\nset size to (60) %\ngo to x: (0) y: (120)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [next level v]\n\nif <(Level) = [11]> then\n    hide\n    switch backdrop to (slopes v)\nend\n\nbroadcast (next level v)\n\n@Arrow and bow\n\nwhen I start as a clone\nshow\nif <(type) = [arrow]> then\n    set [type v] to []\n    set [reflect v] to [0]\n    switch costume to (arrow v)\n    repeat until <not <<touching (ground v)?> or <touching (_edge_ v)?>>>\n        move (15) steps\n    end\n    repeat until <<touching (guy v)?> or <<touching (ground v)?> or <<touching (_edge_ v)?> or <touching (weapon v)?>>>>\n        move (15) steps\n    end\n    if <touching (weapon v)?> then\n        turn right (180) degrees\n        repeat until <<touching (guy v)?> or <<touching (ground v)?> or <touching (_edge_ v)?>>>\n            move (15) steps\n        end\n    end\n    if <touching (guy v)?> then\n        broadcast (Death v)\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen I receive [next level v]\nset [type v] to []\nif  then\n    delete this clone\nend\nif <(Level) = [2]> then\n    set [type v] to [bow]\n    go to x: (-30) y: (58)\n    create clone of (_myself_ v)\n    set [type v] to [bow]\n    go to x: (235) y: (58)\n    create clone of (_myself_ v)\nend\nif <(Level) = [3]> then\n    set [type v] to [bow]\n    go to x: (150) y: (134)\n    create clone of (_myself_ v)\nend\nif <(Level) = [11]> then\n    set [type v] to [bow]\n    go to x: (164) y: (126)\n    go to [front v] layer\n    create clone of (_myself_ v)\nend\n\ndefine Animation\nswitch costume to (bow 0 v)\nwait (1) seconds\nrepeat (10)\n    next costume\nend\nwait (1) seconds\nset [type v] to [arrow]\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [type v] to []\n\nwhen I start as a clone\nif <(type) = [bow]> then\n    forever\n        Animation\n    end\nend\n\nwhen I start as a clone\nif <(type) = [bow]> then\n    forever\n        point towards (guy v)\n    end\nend\n\nbroadcast (next level v)\n\nset [type v] to [bow]\ngo to x: (-180) y: (50)\ncreate clone of (_myself_ v)\n\n@Weapon\n\nwhen [space v] key pressed\nif <(WEAPON) = [sword]> then\n    broadcast (Swing Sword v)\nelse\n    if <(frame) > [5]> then\n        if <(bullet) > [0]> then\n            broadcast (Shoot v)\n            change [bullet v] by (-1)\n            set [frame v] to [0]\n        end\n    end\nend\n\nwhen flag clicked\nset [weapon v] to [sword]\nset [sword v] to [1]\nset [gun v] to [0]\nset [bullet v] to [10]\nhide\nforever\n    go to (guy v)\nend\n\nwhen I receive [next level v]\nforever\n    go to (guy v)\n    if <(WEAPON) = [gun]> then\n        show\n        point towards (mouse-pointer v)\n        go to [front v] layer\n        if <(direction) > [0]> then\n            switch costume to (gun v)\n        else\n            switch costume to (gun2 v)\n        end\n    end\n    if <(WEAPON) = [sword]> then\n        go to [back v] layer\n    end\nend\n\nhide\n\nrepeat (10)\n\nturn right (15) degrees\n\nwhen I receive [swing sword v]\nif <<(sword) = [1]> and <(using) = [0]>> then\n    set [using v] to [1]\n    show\n    if <([direction v] of [guy v]) > [0]> then\n        switch costume to (sword v)\n        point in direction (15)\n        repeat (10)\n            turn right (15) degrees\n        end\n    else\n        switch costume to (sword2 v)\n        point in direction (-15)\n        repeat (10)\n            turn left (15) degrees\n        end\n    end\nend\nhide\nwait until <not <key (space v) pressed?>>\nset [using v] to [0]\n\nrepeat (10)\n    turn right (15) degrees\nend\n\nwhen flag clicked\nforever\n    if <key (z v) pressed?> then\n        if <(WEAPON) = [sword]> then\n            if <(gun) = [1]> then\n                set [weapon v] to [gun]\n                show\n            end\n        else\n            if <(WEAPON) = [gun]> then\n                set [weapon v] to [sword]\n                hide\n            end\n        end\n    end\n    wait until <not <key (z v) pressed?>>\nend\n\n\n\nwhen I start as a clone\nGo to gun\nswitch costume to (bullet v)\ngo to [back v] layer\nrepeat until <<touching (ground v)?> or <<touching (_edge_ v)?> or <touching (enemy v)?>>>\n    move (15) steps\nend\nrepeat (4)\n    change [ghost v] effect by (25)\nend\ndelete this clone\n\nwhen I receive [shoot v]\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [frame v] to [0]\nforever\n    change [frame v] by (1)\nend\n\nwhen I receive [got gun v]\nset [gun v] to [1]\nset [weapon v] to [gun]\n\ndefine Go to gun\nmove (10) steps\nif <(direction) > [0]> then\n    turn left (90) degrees\n    move (8) steps\n    turn right (90) degrees\nelse\n    turn right (90) degrees\n    move (8) steps\n    turn left (90) degrees\nend\n\nwait (1) seconds\nset [bullet v] to [10]\n\nwhen flag clicked\nforever\n    if <(bullet) = [0]> then\n        wait (1) seconds\n        set [bullet v] to [10]\n    end\nend\n\nwhen [1 v] key pressed\nset [weapon v] to [sword]\nhide\n\nwhen [2 v] key pressed\nset [weapon v] to [gun]\nshow\n\nwhen [r v] key pressed\nif <(bullet) < [10]> then\n    wait (1) seconds\n    set [bullet v] to [10]\nend\n\n@Sword button\n\nwhen I receive [next level v]\nif <(Level) = [10]> then\n    forever\n        if <([sword v] of [weapon v]) = [1]> then\n            show\n            switch costume to (costume2 v)\n        end\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Swing Sword v)\n\nwhen flag clicked\ngo to x: (52) y: (-46)\nhide\n\nhide\n\ngo [backward v] (1) layers\n\nwhen [s v] key pressed\nif <([sword v] of [weapon v]) = [1]> then\n    go to [front v] layer\n    next costume\nend\n\ngo to (weapon v)\n\n@weaponnnn\n\nwhen I receive [next level v]\nif <(Level) = [12]> then\n    go to x: (6) y: (77)\n    show\n    point in direction (60)\n    forever\n        if <touching (guy v)?> then\n            broadcast (got gun v)\n            hide\n            stop [this script v]\n        end\n    end\nend\n\n@Tips\n\nwhen I receive [next level v]\nif <(Level) = [14]> then\n    show\n    switch costume to (tips v)\n    go to [front v] layer\n    go to x: (-172) y: (-157)\n    stop [this script v]\nend\nhide\n\nwhen this sprite clicked\ngo to x: (0) y: (0)\nswitch costume to (full tips v)\ngo to [front v] layer\ngo to [front v] layer\nwait (3) seconds\nswitch costume to (tips v)\ngo to x: (-172) y: (-157)\n\n