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...
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.

50 lignes
2.2KB

  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, game, action, map, item, magic, ammunition, weapon, armour, plant, animal, monster, player;
  9. function main return integer is
  10. begin
  11. ------------------------------------------------------------------------------------------
  12. action.bind ('Q', action.game_exit'access);
  13. action.bind ('w', player.move_up'access);
  14. action.bind ('s', player.move_down'access);
  15. action.bind ('a', player.move_left'access);
  16. action.bind ('d', player.move_right'access);
  17. core.screen_delete;
  18. core.screen_offset;
  19. core.screen_hide_cursor;
  20. map.generate;
  21. item.create (item.paperweight, 1, 1);
  22. ------------------------------------------------------------------------------------------
  23. loop
  24. map.render;
  25. player.render;
  26. item.render;
  27. core.render_buffer;
  28. action.scan;
  29. action.list (character'pos (action.signal)).all;
  30. exit when action.active = false;
  31. end loop;
  32. ------------------------------------------------------------------------------------------
  33. core.screen_show_cursor;
  34. return 0;
  35. end main;