CRM64Pro GDK v0.14.0
A free cross-platform game development kit built on top of SDL 3.0
Loading...
Searching...
No Matches
TileEngine Core

Description

TileEngine Manager and TileEngine objects for 2D tile-based game development [v26.01.0].

Overview

The TileEngine Core module is a 2D graphics engine that enables you to create tile-based games in a very easy and powerful way. With full support for Tiled map editor (TMX format), you can design your levels using industry-standard tools. Developed from scratch but based on the old MSTE for CRM32Pro, it provides comprehensive support for levels, layers, tilesets and multiple file formats.

Key features

  • Multi-layer architecture: Levels composed of unlimited layers with runtime modification
  • Flexible scrolling: Standard scroll, parallax scroll and auto-scrolling capabilities
  • Multiple tilesets: Use any number of tilesets per layer with variable tile sizes
  • Event system: Layer update and render end events for custom logic
  • Format support: Tiled format, BMP/PNG image import/export
  • Extensible: Custom map data via C++ class inheritance

Level features

The level is the top-level entity created by one or more layers:

View typeOrthogonal view
Layer countAny number of layers, modifiable at runtime
ViewportViewport and render screen modifiable at runtime
Layer groupingIndependent or grouped layers supporting standard or parallax scroll
Auto-scrollBuilt-in auto-scrolling capabilities

Layer features

Layers contain the tile-based data and rendering properties:

DimensionsAny width and height (number of cells)
Cell sizeAny cell size supported
TilesetsAny number of tilesets per layer; larger tiles extend at top and right
Alpha modulation0 (fully transparent) to 255 (fully opaque)
EventsonUpdateEnd and onRenderEnd events for custom logic
Smooth scrollOptional smooth scroll rendering for fluid movement
Custom mapsAdd custom map data via C++ class inheritance
Debug modeRender cell grid for debugging purposes

Tilesets

TypeCRM64Pro::Tile objects
StorageExternal files or CDC archives

Supported formats

TMXFull support for Tiled 0.18+ map files (see TMX compatibility below)
BMP/PNGImport image into layer or export layer to external image

TMX compatibility

Support for Tiled map files with the following specifications:

TMX versionv1.0 to v1.10
OrientationOrthogonal only
Render orderright-down only (if set)
Layer IDStarts with 1
Ignored propertiesinfinite, backgroundcolor
C64TE mapEmbedded inside TMX (current version 3.0)

Manager type

This is a standard manager: objects are not shared and must be unique using its name as the key. You cannot create an object with the same name as another one already created.

Best practices

  • Use parallax scrolling with grouped layers to create depth effects in side-scrolling games
  • Enable smooth scroll rendering for fluid movement in scrolling games
  • Use the onUpdateEnd and onRenderEnd events to add custom game logic per layer
  • Use the debug cell grid rendering during development to verify tile alignment
  • Store tilesets in CDC archives for organized asset management
  • When using Tiled, ensure maps use orthogonal orientation and right-down render order
  • Extend TE_MapData via C++ inheritance for custom map data requirements
  • Access the manager exclusively through Main::ITileEngineMgr()
Note
The TileEngine Manager is a singleton, automatically created once Main is instantiated. You can get a reference to this manager using Main::ITileEngineMgr() method.
The TileEngine Manager is automatically released when Main::Terminate() is called. At this time, any resource still loaded will be released, avoiding resource leaks.

Classes

class  CRM64Pro::TileEngine
 TileEngine Object class. More...
class  CRM64Pro::TileEngineMgr
 TileEngine Manager class. More...