Lethal Platform // Dodge Game #games #platformer

Instructions: Check out my multiplayer scrolling platformer: https://scratch.mit.edu/projects/463302065\n\n◈ // Info\nA simple dodge game\nMight be a bit hard\n\n₸ // Instructions\n▶ Survive as long as you can\nWASD / arrow keys to move\n\n⇑ // Credits\nInspired by @Funut\nAll by me I think\n\n#games #all #dodge #lethal #platformer #platformers #danger #fun #hard

@Stage\n\n@Intro\n\nwhen flag clicked\nhide\nclear graphic effects\nwait (0.01) seconds\nswitch costume to (bg v)\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nswitch costume to (logo v)\ncreate clone of (_myself_ v)\nwait (0.8) seconds\nswitch costume to (text v)\ncreate clone of (_myself_ v)\nwait (2) seconds\nbroadcast (start v)\n\nwhen I start as a clone\nif <(costume [name v]) = [bg]> then\n    go to x: (0) y: (0)\n    set size to (100) %\n    show\nend\nif <(costume [name v]) = [logo]> then\n    point in direction (0)\n    go to x: (0) y: (0)\n    set size to (0) %\n    show\n    repeat (20)\n        change size by (((100) - (size)) / (3))\n        turn right (((90) - (direction)) / (3)) degrees\n    end\n    wait (0.1) seconds\n    repeat (30)\n        change x by (((-110) - (x position)) / (3))\n    end\n    wait (0.2) seconds\nend\nif <(costume [name v]) = [text]> then\n    go to x: (0) y: (0)\n    set size to (100) %\n    go [backward v] (1) layers\n    show\n    repeat (30)\n        change x by (((40) - (x position)) / (3))\n    end\nend\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@UI\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nclear graphic effects\nwait (0.5) seconds\nswitch costume to (title v)\ncreate clone of (_myself_ v)\nwait (0.5) seconds\nswitch costume to (play v)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(costume [name v]) = [title]> then\n    go to x: (0) y: (-180)\n    set size to (100) %\n    show\n    repeat (15)\n        change y by (((0) - (y position)) / (3))\n    end\n    wait (0) seconds\n    repeat (15)\n        change y by (((40) - (y position)) / (3))\n    end\n    wait (0) seconds\n    repeat (15)\n        change y by (((60) - (y position)) / (3))\n    end\nend\nif <(costume [name v]) = [play]> then\n    go to x: (0) y: (-180)\n    set size to (100) %\n    show\n    repeat (15)\n        change y by (((-40) - (y position)) / (3))\n    end\n    wait (0) seconds\n    repeat (15)\n        change y by (((-20) - (y position)) / (3))\n    end\n    forever\n        if <touching (mouse-pointer v)?> then\n            change size by (((110) - (size)) / (3))\n            if <mouse down?> then\n                broadcast (game v)\n            end\n        else\n            change size by (((100) - (size)) / (3))\n        end\n    end\nend\n\nwhen I receive [game v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@Platforms1\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nwait (1.5) seconds\nswitch costume to (main v)\ncreate clone of (_myself_ v)\nswitch costume to (master v)\n\nwhen I start as a clone\nif <(costume [name v]) = [main]> then\n    set size to (0) %\n    go to x: (0) y: (-180)\n    set size to (70) %\n    show\n    repeat (20)\n        change y by (((-55) - (y position)) / (3))\n    end\nend\nif <(costume [name v]) = [everything else]> then\n    set size to (0) %\n    go to x: (0) y: (-180)\n    set size to (70) %\n    go [backward v] (1) layers\n    set [ghost v] effect to (100)\n    show\n    repeat (20)\n        change size by (((100) - (size)) / (3))\n        change y by (((0) - (y position)) / (3))\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I receive [game v]\nwait (0.3) seconds\nif <(costume [name v]) = [master]> then\n    wait (0.2) seconds\n    switch costume to (everything else v)\n    create clone of (_myself_ v)\n    switch costume to (master v)\nelse\n    repeat (25)\n        change size by (((100) - (size)) / (3))\n        change y by (((0) - (y position)) / (3))\n    end\nend\n\nwhen I receive [start v]\ndelete this clone\n\n@Platforms2\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nwait (1.5) seconds\nswitch costume to (main v)\ncreate clone of (_myself_ v)\nswitch costume to (master v)\n\nwhen I start as a clone\nif <(costume [name v]) = [main]> then\n    set size to (0) %\n    go to x: (0) y: (-180)\n    set size to (70) %\n    show\n    repeat (20)\n        change y by (((-55) - (y position)) / (3))\n    end\nend\nif <(costume [name v]) = [everything else]> then\n    set size to (0) %\n    go to x: (0) y: (-180)\n    set size to (70) %\n    go [backward v] (1) layers\n    set [ghost v] effect to (100)\n    show\n    repeat (20)\n        change size by (((100) - (size)) / (3))\n        change y by (((0) - (y position)) / (3))\n        change [ghost v] effect by (-10)\n    end\nend\n\nwhen I receive [game v]\nwait (0.3) seconds\nif <(costume [name v]) = [master]> then\n    wait (0.2) seconds\n    switch costume to (everything else v)\n    create clone of (_myself_ v)\n    switch costume to (master v)\nelse\n    repeat (25)\n        change size by (((100) - (size)) / (3))\n        change y by (((0) - (y position)) / (3))\n    end\nend\n\nwhen I receive [start v]\ndelete this clone\n\n@Player\n\nwhen flag clicked\nhide\n\nwhen I receive [game v]\nset [player hp v] to [50]\ngo to x: (0) y: (180)\nwait (1) seconds\nset size to (25) %\nswitch costume to (idle v)\nset [🔒 xv v] to [0]\nset [🔒 yv v] to [0]\nset [🔒 slope v] to [0]\nset rotation style [left-right v]\nset [brightness v] effect to (18)\nshow\nrepeat until <<(y position) < [-180]> or <(player hp) < [1]>>\n    set [🔒 previous costume v] to (costume [name v])\n    switch costume to (hitbox v)\n    change [🔒 xv v] by (<<key (d v) pressed?> or <key (right arrow v) pressed?>> - <<key (a v) pressed?> or <key (left arrow v) pressed?>>)\n    change y by (-1)\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <touching (platforms1 v)?>> then\n        set [🔒 yv v] to [12]\n    end\n    change y by (1)\n    physics\n    point in direction ((([abs v] of (🔒 xv) ) / (🔒 xv)) * (90))\n    broadcast (🔒 player: animate v)\nend\nhide\nbroadcast (start v)\n\ndefine physics\nif <not <touching (platforms1 v)?>> then\n    change [🔒 yv v] by (-1)\nend\nchange y by (🔒 yv)\nif <touching (platforms1 v)?> then\n    repeat until <not <touching (platforms1 v)?>>\n        change y by ((([abs v] of (🔒 yv) ) / (🔒 yv)) * (-1))\n    end\n    set [🔒 yv v] to [0]\nend\nchange x by (🔒 xv)\nif <touching (platforms1 v)?> then\n    set [🔒 slope v] to [0]\n    repeat until <<(🔒 slope) = [-8]> or <not <touching (platforms1 v)?>>>\n        change [🔒 slope v] by (-1)\n        change y by (1)\n    end\n    if <(🔒 slope) = [-8]> then\n        change y by (🔒 slope)\n    end\n    repeat ([abs v] of ([ceiling v] of (🔒 xv) ) )\n        change x by ((([abs v] of (🔒 xv) ) / (🔒 xv)) * (-1.2))\n    end\n    set [🔒 xv v] to [0]\nend\nset [🔒 xv v] to ((🔒 xv) * (0.8))\n\nwhen I receive [🔒 player: animate v]\nswitch costume to (🔒 previous costume)\nif <<([floor v] of ([abs v] of (🔒 xv) ) ) > [0]> and <(🔒 yv) < [1]>> then\n    next costume\n    if <(costume [name v]) = [hitbox]> then\n        next costume\n        next costume\n    end\n    wait (0.02) seconds\nelse\n    switch costume to (idle v)\nend\n\nwhen I receive [game v]\nwait (1) seconds\nrepeat until <<(y position) < [-180]> or <(player hp) < [1]>>\n    if <touching (danger v)?> then\n        if <touching color (#ffff00)?> then\n            change [player hp v] by (-2)\n        else\n            change [player hp v] by (-7)\n        end\n        repeat (7)\n            create clone of (particles v)\n        end\n        wait until <not <touching (danger v)?>>\n    end\nend\n\n@Particles\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\npoint in direction (pick random (0) to (359))\ngo to x: ([x position v] of [player v]) y: ([y position v] of [player v])\nset size to (20) %\nset [🔒 xv v] to (([sin v] of (direction) ) * (pick random (-5) to (5)))\nset [🔒 yv v] to (([cos v] of (direction) ) * (pick random (-5) to (5)))\nset [ghost v] effect to (40)\nshow\nrepeat (20)\n    change [ghost v] effect by (5)\n    change x by (🔒 xv)\n    change y by (🔒 yv)\n    set [🔒 xv v] to ((🔒 xv) * (0.8))\n    change [🔒 yv v] by (-1)\nend\ndelete this clone\n\n@Danger\n\nwhen flag clicked\nhide\n\nwhen I receive [game v]\nwait (2) seconds\nforever\n    if <(pick random (1) to (3)) = [1]> then\n        if <(pick random (1) to (2)) = [1]> then\n            if <(pick random (1) to (2)) = [1]> then\n                go to x: (-240) y: (pick random (-180) to (180))\n            else\n                go to x: (240) y: (pick random (-180) to (180))\n            end\n        else\n            if <(pick random (1) to (2)) = [1]> then\n                go to x: (pick random (-240) to (240)) y: (-180)\n            end\n        end\n        repeat (pick random (3) to (6))\n            switch costume to (bullet v)\n            create clone of (_myself_ v)\n            wait (0.1) seconds\n        end\n    else\n        if <(pick random (1) to (3)) = [1]> then\n            switch costume to (missile v)\n            create clone of (_myself_ v)\n        else\n            if <(pick random (1) to (3)) = [1]> then\n                switch costume to (saw v)\n                create clone of (_myself_ v)\n            else\n                switch costume to (lazer v)\n                create clone of (_myself_ v)\n            end\n        end\n    end\n    wait (pick random (1) to (2)) seconds\nend\n\nwhen I start as a clone\nif <(costume [name v]) = [bullet]> then\n    point towards (player v)\n    turn right (pick random (-15) to (15)) degrees\n    move (20) steps\n    set size to (10) %\n    show\n    set [🔒 xv v] to (([sin v] of (direction) ) * (15))\n    set [🔒 yv v] to (([cos v] of (direction) ) * (15))\n    repeat until <<touching (_edge_ v)?> or <touching (player v)?>>\n        change x by (🔒 xv)\n        change y by (🔒 yv)\n        change [🔒 yv v] by (-1)\n        point in direction ([atan v] of ((🔒 xv) / (🔒 yv)) )\n    end\n    delete this clone\nend\nif <(costume [name v]) = [missile]> then\n    if <(pick random (1) to (2)) = [1]> then\n        if <(pick random (1) to (2)) = [1]> then\n            go to x: (-240) y: (pick random (-180) to (180))\n        else\n            go to x: (240) y: (pick random (-180) to (180))\n        end\n    else\n        if <(pick random (1) to (2)) = [1]> then\n            go to x: (pick random (-240) to (240)) y: (-180)\n        end\n    end\n    point towards (player v)\n    turn right (pick random (-20) to (20)) degrees\n    move (20) steps\n    set size to (60) %\n    show\n    set [🔒 xv v] to (([sin v] of (direction) ) * (25))\n    set [🔒 yv v] to (([cos v] of (direction) ) * (25))\n    repeat until <<([abs v] of (x position) ) > [240]> or <([abs v] of (y position) ) > [180]>>\n        change x by (🔒 xv)\n        change y by (🔒 yv)\n        change [🔒 yv v] by (-1)\n        point in direction ([atan v] of ((🔒 xv) / (🔒 yv)) )\n    end\n    delete this clone\nend\nif <(costume [name v]) = [saw]> then\n    if <(pick random (1) to (2)) = [1]> then\n        if <(pick random (1) to (2)) = [1]> then\n            go to x: (-240) y: (pick random (-180) to (180))\n        else\n            go to x: (240) y: (pick random (-180) to (180))\n        end\n    else\n        if <(pick random (1) to (2)) = [1]> then\n            go to x: (pick random (-240) to (240)) y: (-180)\n        end\n    end\n    point towards (player v)\n    turn right (pick random (-30) to (30)) degrees\n    move (70) steps\n    set size to (70) %\n    set [ghost v] effect to (100)\n    show\n    set [🔒 xv v] to (([sin v] of (direction) ) * (10))\n    set [🔒 yv v] to (([cos v] of (direction) ) * (10))\n    repeat until <<([abs v] of (x position) ) > [240]> or <([abs v] of (y position) ) > [180]>>\n        change [ghost v] effect by (-10)\n        change x by (🔒 xv)\n        change y by (🔒 yv)\n        change [🔒 yv v] by (-0.3)\n        turn right ((🔒 xv) * (2)) degrees\n    end\n    delete this clone\nend\nif <(costume [name v]) = [lazer]> then\n    point in direction (pick random (0) to (359))\n    go to x: (0) y: (0)\n    set size to (100) %\n    set [ghost v] effect to (100)\n    show\n    repeat (3)\n        change [ghost v] effect by (-20)\n    end\n    wait (0.5) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\ngo to x: (pick random (-240) to (240)) y: (180)\n\ngo to x: (pick random (-240) to (240)) y: (180)\n\ngo to x: (pick random (-240) to (240)) y: (180)\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\ndelete this clone\n\n@Player HP Indicator\n\nwhen flag clicked\nhide\n\nwhen I receive [game v]\nwait (0.01) seconds\ngo to x: (0) y: (0)\nset size to (100) %\nshow\nforever\n    set [ghost v] effect to (((100) * ((player hp) / (60))) + (30))\n    go to [front v] layer\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nhide\n\nwhen [timer v] > (0)\nhide\n\n@Score\n\nwhen flag clicked\nset [score v] to [0]\nhide\n\nwhen I receive [start v]\nwait (0.5) seconds\nswitch costume to (0 v)\nset [🔒 clone id v] to [0]\nrepeat (3)\n    change [🔒 clone id v] by (1)\n    create clone of (_myself_ v)\nend\nswitch costume to (master v)\n\nwhen I start as a clone\ngo to x: ((-235) + ((🔒 clone id) * (23))) y: (-155)\nset size to (50) %\nset [brightness v] effect to (10)\nforever\n    if <((🔒 clone id) - (1)) < (length of (score))> then\n        switch costume to (letter (🔒 clone id) of (score))\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [start v]\ndelete this clone\n\nwhen I receive [game v]\nif <(costume [name v]) = [master]> then\n    set [score v] to [0]\n    wait (1) seconds\n    repeat until <<([y position v] of [player v]) < [-180]> or <(player hp) < [1]>>\n        change [score v] by (1)\n        wait (1) seconds\n    end\nend\n\n@Thumb\n\nwhen flag clicked\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0)\ngo to x: (0) y: (0)\nset size to (100) %\nshow\n\n