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...
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

51 Zeilen
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.generate;
  22. weapon.generate;
  23. ------------------------------------------------------------------------------------------
  24. loop
  25. map.render;
  26. item.render;
  27. weapon.render;
  28. player.render;
  29. core.render_buffer;
  30. action.scan;
  31. action.list (character'pos (action.signal)).all;
  32. exit when action.active = false;
  33. end loop;
  34. ------------------------------------------------------------------------------------------
  35. core.screen_show_cursor;
  36. return 0;
  37. end main;