How To Create Your First Game In Godot : OOP With Handlers

preview_player
Показать описание
In this part of the course we'll going over the basics of OOP (Object Oriented Programming) by reworking our player script to use a handler system we'll be able to later use to create other entities without having to re-create the same code!

#gamedev #gamedevelopment #indiedev #indiegamedev
Рекомендации по теме
Комментарии
Автор

As someone with zero experience with coding outside of this series, the fact that you start this by saying when you learnt about OOP it was confusing, but then you immediately explained it in a way that made it crystal clear, is actually incredible to me. You're an amazing teacher, frankly, and I'm really grateful for this series, I've learnt so much already from you that would of been hard for me to figure out on my own!

PrincessTokyoMoon
Автор

Hey you shouldn't multiply the velocity with delta in MovmentHandler because you are using move_and_slide which multiplies velocity.x by itself.
That's why you had to pass such a large amount of movement speed like 6000.
Anyway I enjoyed your videos so far, so please keep this up!

GodotEnjoyer
Автор

Awesome tutorial! Well explained and I do like when everything we're going to do is shown in the flow chart beforehand!

doghead
Автор

OH MY GOODNESS YOU ARE UNDERRATED. THANK YOU FOR ALL YOU DO HOLY CRAP, YOU HAVE EVERY TUTORIAL I CANNOT FIND

icklesauce
Автор

One potential improvement is to simply define a variable at the top of your scripts like so:
var character_body = CharacterBody2D

That will prevent you from having to write "character_body : CharacterBody2D" inside of every single function, instead requiring only the variable name.

parallelblack
Автор

Love this one! Such a good OOP explanation :D

cstoffet
Автор

You just Leveled Up everyone's game, thank you!

rp
Автор

Patiently waiting for you next upload - Thank you sm :)

gavm
Автор

Hello! I have been following your tutorials and they are great. I have a question

At 21:48 when you call the handle_jump function with the following code:

"jump_handler.handle_jump(self,

I put the exact same code but when I run the game it crashes and I receive this error message:

"Invalid call. Nonexistent function 'handle_jump' in base 'Nil'.".
The debugger points to that specific line of code.

I have seen all your videos thrice up to this one, and even re-made an entire project from scratch following each step, but for some reason I always encounter the same error. Is there anything that I could be missing or doing wrong? Or maybe it's something that changed with Godot 4.2?

MsMirco
Автор

If i wanted to add coyote time or input buffering, should I add those to an existing handler or create a new one for them, or just add it to the player movement script?

Loouuuu
Автор

Te vas a godot para no usar oop y andas queriendo usar oop en godot no me lo puedo creer. Bueno, mientras sirva a alguien ta bn

feivmoon
Автор

Great Tutorials I'm enjoying this a lot, nothing went wrong and I followed it smoothly, but I have a question
After I make an Onready Variable it starts recomending it when I type, but the functions of that scene don't.
For example: jump_handler gets recomended, but handle_jump doesn´t

Does anyone know why it does that? And can you help me? It's kind of annoying having to go back to the scene just to make sure I'm writing the right function name.

eduardopereira