Тёмный

Godot Beginner Tutorial 18: Better Movement 

Alvin Roe
Подписаться 18 тыс.
Просмотров 1,3 тыс.
50% 1

Throughout the Godot Beginner Tutorial series, we will be covering the bare essentials to building a game in Godot. In a beginner friendly manner, with the free game engine Godot, each tutorial will be a stepping stone towards completing your first game.
Through the series, we will cover the 2d side of the engine, including: sprites, scripting, UI (very basic), parallax, and multiple levels!
#GodotEngine
Continuing the beginner-friendly top-down shooter series for the free Godot game engine, we will be enhancing the movement.

Опубликовано:

 

15 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 4   
@timpani112
@timpani112 4 года назад
You're making things harder on yourself with the velocity by trying to think of it as if it were merely the speed. But the speed is only giving you information on how fast you are moving, not your direction, so it's not the same as velocity. The velocity is a vector that encodes two things: 1. The direction you're moving in; 2. How fast you're moving in that direction. Given an arbitrary nonzero velocity vector, we determine the direction of the velocity by comparing the x- and y-coordinates to one another (you've got that information stored in the vector you call 'dir'). To get the speed from this same velocity, we should instead look at the total length (or magnitude) of the velocity; the larger the lenght of the velocity vector, the faster we go. For your specific application, it would be most appropriate to have a variable called 'speed', and then manipulate the speed variable with acceleration and friction (since these two parameters are only used to increase/decrease the speed, and they don't affect the direction you're travelling in). Then you should just set your velocity as follows: velocity = dir*speed (this works since the length of your vector 'dir' is 1 to begin with).
@thinkingintheradiator1298
@thinkingintheradiator1298 3 года назад
with your comment i figured out this method (even though Im not sure if it is what you meant) and it works really well: if(Input.is_action_pressed("i_up")): velocity.x = lerp(velocity.x, dir.x * speed, accel) velocity.y = lerp(velocity.y, dir.y * speed, accel) move_and_slide(velocity) else: velocity.x = lerp(velocity.x, 0 , frict) velocity.y = lerp(velocity.y, 0 , frict) move_and_slide(velocity)
@0Slaxer0
@0Slaxer0 3 года назад
@@thinkingintheradiator1298 I think I went so fast it broke
@thinkingintheradiator1298
@thinkingintheradiator1298 3 года назад
@@0Slaxer0 accel has to be < 1
Далее
Godot Beginner Tutorial 19: Basic UI
5:48
Просмотров 1,4 тыс.
How to make a Video Game - Godot Beginner Tutorial
1:17:12
😂😂
00:16
Просмотров 869 тыс.
Starter state machines in Godot 4
10:58
Просмотров 53 тыс.
How to program in Godot - GDScript Tutorial
58:10
Просмотров 644 тыс.
3 Hours vs. 3 Years of Blender
17:44
Просмотров 4,8 млн
How to Create an RPG in Godot 4 (step by step)
20:57
Просмотров 297 тыс.
Tierlisting the BEST (and worst) GAME ENGINES
33:51
Просмотров 222 тыс.
LEVEL UP Your Game Design Toolkit (Godot for Beginners)
23:30
4 Godot 4 Devs Make 4 Games in 44 Hours
25:19
Просмотров 519 тыс.
Learning Unreal Engine in One Month to make a Game!
15:25
😂😂
00:16
Просмотров 869 тыс.