Runs as soon at the script gets loaded:
func _ready():
Variables inside a function cannot be accessed by things outside of it
If you pass a parameter, the value of that parameter will be defined when you call
the function:
extends Node
var number = 5
func _ready():
add(number, 10)
func add(a, b):
var result = a + b
print(result)
% operator: Divides 2 numbers and gives you the remainder:
func _ready():
# print the string hello world to the output window
# print(message)
operator(10, 3)
func operator(a, b):
var result = a % b
print(result)
(3 goes into 10 3 times and there is 1 left over)
return:
not going to run anything else after that