Xurses...
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2KB

  1. #include <xolatile/xtandard.c>
  2. #include <xolatile/xurses.c>
  3. static int i_x = 0;
  4. static int i_y = 0;
  5. static void i_up (void) { --i_y; limit (& i_y, 0, curses_screen_height - 1); }
  6. static void i_down (void) { ++i_y; limit (& i_y, 0, curses_screen_height - 1); }
  7. static void i_left (void) { --i_x; limit (& i_x, 0, curses_screen_width - 1); }
  8. static void i_right (void) { ++i_x; limit (& i_x, 0, curses_screen_width - 1); }
  9. int main (void) {
  10. curses_configure ();
  11. curses_bind (SIGNAL_W, i_up);
  12. curses_bind (SIGNAL_S, i_down);
  13. curses_bind (SIGNAL_A, i_left);
  14. curses_bind (SIGNAL_D, i_right);
  15. while (curses_active != 0) {
  16. curses_render_background ('.', COLOUR_GREY, EFFECT_BOLD);
  17. curses_render_character ('A', COLOUR_GREEN, EFFECT_NORMAL, 0, 1);
  18. curses_render_character ('B', COLOUR_YELLOW, EFFECT_REVERSE, 0, 2);
  19. curses_render_character ('C', COLOUR_WHITE, EFFECT_BLINK, 1, 0);
  20. curses_render_character ('D', COLOUR_BLUE, EFFECT_ITALIC, 2, 0);
  21. curses_render_string ("Heyo world!", COLOUR_RED, EFFECT_BOLD, 3, 0);
  22. curses_render_string ("Heyo world!", COLOUR_PINK, EFFECT_BOLD, 168, 0);
  23. curses_render_character ('@', COLOUR_CYAN, EFFECT_ITALIC, i_x, i_y);
  24. curses_synchronize ();
  25. }
  26. return (EXIT_SUCCESS);
  27. }