The project developed during a presentation Coding games using Castle Game Engine and Delphi (Dev Days of Summer 2024).
Download the compiled binaries from snapshot release.
-
First of all, using Castle Game Engine, our open-source 3D and 2D game engine with comfortable editor and powerful API using modern Pascal.
-
2 views, main menu and game.
-
Viewport with 3D scenes designed in the editor.
-
Handling input in code, to move the player.
-
Using reusable designs to define a missile (ball with a
TCastleRigidBody
component. -
Using TCastleComponentFactory and TCastleTimer to spawn the missiles.
-
Using physics with collision events to detect when the missile hits the enemy.
-
Using behaviors to implement simple movement on the enemy.
No cheating, this was created in ~1 hour, from absolute scratch and you can watch how it happened and see all my mistakes on the video!
... after the recording I only did really small stuff:
- reworked
OnCollisionEnter
to use 1 methodSkeletonCollides
for all 3 enemies (during recording I already mentioned this bit of code could be better, I was just in a hurry), - fixed FPC compatilibity,
- added README and screnshots,
- added
.github
workflow to build the project using GitHub Actions, - better colliders, cache to load cliffs faster.
Code:
- By Michalis Kamburelis.
- License: BSD 3-Clause License (see the
LICENSE
file). Basically, do what you want. - Support the engine on Patreon!
Data (all pirate-themed assets):
-
By Quaternius.
-
License: public domain. Literally do what you want.
-
In this project, we used many assets from his Pirate Kit.
The subdirectory
data/pirates/
in this repo contains a subset of the assets from this pack. We only removed unused assets to minimize snapshot release size. We refer to the assets there from engine design files (.castle-user-interface
) created using the engine editor.
Using Castle Game Engine.
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
creature_behaviors_standalone.lpi
file and compile / run from Lazarus. Make sure to first register CGE Lazarus packages. -
Or use Delphi. Open in Delphi
creature_behaviors_standalone.dproj
file and compile / run from Delphi. See CGE and Delphi documentation for details.