Demo project for presentation at Zlot Programistów Delphi 2024.
Slides (in Polish): https://castle-engine.io/zlot2024 .
This demonstrates creating a simple 3D FPS game, from start to finish. The level, creatures, and win/lose views have been done using:
-
Blender (to design base level geometry)
-
Sketchfab (to add additional props to the level)
-
Quaternius models (to add animated enemies)
-
TCastleMoveAttack
(for ready logic of moving enemies and player hit points), -
TCastleWalkNavigation
(for ready handling of AWSD and similar keys, typical for FPS games).
Controls:
- Walk using AWSD keys,
- rotate by holding right mouse button and moving the mouse,
- shoot by clicking with left mouse button.
The Pascal code (most in GameViewMain
unit) adds logic to
-
Activate mouse look when right mouse button is pressed,
-
Show "game win" view when player reaches a certain place in the level,
-
Show "game over (lost)" view when player life drops to zero,
-
Show player life (hit points),
-
Shoot enemy on mouse click.
Do you want to see something more?
-
Follow Castle Game Engine tutorials and manual.
-
See examples included in the engine, like examples/creature_behaviors and examples/fps_game that show more features, e.g. how to visualize getting hit by "temporary fade to red".
Using Castle Game Engine.
-
Dungeon based on https://opengameart.org/content/3d-castle-dungeon-tileset-extended nby rubberduck
This is in turn using other assets, see
data-source/original_dungeon-tileset-extended/readme.txt
for details. -
Trophy from https://opengameart.org/content/trophy by JeremyWoods (license: CC0).
-
Multiple Sketchfab models, see
data/sketchfab
for details and links to authors. Licenses are a mix of Creative Commons Attribution and Creative Commons Attribution NonCommercial licenses. -
Skeleton from Quaternius Pirate Kit, CC0.
Compile by:
-
CGE editor. Just use menu items "Compile" or "Compile And Run".
-
Or use CGE command-line build tool. Run
castle-engine compile
in this directory. -
Or use Lazarus. Open in Lazarus
game_3d_standalone.lpi
file and compile / run from Lazarus. Make sure to first register CGE Lazarus packages. -
Or use Delphi. Open in Delphi
game_3d_standalone.dproj
file and compile / run from Delphi. See CGE and Delphi documentation for details.