In my previous post, I wrote about my hobby project with Godot.
Limitations of GDScript
forEach. C# has
List class with
ForEach method. There are similar methods like
reduce using LINQ.
Moreover, C# supports lambda expression. This is which GDScript cannot support. Even Python cannot do multiple lines lambda expression.
Comparing C# and GDScript, C# may be slower for development, but learning C# will be more useful than GDScript, as C# is a general purpose programming language. And C# has richer syntax.
Another reason I choose C# over GDScript is the testing. As a web developer, TDD (test-driven development) is a useful approach to make the product more stable. Development in GDScript doesn’t allow me to test my functions by writing test cases. If I choose C#, I can install Machine.Specifications (or MSpec) and Fluent Assertions through NuGet, then write the tests.
In fact, Godot supports native script using GDNative. This allows you to develop your module using C or C++ language. I like C and C++, but they are less efficient comparing to the modern programming languages. They are inefficient for development, as there is no garbage collection. Smart pointer is not garbage collection. However, C++ is acknowledged as best language for game development, according to Google Search.
Setup Godot Mono in Arch Linux
This section is Arch Linux specific.
Once using Godot Mono to create a project, a solution file (.sln) and a project file (.csproj) will be created. These files are compatible with MonoDevelop. If you cannot open, probably you are using wrong version of
To setup .NET Core in MonoDevelop, go to Edit > Preferences > Projects > SDK Locations > .NET Core, edit the location of the
dotnet CLI as
/opt/dotnet/dotnet, it will detect the SDK and runtime automatically.
/usr/bin/dotnet cannot work, because it is a script.
Then, you can build your C# module using either MonoDevelop or Godot (Mono support). One great thing is, we can use both C# and GDScript together in the same project.
Unluckily, not every package manager acts like
npm (Node) or
bundle (Ruby). To install packages through NuGet, best approach is to use MonoDevelop.