Hatch Game Engine Documentation v1.4.0
The documentation for the Hatch Game Engine
Loading...
Searching...
No Matches
Comments

Comments are lines of code that get ignored by the compiler, meaning they don't affect your project.

Declaring a comment

There are 2 types of comments, one being single-line comments, which you can declare by using the // prefix.

// This is a comment!

The other one is multi-line comments which start with /* and end with */. Any text between will be considered as a comment.

/*
This is a multi-line comment!
Multi-line comments can have multiple lines!
*/
This isn't a comment /* but this is. */

When to use comments

Comments can be used to leave notes for yourself or other programmers that may be working on the same project.

// Note: This constant variable stores the maximum amount of objects that can be present at the same time.
const MAX_OBJ_C = 5;

Comments can be used to "ignore" lines of code, skipping their execution.

event Create() {
print("Getting executed is my favorite activity.");
/*
print("Hello!");
print("Please skip these lines!");
*/
}
INFO: Getting executed is my favorite activity.