-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the CheckEngine wiki!
To follow the guides presented in this wiki, it is recommended to have an installation of a Gradle-capable IDE (e.g. Eclipse or IntelliJ). The easiest way to develop with this engine is to download the complete source and include it as a Gradle sub-module. The Kotlin portions of the engine will require either IntelliJ or the Eclipse Kotlin extension (the former is more reliable).
Please also install your preferred distribution of JDK/JRE 8 or above.
The game is booted by passing an instance to the Check
class. The engine will take care of creating graphical contexts and engine objects as appropriate for the game's main class. Simply provide an instance of a class extending CheckGame
to get started.
After the game is booted, the engine must also sit on the main thread until all contexts are closed.
Additionally, notice the initialization and update functions. They are called at the start of the game and each time the game renders respectively. The game main class must also provide basic profile information so that the engine can start correctly. For additional details about how to add more engine object modules (each of which can have their own initialize
and update
), see the @EngineObject
section of this wiki.
public class GameMainClass implements CheckGame
{
@Override
public void initialize()
{
// Set up graphical objects
}
@Override
public void update()
{
// Render and updates; called each frame
}
public static void main(String[] args)
{
Check.boot(new GameMainClass());
// Required due to GLFW thread-safety limitations
Check.infinitelyPoll();
}
// Required to provide basic information to start the game
@Override
public Profile getProfile()
{
return new CheckGame.Profile(
/* App Name: */ "Example Game",
/* App Version: */ "Version"
);
}
}
Running the above example should result in a blank window titled "Example Game (Version)."
Game resource files can be stored in multiple locations. There are a couple of basic ways to access resources: in files and on the classpath.
In future examples, some methods will ask for a parameter of type Resource
. Depending on where the desired resource is, use the appropriate method in the Resource
factory. These instances can then be used to construct textures, shaders, levels, and more.
// Load a file from the working directory
Resource fromFile = Resource.fromFile("assets/textures/example.png");
// Load a file from the classpath
Resource fromClasspath = Resource.fromClasspath("textures/example.png");
The full text content of any resource can be read in by calling resource.getTextContents()
.
These resource types will be used in upcoming wiki pages.