How to Make a 2D Platformer in 20 Minutes (Godot Engine)

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ก.พ. 2025

ความคิดเห็น • 25

  • @Barveth
    @Barveth 3 ปีที่แล้ว +7

    15:11 Bonus:
    if you add the following line of code you can make your character do a wall jump too:
    if Input.is_action_just_pressed("jump") && is_on_wall():
    velocity.y=-jump_force

    • @whathuhwhatno
      @whathuhwhatno 2 ปีที่แล้ว

      having trouble getting it to work

  • @ivanmectin9106
    @ivanmectin9106 3 ปีที่แล้ว +2

    would be great if you could teach us how to make a simple 2d fighting game in godot :)

  • @ParthivRaju
    @ParthivRaju 4 ปีที่แล้ว +2

    Thank you very much, waiting for basic tutorial 🔥

  • @badstorygames5391
    @badstorygames5391 4 ปีที่แล้ว +2

    Great video. Waiting for the Tutorial)

  • @Bing4000
    @Bing4000 4 ปีที่แล้ว +1

    thank you, it was a very helpful tutorial, please make more godot tutorials.

    • @KaanAlparGameDev
      @KaanAlparGameDev  4 ปีที่แล้ว +1

      Your welcome, I will! Make sure to subscribe and ring the bell to get notified when I upload

  • @rtribbia
    @rtribbia 4 ปีที่แล้ว +1

    Excellent video- exactly what I was looking for! I'm new to the engine and was wondering why move_and_slide() is called before gravity/jumping velocity calculations are done, instead of after, since it takes velocity as a parameter. Thanks again!

  • @gurkanaktas497
    @gurkanaktas497 4 ปีที่แล้ว +1

    I just discovered you, your tutorials are amazing. Would you make videos about animation state machines and Godot shader.

    • @KaanAlparGameDev
      @KaanAlparGameDev  4 ปีที่แล้ว +1

      Thanks a lot! I’m definitely going to create more tutorials about Godot, so stay tuned.

  • @icydude2696
    @icydude2696 4 ปีที่แล้ว

    Thank you this was very helpful

  • @oliverpallo
    @oliverpallo 3 ปีที่แล้ว

    i typed everything like you did but when i try to jump it only jumps a very small height of the ground. it only jumps normally when moving to the left and jumping while moving. idk what the problem is

  • @cananesen6914
    @cananesen6914 4 ปีที่แล้ว +1

    Şahane bir anlatım tebrikleeeeeer👌🏻

  • @micemincer
    @micemincer 4 ปีที่แล้ว

    This is fantastic - THX

  • @markwakin490
    @markwakin490 4 ปีที่แล้ว +1

    git repo?

  • @Edel99
    @Edel99 4 ปีที่แล้ว

    Thank you!

  • @sirannprenseskanal2934
    @sirannprenseskanal2934 4 ปีที่แล้ว +2

    Çok güzel olmuş

  • @ladine8112
    @ladine8112 4 ปีที่แล้ว

    Perfectttt 🙏🏼😍

  • @atilla7189
    @atilla7189 4 ปีที่แล้ว

    adam türk ama kimse bilmiyo adasdasd abi düşman nasıl yapılır anlatırmısın lütfen

    • @KaanAlparGameDev
      @KaanAlparGameDev  4 ปีที่แล้ว +1

      Daha detaylı bir platformer serisi gelmek üzere

  • @blox6180
    @blox6180 2 ปีที่แล้ว

    heres the code if your having trouble with it:
    extends KinematicBody2D
    onready var sprite = $Sprite
    onready var animation_player = $AnimationPlayer
    const MAX_HORIZONTAL_SPEED = 128
    const MAX_FALL_SPEED = 128
    const FRICTION_WEIGHT = 0.15
    var input_vector = Vector2.ZERO
    var velocity = Vector2.ZERO
    var acceleration = 256
    var jump_force = 128
    var gravity = 256
    func _physics_process(delta):
    # horinzontal movement

    input_vector.x = Input.get_action_strength("move_right") - Input.get_action_strength("move_left")
    velocity.x += input_vector.x * delta * acceleration

    # look in right dir
    if input_vector.x == -1:
    sprite.flip_h = true
    elif input_vector.x == 1:
    sprite.flip_h = false

    # friction
    if input_vector.x == 0:
    velocity.x = lerp(velocity.x, 0, FRICTION_WEIGHT)
    if abs(velocity.x) 0:
    animation = "run"
    if velocity.y < 0 && !is_on_floor():
    animation = "jump"
    if velocity.y > 0 && !is_on_floor():
    animation = "fall"
    animation_player.play(animation)