Top Down Survival Shooter In Godot | Part 2 - Player Movement

Поделиться
HTML-код
  • Опубликовано: 1 июн 2024
  • Learn how to make a game from scratch in Godot. This survival shooter will be a top down game with 8 directional movement. Endless waves of enemies attack the player with each wave getting more and more difficult.
    In this part, I focus on creating the player and adding 8 directional movement.
    Explanation of 8 directional movement by kidscancode here: kidscancode.org/godot_recipes...
    Code and assets for this video: github.com/russs123/Prairie_K...
    Credits for images
    Character: axulart.itch.io/small-8-direc...
    Goblins: 0x72.itch.io/dungeontileset-ii
    Tileset: cupnooble.itch.io/sprout-land...
    Pistol: arcadeisland.itch.io/guns-ass...
    Coffee: skalding.itch.io/coffee-cup-001

Комментарии • 16

  • @JameishLestray
    @JameishLestray 5 месяцев назад +1

    Finally!!! Thanks Russ! Can't wait for part 3!! Please do make a platformer tutorial like Coco code did!! You two are the best at explaining and are my favorite teachers!!

  • @Lansamatv
    @Lansamatv 5 месяцев назад

    You are truly the best, you don't know how much I love you. ❤

  • @swachi101
    @swachi101 5 месяцев назад

    Love your videos, very informative

  • @ivanyosifov2629
    @ivanyosifov2629 5 месяцев назад +2

    9:11 - I'm confused. We use position variable that we didn't declare previously. Same with velocity.

    • @CodingWithRuss
      @CodingWithRuss  5 месяцев назад +1

      These variables are part of the CharacterBody2D Node already. When the script is created, the first line is "extends CharacterBody2D" and what this means is that the script can use all the functions and variables that are part of that Node. That includes the position and velocity variables. Hope that helps!

    • @ivanyosifov2629
      @ivanyosifov2629 5 месяцев назад +1

      Yes, thank you. That explained enough to understand what's going on

  • @kriftik1945
    @kriftik1945 5 месяцев назад

    Keep it up!🤩

  • @Snyper-if3kt
    @Snyper-if3kt 2 месяца назад +1

    So with the input_dir variable it doesn't actually need to be normalized. Part of the Input.getvector function is that it does do that for you. I saw this as strange and so I checked the numbers (not just with the eye test). And the velocity was indeed normalized be itself.
    For added thought though I add the normalized function onto input_dir and low and behold, the result came back the same so its not hurting anything if its there, its just not needed.🙂

    • @CodingWithRuss
      @CodingWithRuss  2 месяца назад +1

      Ah that's handy to know! Thanks for checking it 🙂

  • @JustAChannel11631
    @JustAChannel11631 5 месяцев назад +1

    Love your channel. 2 questions if I may: 1) Why you picked Godot for it? 2) What do you think the best language/engine to make light 2d games?

    • @keznoAU
      @keznoAU 26 дней назад

      godot is best for small and large 2d games unity good for 2d games and smaller 3d games unreal good for large 3d games

  • @rolodagger4386
    @rolodagger4386 4 месяца назад

    Viewport rect size function doesn't work for me, it doesn't start my scene from point 0,0 so i can't get near the east and northern gaps. Any idea what's wrong?

  • @rezashir3873
    @rezashir3873 5 месяцев назад

    very good😍

  • @swachi101
    @swachi101 5 месяцев назад +3

    I was the First to like🎉🎉🎉

  • @Lansamatv
    @Lansamatv 5 месяцев назад

    Please make it survival io style, like this a rougelike

  • @arbozaliyan
    @arbozaliyan 3 месяца назад +2

    var mouse_position= get_local_mouse_position()
    var angle = rad_to_deg(atan2(mouse_position.x , mouse_position.y))
    if angle > -22.5 and angle < 22.5:
    $AnimatedSprite2D.play("walk_D")
    elif angle > 22.5 and angle < 67.5:
    $AnimatedSprite2D.play("walk_DR")
    elif angle > -67.5 and angle < -22.5:
    $AnimatedSprite2D.play("walk_DL")
    elif angle < -157.5 or angle > 157.5:
    $AnimatedSprite2D.play("walk_U")
    elif angle > 112.5 and angle < 157.5:
    $AnimatedSprite2D.play("walk_UR")
    elif angle > -157.5 and angle < -112.5:
    $AnimatedSprite2D.play("walk_UL")
    elif angle < 112.5 and angle > 67.5:
    $AnimatedSprite2D.play("walk_R")
    elif angle > -112.5 and angle < -67.5:
    $AnimatedSprite2D.play("walk_L")
    if velocity.length() == 0:
    $AnimatedSprite2D.stop()
    $AnimatedSprite2D.frame= 1
    This is what i did