This is the simplest example manifest:
<?xml version="1.0" encoding="utf-8"?>
<project name="my-cool-game" standalone_source="my_cool_game.lpr">
</project>
The standalone_source
value must point to an existing source file to compile the project for desktop platforms (Windows, Linux, MacOSX…). An example is below. Alternatively, you can specify a list of game_units
(see the documentation of game_units attribute), in which case the standalone_source
is not necessary (the build tool can internally auto-generate a suitable program file for compilation).
When compiling, the resulting executable file name is derived from the project name
(in this case: my-cool-game
). So it’s my-cool-game.exe
on Windows and just my-cool-game
on Unix.
The project name is also used for other things:
-
When packaging the project (by the castle-engine package
), the archive names are derived from it. For example, packaging the project for Linux (64-bit architecture, x86_64) will result in my-cool-game-linux-x86_64.tar.gz
filename.
-
If you follow our standard program templates, the CastleAutoGenerated.pas
unit will make sure that ApplicationName
and ApplicationProperties.ApplicationName
are set to the project name.
While not strictly necessary, the proper ApplicationProperties.ApplicationName
will be helpful e.g. for Android logging (where we need to filter the logs by project name).
To be on the safe side, the build tool requires that the project name is limited to ASCII letters, numbers, underscores and hyphens. No spaces, no dots, no other special characters are allowed.
For example, place these contents in the my_cool_game.lpr
file:
uses SysUtils, CastleWindow, CastleApplicationProperties;
var
Window: TCastleWindow;
begin
ApplicationProperties.ApplicationName := 'my-cool-game';
Window := TCastleWindow.Create(Application);
Window.OpenAndRun;
end.
Congratulations, you have created a game! Now you can compile the project by running this on the command-line:
Then you can run it by simply executing the file my-cool-game.exe
on Windows or ./my-cool-game
on Unix. Or you can run this:
You can also package the project by castle-engine package
, package source by castle-engine package-source
and do everything else mentioned in the Build Tool documentation! To learn how to write games, follow our Castle Game Engine manual.