• Register

TMO Games cofounder and developer. I love every area involved in game creation

RSS My Blogs


Some time ago I've posted an article at TMO Games page, but I guess would be better if I write here, as a blog.

We've started "Godoting" our game and the results are really nice, I've rewrite a lot of times the player class, even I switch from Godot 2.1 to 2.2, and back to 2.1; now we are happier with the results. But everything is subject to changes, though.

Why the switch to 2.2, and back?

During the coding for the player I had to learn how to do many things in Godot (coming from Cocos), and I really liked the methods move(), move_to(), test_move() and revert_motion() (so many moves and the revert is a motion, :) ). They are simple, for the smart guys, so I had some (long) time trying to fully understand how to control these things. The worst part is when you add some slopes, and in the middle of that issue I've discover Godot 2.2 with its move_and_slide() method. This method simplify another method: the slide() function, the one that helps you with the slopes. Here is an image from the Godot docs:

See? slide() is a genius. Anyway, why I switch back to 2.1?...


Haha, too dramatic, right? But well, is true. The stable branch right now is the 2.1, and the 2.2 is being developed slowly (they are full-time with 3.0). So, go back to 2.1 and the classic move() and normal.slide().

The character

I've coded the player class to be very flexible, loading the character and also the character has its animations in a separated scene. So the player class has a character skeleton, and this skeleton has an AnimationPlayer (class). I also did a "states" class that manage each state for the player, can be locked or not, can have a next state defined or not, and so on. I don't think I'm a good programmer, so all suggestions are welcome.

If you are not familiar with Godot, I can tell you that it uses a dedicated script language called GDScript (with a syntax similar to python), and the engine is written in C++, and is really easy to make custom modules for it. And that's another reason that lead us to choose this engine. If we have problems with performance, then we can do a C++ module. And about GDScript, think that for godot each node you create is a class, so if you create an "States" node, you are creating a class. I've used this feature to organize my code.

As you can imply the character has skeleton animations, before we had spritesheets, but we started to see how those spritesheets started to get bigger, so we changed that.

Where is he?

The player node doesn't have any predefined character... Recently I saw a "Placeholder" option in Godot, could be useful for this?

He is here!

And in other node I have the actual character, hopefuly will be a lot of characters... finger crossed!

Ok, the switch to a blog format is done... don't forget to read the "Day-1" article.

Thanks for reading!

#bd081c no-repeat scroll 3px 50% / 14px 14px; position: absolute; opacity: 1; z-index: 8675309; display: none; cursor: pointer; top: 2106px; left: 20px;">Guardar

Start a group Groups
Indie Devs

Indie Devs

1,689 members Hobbies & Interests

A group dedicated to indie and standalone game development.

TMO Games

TMO Games

1 member Developer

We are a 2 people team (sometimes more!), doing games for fun and... profit? Enjoy!

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.