C# (11)

Two mice using a computer mouse
Pilvinen Pilvinen

Node2D double click detection in Godot

Clicks for Node2D based nodes can easily be detected by using CollisionObject2D‘s input_event signal. To capture the mouse clicks we can add an Area2D node and a CollisionShape2D or CollisionPolygon2D…

Pilvinen Pilvinen

Implicit and explicit conversion operators

Implicit and explicit conversion operators allow you to ingegrate your custom types seamlessly with other types by doing implicit or explicit conversions from one type to another. public void SetPositionFromVector3(Vector3…

Pilvinen Pilvinen

Getting GodotXUnit up and Running with Rider

Installation from Github These instructions will explain how to get GodotXUnit integrated to your project and working with Rider. [XunitTestCaseDiscoverer("GodotXUnitApi.Internal.GodotFactDiscoverer", "GodotXUnitApi")] And replace the GodotXUnitApi with your project’s assembly name,…

Pilvinen Pilvinen

Seeded Random Numbers

Sometimes you need pseudo-random numbers which are not dependent on time and which are always reliably identical and given in the same order when ever you re-start the application or…

Pilvinen Pilvinen

Godot MultiMesh SetAsBulkArray Method

This article tries to bridge the gaps and ambiguities in the official Godot documentation for SetAsBulkArray(). We don’t go over everything. But armed with this information you should be able…

Pilvinen Pilvinen

Inheritance with Constructors

Here we call the constructor of the base class A and pass the id as a parameter to initialize _id in the constructor of A class. By doing this way…

Binary
Pilvinen Pilvinen

Binary addition

Let's take a look at how binary addition can be done by using bitwise operations. Why would we want to do this? Simply because we can. And also because it's…

Array flattening
Pilvinen Pilvinen

Array flattening

One dimensional arrays, or flat arrays as they are sometimes called, have desirable properties. They are fast. They are simple to access and to iterate through. They can easily be assigned…