-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Learning GDScript by Developing a Game with Godot 4
By :

Until now, we’ve only worked with numbers, but variables can hold many different data types. In this section, we’ll go over three of the most used data types. Throughout the book, we’ll see even more types whenever they are applicable.
Integers are whole numbers, such as 1
, -422
or 10983457
. They do not contain a decimal point. They work very well for counting the number of lives or bullets. An integer in the GDScript can be any value between -9223372036854775808
and 9223372036854775807
. This is a limit that is imposed by the way numbers are represented within the computer using bits; it’s not an arbitrary number imposed by Godot itself. The number will wrap around and switch from very, very high to very, very low if you cross this barrier in any direction, which is not recommended. Luckily, this range gives us more numbers than the number of stars in our galaxy by a few magnitudes, so we should...