Prototype game engine for Heroes of Might & Magic, featuring a gameplay plot-twist...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.6KB

  1. -- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
  2. --
  3. -- GNU General Public Licence (version 3 or later)
  4. with core, item, unit, construction;
  5. package world is
  6. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  7. type biome is (
  8. ash, sand, grass, rough, snow, swamp
  9. );
  10. ------------------------------------------------------------------------------------------
  11. type landmark_index is (
  12. dead_tree, mossy_rock, palm_tree, pine_tree, reeds, rock,
  13. snowed_pine_tree, snowed_rock, spiky_rock
  14. );
  15. type landmark_trait is record
  16. spawn : biome;
  17. clip : boolean;
  18. frames : integer;
  19. end record;
  20. type entity_trait is record
  21. index : natural;
  22. x, y : integer;
  23. end record;
  24. type tile_array is array (natural range <>, natural range <>) of integer;
  25. type entity_array is array (natural range <>) of entity_trait;
  26. type information is record
  27. kind : biome;
  28. width : natural;
  29. height : natural;
  30. tiles : access tile_array;
  31. landmarks : access entity_array;
  32. constructions : access entity_array;
  33. end record;
  34. ------------------------------------------------------------------------------------------
  35. tiles : core.sprite;
  36. landmarks : array (landmark_index) of core.sprite;
  37. landmark_limit : constant integer := 120;
  38. trait : constant array (landmark_index) of landmark_trait := (
  39. dead_tree => (ash, true, 1),
  40. mossy_rock => (swamp, true, 1),
  41. palm_tree => (sand, true, 4),
  42. pine_tree => (grass, true, 4),
  43. reeds => (swamp, false, 4),
  44. rock => (sand, true, 1),
  45. snowed_pine_tree => (snow, true, 4),
  46. snowed_rock => (snow, true, 1),
  47. spiky_rock => (ash, true, 1)
  48. );
  49. map : information;
  50. ------------------------------------------------------------------------------------------
  51. procedure configure;
  52. procedure make (index : in biome; width, height : in natural);
  53. procedure draw;
  54. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  55. end world;