Objectives

  • Implement a 2.5D depth sorting system for game objects and heroes
  • Separate visual, logical, and interaction footprints for precise object behavior
  • Create a three-pass rendering pipeline to handle shadows and depth
  • Develop a passability matrix to manage collisions and pathfinding logic
  • Build a toggleable debugging grid to visualize physical object boundaries
  • Enable interactive object triggers using specific entry tiles

Instructions

  1. Create an ObjectLibrary to store blueprints for images, offsets, and footprints.
  2. Define a specific “Anchor Point” (Pivot) for the hero and every object.
  3. Separate shadow assets from main object sprites to avoid rendering errors.
  4. Implement a three-pass rendering loop, starting with the ground terrain.
  5. Draw all shadows in the second pass relative to the object’s anchor point.
  6. Compile a renderList containing the hero and all active map objects.
  7. Sort the renderList based on the Y-coordinate of each entity’s anchor point.
  8. Draw entities in the sorted order to maintain the 3D depth illusion.
  9. Generate a 2D Passability Matrix that mirrors the map’s grid dimensions.
  10. Update the matrix by marking tiles within an object’s “Logical Footprint” as non-walkable.
  11. Create a toggleable debug mode to draw red squares over blocked tiles.
  12. Upgrade the pathfinding algorithm (like A*) to navigate around blocked matrix tiles.
  13. Define “Interaction Tiles” where the hero can trigger specific object events.
  14. Program the hero to automatically target an object’s interaction tile when clicked.
  15. Use relative offsets for all footprints so they move in sync with the object.