survivor

graphical action game for the linux terminal
git clone https://git.ce9e.org/survivor.git

commit
2d1167e132698099f20af896df540418dfc15eae
parent
ef4d34ef387dc6addde11543895b774d72920491
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-02-20 07:20
do not print over terminal history

Diffstat

M src/term.rs 4 ++++

1 files changed, 4 insertions, 0 deletions


diff --git a/src/term.rs b/src/term.rs

@@ -18,6 +18,9 @@ mod ti {
   18    18     pub fn cup(x: usize, y: usize) {
   19    19         print!("\x1b[{};{}H", x + 1, y + 1);
   20    20     }
   -1    21     pub fn ed() {
   -1    22         print!("\x1b[2J");
   -1    23     }
   21    24     pub fn setab(color: [u8; 3]) {
   22    25         print!("\x1b[48;2;{};{};{}m", color[0], color[1], color[2]);
   23    26     }
@@ -101,6 +104,7 @@ impl Screen {
  101   104         let width = w * 2;
  102   105         let height = (h - 1) * 3;
  103   106         ti::civis();
   -1   107         ti::ed();
  104   108         return Screen {
  105   109             width: width,
  106   110             height: height,