Title here
Summary here
Functions are central in AngelScript. We’ll learn about functions with a few different examples.
Here’s a function that takes two int
s and returns their sum as an int
.
When you have multiple consecutive parameters of the same type, you need to specify the type for each parameter in AngelScript.
Now let’s use these functions in our main
function:
To run this AngelScript code, you would typically embed it in a host application or use an AngelScript interpreter. The output would be:
There are several other features to AngelScript functions. One is default arguments, which allow you to specify default values for function parameters.