Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came back to Ada...
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

46 рядки
2.1KB

  1. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2. -- Copyright (c) 2023 - Ognjen 'xolatile' Milan Robovic
  3. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  4. -- Xabina is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either
  5. -- version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
  6. -- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  7. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  8. with core;
  9. package body map is
  10. ------------------------------------------------------------------------------------------
  11. procedure generate is
  12. begin
  13. for y in height
  14. loop
  15. for x in width
  16. loop
  17. matrical_data (y, x) := (wooden_floor, constant_data (wooden_floor).condition_limit);
  18. end loop;
  19. end loop;
  20. end generate;
  21. procedure render is
  22. symbol : character := ' ';
  23. colour : character := core.colour.white;
  24. effect : character := core.effect.normal;
  25. begin
  26. for y in core.screen_height
  27. loop
  28. for x in core.screen_width
  29. loop
  30. symbol := constant_data (matrical_data (height (y), width (x)).map).symbol;
  31. colour := constant_data (matrical_data (height (y), width (x)).map).colour;
  32. effect := constant_data (matrical_data (height (y), width (x)).map).effect;
  33. core.render_character (symbol, colour, effect, y, x);
  34. end loop;
  35. end loop;
  36. end render;
  37. ------------------------------------------------------------------------------------------
  38. end map;