I’m happy to present a new large Castle Game Engine demo: “Aliens vs Humans”. It is a simple strategy game with maps designed using Tiled.
The demo is in the examples/tiled/strategy_game_demo/ directory of our source code. You can also download precompiled versions for Windows or Linux.
Our Tiled maps API was enhanced with various methods to make writing games easy:
- TCastleTiledMapControl.PositionToTile
- TCastleTiledMapControl.TileRectangle
- TTiledMap.TilePositionValid
- TTiledMap.TileNeighbor
- This is all building upon improvements I announced last week to the Tiled support in CGE.
These methods work for all map orientation types (hexagonal, orthogonal, isometric, isometric staggered). This way you can handle e.g. hexagonal and orthogonal maps the same way, with the same code, without worrying about the differences how “neighborhood” is defined differently for hexagons (6 neighbors) and orthogonal maps (4 or 8 neighbors, depending on CornersAreNeighbors
).
The user interface is designed using Castle Game Engine Editor. The game code uses TUIState to split the game into states. Each state UI is loaded from a separate .castle-user-interface
file. Thus, this is also a demo of how to use TUIState with CGE editor, to organize a larger game into states.
This demo was requested by Castle Game Engine supporters on Patreon. I took some time to make it, as I wanted to make it perfect 🙂 If you’d like to see more crazy CGE demos, join us on Patreon!