From f14e0005f082b5d4cbca0f2e0d501ad15da3c856 Mon Sep 17 00:00:00 2001
From: Guillaume Pasquet <dev@etenil.net>
Date: Sat, 23 Nov 2019 22:38:48 +0000
Subject: Fix level start

---
 src/state.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/state.rs')

diff --git a/src/state.rs b/src/state.rs
index 805e9e9..be32228 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -1,5 +1,5 @@
 use crossterm::cursor::MoveTo;
-use crossterm::{queue, Output};
+use crossterm::{execute, queue, Output};
 use std::io::{stdout, Write};
 
 use crate::entities::{Character, Entity, Player};
@@ -38,6 +38,7 @@ impl State {
 
     pub fn render_level(&self) {
         let mut sout = stdout();
+        execute!(sout, MoveTo(0, 0)).unwrap();
         for (linenum, line) in self.grid.as_ref().unwrap().raw_data().iter().enumerate() {
             let linestr = line.iter().map(tile_to_str).collect::<Vec<&str>>();
             let mut linestr2 = String::from("");
-- 
cgit v1.2.3