Prototype game engine for Heroes of Might & Magic, featuring a gameplay plot-twist...
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

83 lignes
2.9KB

  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 clip_array is array (natural range <>, natural range <>) of boolean;
  26. type view_array is array (natural range <>, natural range <>) of boolean;
  27. type entity_array is array (natural range <>) of entity_trait;
  28. type information is record
  29. kind : biome;
  30. width : natural;
  31. height : natural;
  32. tiles : access tile_array;
  33. clips : access clip_array;
  34. views : access view_array;
  35. landmarks : access entity_array;
  36. constructions : access entity_array;
  37. items : access entity_array;
  38. end record;
  39. ------------------------------------------------------------------------------------------
  40. tiles : core.sprite;
  41. landmarks : array (landmark_index) of core.sprite;
  42. landmark_limit : constant integer := 120;
  43. trait : constant array (landmark_index) of landmark_trait := (
  44. dead_tree => (ash, true, 1),
  45. mossy_rock => (swamp, true, 1),
  46. palm_tree => (sand, true, 4),
  47. pine_tree => (grass, true, 4),
  48. reeds => (swamp, false, 4),
  49. rock => (sand, true, 1),
  50. snowed_pine_tree => (snow, true, 4),
  51. snowed_rock => (snow, true, 1),
  52. spiky_rock => (ash, true, 1)
  53. );
  54. map : information;
  55. ------------------------------------------------------------------------------------------
  56. procedure configure;
  57. procedure make (index : in biome; width, height : in natural);
  58. procedure draw;
  59. procedure view;
  60. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  61. end world;