Gravitational Combat in Godot

Recently, I’ve been wanting to make a wee uncomplicated action game. I’m trying to use open source as much as possible lately after learning how to use Blender and being blown away by how much it’s capable of. The Godot Engine is an open source game engine for making 2D and 3D games with the all-in-one approach of something like Unity.

godotlogo

It’s fully component-based. The ship is a scene which consists of nodes. The root node might be a static body which tells the physics engine to be interested in it. Hanging off that is a sprite node which contains the texture and a collision shape node which defines the extents of the object to the physics engine.

The space level itself is a scene, and contains instances of the ship scenes and the planet scenes. You can export variables, which shop up in the property editor, to customise them. The planets have mass, whereas the ships have a player identifier so the input can be mapped accordingly.

Code is equally modular. Each node can have an associated script, and scripts are weakly bound by searching for the properties of other nodes, either by knowing where they are in the scene hierarchy, or by knowing their group. The planets are in one group, for example, as are the missiles. This can cause things to break if you shuffle your nodes around.

The developers are quite active in their irc channel (#godotengine @freenode) and the people there seem pretty chill and happy to answer questions.

gclogo

The game is based on one me and my brother used to play, a sort of tanks/gorilla/worms style thing in space called Gravitational Combat.

Mine is going to be realtime, whereas the original was turn-based. Here’s a couple of gifs of it in action.

attack

orbit

Godot’s physics engine is handling the inertia, and collisions, but I had to do the planetary gravity bit myself.

Advertisements
Gravitational Combat in Godot