jadijadi / riverraidrust

A text based river raid clone in Rust; streamed
GNU General Public License v3.0
94 stars 28 forks source link

ascii art is displayed only if there is enough space #45

Closed panoschagias closed 7 months ago

panoschagias commented 7 months ago

Closes #37

jadijadi commented 7 months ago

i think doing if/else condition checking for choosing between ascii texts is extra overhead... My suggestion is to choose minimal ASCII art that fits almost any terminal scale, so you don't have to check the terminal size for either just putting ascii text into it or not. (I know you exactly did what @jadijadi asked to do in issues but maybe we can consider a better option) GL.

Kind of agree... but lets merge this one. and we will have smaller ascii arts later.

panoschagias commented 7 months ago

@jadijadi I don't know if it was intentional or not but this part of the goodbye_screen function is missing, making the ASCII art appear on the goodbye screen even if there is not enough space. Will do a PR so it is not forgotten.


    - let _ = sc.queue(MoveTo(0, 2));
    - let _ = sc.queue(Print(goodbye_msg1));
    - let _ = sc.queue(MoveTo(0, 10));
    - let _ = sc.queue(Print(goodbye_msg2));
    + if world.maxc > 77 {
    +    let _ = sc.queue(MoveTo(0, 2));
    +    let _ = sc.queue(Print(goodbye_msg1));
    +    let _ = sc.queue(MoveTo(0, 10));
    +   let _ = sc.queue(Print(goodbye_msg2));
    +}
    +else {
    +    let _ = sc.queue(MoveTo(0, 2));
    +   let _ = sc.queue(Print("Good Game!\n\rThanks."));
    +}