2D Movement in Godot in Only 4 Minutes

preview_player
Показать описание

---
👥 CREDITS
---
💌 JOIN US

---
📝 CC-BY LICENSE

Рекомендации по теме
Комментарии
Автор

Was waiting for this, now I know I can make smoother movement for my prototype. Thanks for the great content!

alvarovelasco
Автор

More tutorials like this please! Short and sweet, yet lots of depth :)

FrostHound
Автор

I love this video format! Please keep posting more videos like this. Great work! I want that course, please! :D

activemotionpictures
Автор

extends KinematicBody2D

const UP_Direction := Vector2.UP

export var speed := 600.0
export var jump_strength := 1500.0
export var maximum_jumps := 2
export var double_jump_strength := 12000.0
export var gravity := 4500.0

var _jump_made := 0
var _velocity := Vector2.ZERO

func _physics_process(delta: float) -> void:
var _horizontal_direction = (

-
)

_velocity.x = _horizontal_direction * speed
_velocity.y += gravity * delta

var is_falling := _velocity.y > 0.0 and not is_on_floor()
var is_jumping := and is_on_floor()
var is_double_jumping := and is_falling
var is_jump_cancelled := and _velocity.y < 0.0
var is_idling := is_on_floor() and is_zero_approx(_velocity.x)
var is_running := is_on_floor() and not is_zero_approx(_velocity.x)
_velocity = move_and_slide(_velocity, UP_Direction)

for the all the lazy ones!

alex.a
Автор

Thank You For Doing This Tutorial! It Really Helps Me To Understand :D Wait For More 2D Game Tutorials

messypy
Автор

Line 18:Too many arguments for "move_and_slide()" call. Expected at most 0 but received 2.

the_real_tosterzy
Автор

I like how you created variable for each state, so that you can them plug in those variable when you need. Thats something I need to do more.

ssjachilles
Автор

And if you liked it, let him know you want him to do more!

Gdquest
Автор

Quick question: Is there any real difference between collecting input on _physics_process instead of _process?

felipegomesdeoliveira
Автор

These shorts are very good and helpful! Thanks

metal-matze
Автор

Question: Why are variables declared using ' := ' instead of just a ' = ' sign? Thanks.

WanderingWhisper
Автор

This is not good enough!! I want 4D Movement in Godot in 2 minutes!

sepgorut
Автор

You did a great tutorial for just four minutes, you got me out of a block. Thank you!

ciaragarrity
Автор

The method used to implement gravity direction alterations in Godot 3 seems to be completely different in Godot 4, so now I'm tediously trying to figure out a working method because I need the mechanic in my game lol

TheDiamondCore
Автор

Beautifully concise!
Thanks very much!

robertcrawford
Автор

Simple and clear tutorial. Keep up the good work. Thanks.

baertbellemans
Автор

Question:

In the input code. Why are you not using if Input.is_action_pressed()?

hipxel
Автор

I love quick tutorials. I could not find one. That i why I've started making fast tutos too 👍😁

gofastutos
Автор

Howdy, I have a question.
I want to store data of enemies in one scene, so that it respawns later when the player re-enters the scene. However, I don't want the enemy to reappear as soon as the player enters the scene. I only need it to reappear after a given interval, or when the player saves the game (Similar to other metroidvania games). I'm not sure how to implement this...

How should one go about doing this in Godot? Should I save the data for ALL enemies then use a timer to respawn the enemy? Or is there a better way to go about doing this? Thanks in advance!

awfyboy
Автор

How would you approach a 2.5d game, like double dragon or golden axe, where it's using 2D, but you give the play area a sense of depth, and when you jump you don't want to be punched by someone stood further 'up' the background, so they aren't on the same plane as the player?

Spacecookie-