Conventions used
There are a number of text conventions used throughout this book.
Code in text
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “In Chapter 1, we learned to write code with the _ready
method of a node.”
A block of code is set as follows:
func deal_damage(amount: float) -> void: player_health -= amount func heal(amount: float) -> void: player_health += amount
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
func minimum(number1, number2): if number1 < number2: return number1 else: return number2
Any command-line input or output is written as follows:
unzip Godot_v4.2.1-stable_linux.x86_64.zip -d Godot
Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “You can access the user://
folder for a given project by opening up the Project menu and choosing Open User Data Folder.”
Containers
We call an array a container because we can store and retrieve pieces of data of other data types within them, like integers, strings, booleans, and such. An array contains other data.
Containers structure other data so it is easier to work with.