Question: What is Godot written in?


Godot Engine is a feature-packed, cross-platform game engine which is designed for creating 2D and 3D games. It is written primarily in C++. The choice of C++ allows for high performance and control over low-level game functionality while also facilitating the creation of a user-friendly editor with a lot of features.

The engine supports scripting in several languages. Its own scripting language, GDScript, is specifically designed for the engine, aiming to be an easy-to-use, high-level language that syntonizes well with the design of the engine. Godot also supports VisualScript, a visual programming language tailored for creating game logic. Furthermore, since version 3.0, Godot has included optional support for C# using Mono, an open-source implementation of the Microsoft .NET Framework.

Here's an example in GDScript, demonstrating how to define a simple player class:

extends Sprite var speed = 200 func _process(delta): var motion = Vector2() if Input.is_action_pressed('ui_right'): motion.x += 1 if Input.is_action_pressed('ui_left'): motion.x -= 1 if Input.is_action_pressed('ui_down'): motion.y += 1 if Input.is_action_pressed('ui_up'): motion.y -= 1 motion = motion.normalized() * speed position += motion * delta

In this code snippet, you can see how GDScript syntax is somewhat similar to Python, making it an accessible language for many developers, especially those new to game development.

The Godot editor itself is also created with Godot and uses the Godot API for its user interface, demonstrating the engine's flexibility and capability.

For developers looking to dive into the engine's source code or contribute to its development, Godot's source code is available on GitHub under the MIT license, which is quite permissive and encourages open collaboration and sharing.

Was this content helpful?

Start building today

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.