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.

46 Zeilen
1.9KB

  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 player is
  10. ------------------------------------------------------------------------------------------
  11. use type core.screen_width;
  12. use type core.screen_height;
  13. procedure render is
  14. begin
  15. core.render_character ('@', core.colour.cyan, core.effect.bold, core.screen_height (data.y), core.screen_width (data.x));
  16. end render;
  17. procedure move_up is
  18. begin
  19. player.data.y := player.data.y - 1;
  20. end move_up;
  21. procedure move_down is
  22. begin
  23. player.data.y := player.data.y + 1;
  24. end move_down;
  25. procedure move_left is
  26. begin
  27. player.data.x := player.data.x - 1;
  28. end move_left;
  29. procedure move_right is
  30. begin
  31. player.data.x := player.data.x + 1;
  32. end move_right;
  33. ------------------------------------------------------------------------------------------
  34. end player;