This project builds upon the Godot 2D game tutorial “Dodge the Creeps” by adding things that are needed in all games and can be used as a reference when starting a new Godot project.
The project is entirely coded in C# as that is my preference over GDScript. Some things may be easier in GDScript but I find it difficult to work with both in the same project so I made the decision to go with C# only.
Parts of this project could be broken off into reusable components in the future.
The project uses the built-in Godot translation support for gettext files.
Godot does not support .pot file generation for C# code, so an additional script is used
to create a .pot file from the code and then merge it with Godot’s file. It uses xgettext
with
C# language support to look for all text inside a call to a function named Translate
.
In C# always use TranslationServer.Translate
to support translatable text. Text for logging or anything else not displayed
in game does not need to be translated.
_hud.ShowMessage(TranslationServer.Translate("Get Ready!"));