Bad Jokes- a Platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (cave v)\nset volume to (100) %\nforever\n    play sound [song v] until done\nend\n\nwhen I receive [next level v]\nif <(Level) = [15]> then\n    switch backdrop to (desert 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 <(KEY X) < [0]> then\n    change [speed x v] by (-1)\n    point in direction (-90)\nend\nif <(KEY X) > [0]> 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 Variable\n    Set Costume\n    if <touching (water v)?> then\n        Water movement\n    else\n        Left / Right Movement\n        Horizontal Collision and Wall Jump\n        Up / Down Movement\n    end\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 <(KEY Y) > [0]> 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 <(KEY Y) > [0]> 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\ngo to x: (-235) y: (-50)\nset [speed y v] to [0]\nset [speed x v] to [0]\nshow\nbroadcast (Game Loop v)\n\nif <(Level) = [12]> then\n    go to x: (-235) y: (100)\nelse\nend\n\ndelete this clone\n\ndefine Set Costume\nif <<(KEY X) > [0]> and <(KEY Y) > [0]>> then\n    switch costume to (right v)\nelse\n    if <<(KEY X) < [0]> and <(KEY Y) > [0]>> then\n        switch costume to (left v)\n    else\n        if <(KEY Y) > [0]> then\n            switch costume to (up v)\n        else\n            if <(KEY X) > [0]> then\n                switch costume to (right v)\n            else\n                if <(KEY X) < [0]> 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 [game loop v]\nforever\n    if <not <touching (water v)?>> then\n        Check Touching Solid\n        if <(touching) > [0]> then\n            Fix Collisions in direction [90]\n        end\n    end\nend\n\nFix Collisions in direction [0]\n\nwhen I receive [bounce v]\nset [speed y v] to [10]\n\ngo to [back v] layer\n\ndefine Water movement\nif <(KEY X) > [0]> then\n    change [speed x v] by (1)\nend\nif <(KEY X) < [0]> then\n    change [speed x v] by (-1)\nend\nif <(KEY Y) > [0]> then\n    change [speed y v] by (1)\nend\nif <(speed y) < [0.1]> then\n    change [speed y v] by (-0.8)\nend\nset [speed x v] to ((speed x) * (0.8))\nset [speed y v] to ((speed y) * (0.8))\nchange x by (speed x)\nCheck Touching Solid\nif <(touching) > [0]> then\n    Fix Collisions in direction [90]\nend\nchange y by (speed y)\nCheck Touching Solid\nif <(touching) > [0]> then\n    Fix Collisions in direction [0]\nend\n\ndefine Set Variable\nset [key x v] to (<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<((mouse x) - (-20)) > (x position)> and <mouse down?>>> - <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<((mouse x) + (-20)) < (x position)> and <mouse down?>>>)\nset [key y v] to <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<((mouse y) + (-20)) > (y position)> and <mouse down?>>>\n\nwhen I receive [next level v]\nFix Collisions in direction [0]\n\nif <([abs v] of (speed x) ) > [0.6]> then\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 flag clicked\nhide\n\nnext costume\n\nwhen I receive [next level v]\ngo to [back v] layer\ngo to x: (0) y: (0)\nif <(Level) = [3]> 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 [lava4.] (([floor v] of (frame) ) mod (4)))\n    end\nend\nif <(Level) = [14]> 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 [lava3.] (([floor v] of (frame) ) mod (4)))\n    end\nend\nhide\nhide\n\n@Spike\n\nwhen flag clicked\nshow\nswitch costume to (level1 v)\n\nwhen I receive [next level v]\nswitch costume to (blank v)\ngo to [back v] layer\nclear graphic effects\ngo to [back v] layer\nswitch costume to (join [Level] (Level))\n\nif <(Level) = [2]> then\n    show\nend\nif <(Level) = [8]> then\n    show\n    switch costume to (level5 v)\n    stop [this script v]\nend\nif <(Level) = [9]> then\n    show\n    switch costume to (level6 v)\n    stop [this script v]\nend\nhide\n\nstop [this script v]\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\nRandom clone [80] times at level [9]\n\nClone at [-114] [-81] level [2] dir [90]\n\nwait (0) seconds\n\nwhen I start as a clone\nshow\ngo to [back v] layer\nforever\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\ndefine Random clone (times) times at level (level)\nrepeat (times)\n    if <(pick random (1) to (4)) = [1]> then\n        Clone at (pick random (-240) to (240)) (pick random (-240) to (240)) level (level) dir [90]\n    else\n        if <(pick random (1) to (4)) = [2]> then\n            Clone at (pick random (-240) to (240)) (pick random (-240) to (240)) level (level) dir [-90]\n        else\n            if <(pick random (1) to (4)) = [3]> then\n                Clone at (pick random (-240) to (240)) (pick random (-240) to (240)) level (level) dir [0]\n            else\n                Clone at (pick random (-240) to (240)) (pick random (-240) to (240)) level (level) dir [180]\n            end\n        end\n    end\nend\n\nwhen I receive [reset trampoline v]\nif <[] < [50]> then\nend\ngo to [back v] layer\nRandom clone [80] times at level [9]\n\ndelete this clone\n\n@Saw\n\nwhen I receive [next level v]\ngo to [back v] layer\nif  then\n    delete this clone\nend\nClone at [-86] [-84] size [100] level [2]\nClone at [114] [-70] size [110] level [2]\nClone at [-121] [70] size [200] level [10]\nClone at [54] [-4] size [120] level [10]\nClone at [-66] [-126] size [100] level [10]\nClone at [200] [-118] size [100] level [10]\nClone at [200] [-25] size [100] level [10]\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 [-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 rotation style [left-right v]\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\nif <(type) = [Shuriken]> then\n    Spawn Shuriken\nend\nif <(type) = [Fish]> then\n    Spawn Fish\nend\nif <not <(type) = [shuriken*]>> then\n    Move - Down\n    forever\n        point towards (guy v)\n    end\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 [Slime] at [-64] [-64] level [4] dir [-90] size [60] with [] size []\nSpawn [Tall] at [109] [12] level [4] dir [-90] size [60] with [] size []\nSpawn [Spiky] at [150] [-20] level [4] dir [-90] size [60] with [] size []\nSpawn [Slime] at [37] [109] level [4] dir [-90] size [60] with [] size []\nSpawn [Shuriken] at [37] [48] level [5] dir [-90] size [60] with [] size []\nSpawn [Shuriken] at [0] [-72] level [6] dir [-90] size [60] with [] size []\nSpawn [Spear] at [140] [-72] level [6] dir [-90] size [60] with [spear*] size [70]\nSpawn [Fish] at [74] [-34] level [11] dir [-90] size [60] with [] size []\nSpawn [Fish] at [0] [0] level [11] dir [-90] size [60] with [] size []\nSpawn [Fish] at [-80] [100] level [11] dir [-90] size [60] with [] size []\nSpawn [Fish] at [-130] [81] level [12] dir [-90] size [60] with [] size []\nSpawn [Fish] at [158] [-108] level [12] dir [-90] size [60] with [] size []\nSpawn [Fish] at [-91] [-100] level [13] dir [-90] size [60] with [] size []\nSpawn [Shuriken] at [126] [33] level [13] 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    if <not <(type) = [shuriken*]>> then\n        set rotation style [all around v]\n        Check Death\n    end\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\nclear graphic effects\nset [life v] to [8]\nforever\n    if <touching (weapon v)?> then\n        if <not <<(type) = [saw*]> or <(type) = [shuriken*]>>> 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 (4)\n                        change [ghost v] effect by (25)\n                    end\n                    delete this clone\n                end\n            else\n                repeat (4)\n                    change [ghost v] effect by (25)\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\nshow\n\nswitch costume to (shuriken* v)\n\nmove (-10) steps\n\nmove (10) steps\n\ndefine Spawn Shuriken\nforever\n    wait (1) seconds\n    set [type v] to [shuriken*]\n    create clone of (_myself_ v)\n    set [type v] to [Shuriken]\nend\n\nwhen I start as a clone\nif <(type) = [shuriken*]> then\n    Spawn shuriken*\nend\n\nwhen I receive [delete me v]\nif <(type) = [Shuriken]> then\n    repeat (4)\n        change [ghost v] effect by (25)\n    end\n    delete this clone\nend\n\nwait until <not <touching (weapon v)?>>\n\ndefine Spawn shuriken*\nset rotation style [all around v]\npoint towards (guy v)\nswitch costume to (shuriken* v)\nrepeat until <<touching (guy v)?> or <<touching (ground v)?> or <<touching (_edge_ v)?> or <touching (weapon v)?>>>>\n    move (10) steps\nend\nif <touching (weapon v)?> then\n    if < ([costume name v] of [weapon v]) contains [Sword]?> then\n        turn right (180) degrees\n        repeat until <<touching (enemy v)?> or <<touching (ground v)?> or <touching (_edge_ v)?>>>\n            move (10) steps\n        end\n        if <touching (enemy v)?> then\n            broadcast (Delete me v)\n        end\n    else\n        repeat until <<touching (guy v)?> or <<touching (ground v)?> or <touching (_edge_ v)?>>>\n            move (10) steps\n        end\n    end\nend\nif <<touching (guy v)?> and <(DEAD?) = [0]>> then\n    broadcast (Death v)\nend\nrepeat (4)\n    change [ghost v] effect by (25)\nend\ndelete this clone\n\ndefine Spawn Fish\nforever\n    point towards (guy v)\n    if <(distance to [guy v]) < [180]> then\n        glide ((distance to [guy v]) / (200)) secs to (guy v)\n    end\nend\n\nbroadcast (next level v)\n\nwhen I start as a clone\nif <(type) = [Fish]> then\n    Check Death\nend\n\nwhen I start as a clone\nif <(type) = [Fish]> then\n    forever\n        Fix Collisions in direction [0]\n        Fix Collisions in direction [90]\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 (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)?> then\n    set [touching v] to [1]\nelse\n    set [touching v] to [0]\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\nhide\n\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\nend\n\nswitch backdrop to (slopes v)\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\n\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\nif <touching (guy v)?> then\n    broadcast (Death v)\nend\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 [1]\nset [bullet v] to [10]\nhide\nforever\n    go to (guy v)\nend\n\nwhen I receive [next level v]\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\nwait (0) seconds\ndelete this clone\n\nrepeat (4)\n    change [ghost v] effect by (25)\nend\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]\nswitch costume to (sword v)\nhide\n\nwhen [2 v] key pressed\nset [weapon v] to [gun]\nswitch costume to (gun v)\nshow\n\nwhen [r v] key pressed\nif <(bullet) < [10]> then\n    wait (1) seconds\n    set [bullet v] to [10]\nend\n\nwhen flag clicked\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\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]\n\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) = [9]> then\n    show\n    switch costume to (tips v)\n    go to x: (-172) y: (-157)\n    forever\n        go to [front v] layer\n    end\nend\nhide\n\nstop [this script v]\n\nwhen this sprite clicked\nbroadcast (reset trampoline v)\n\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@Water\n\ngo to [back v] layer\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\ngo to x: (0) y: (0)\nif <(Level) = [7]> then\n    show\n    switch costume to (l7.1 v)\n    forever\n        go to [back v] layer\n        change [frame v] by (0.4)\n        set y to ((5) * ([sin v] of ((timer) * (150)) ))\n        switch costume to (join [L7.] ((([floor v] of (frame) ) mod (4)) + (1)))\n    end\nend\nif <<(Level) = [8]> or <<(Level) = [9]> or <<(Level) = [10]> or <<(Level) = [11]> or <(Level) = [12]>>>>> then\n    show\n    switch costume to (lava0 v)\n    forever\n        go to [back v] layer\n        change [frame v] by (0.4)\n        set y to ((5) * ([sin v] of ((timer) * (150)) ))\n        switch costume to (join [L8.] ((([floor v] of (frame) ) mod (4)) + (1)))\n    end\nend\nif <(Level) = [13]> then\n    show\n    switch costume to (l13.1 v)\n    forever\n        go to [back v] layer\n        change [frame v] by (0.4)\n        set y to ((5) * ([sin v] of ((timer) * (150)) ))\n        switch costume to (join [L13.] ((([floor v] of (frame) ) mod (4)) + (1)))\n    end\nend\nif <(Level) = [14]> then\n    show\n    switch costume to (l14.1 v)\n    forever\n        go to [back v] layer\n        change [frame v] by (0.4)\n        set y to ((5) * ([sin v] of ((timer) * (150)) ))\n        switch costume to (join [L14.] ((([floor v] of (frame) ) mod (4)) + (1)))\n    end\nend\nhide\n\n
Move with WASD, or arrow keys. Use space, X, or M to swing your sword. Defeat all 5 enemies to beat the game! Defeat the 2 enemies at the end to complete the platformer. Avoid the skeleton's arrows and the zombies. There will be more coming soon!\n\n❤️ + ⭐ for a new skin!\nFollow me for more projects!\n\nPart 2: https://scratch.mit.edu/projects/835714828/\n\n\n\nInspired by @kuri-pa-2\nEnemies by @kuri-pa-2\nScrolling Engine by @Animator180\nSome textures are from @TrentonTNT\n@TimMcCool for the love and favorite detector\n\nMusic by CaptainSparklez