- for (const t in game.things) {
- terminal.write(game.things[t][0], game.things[t][1], '@');
+ let offset = [(terminal.rows / 2) - player_position[0],
+ terminal.cols / 4 - player_position[1]];
+ for (let term_y = offset[0], map_y = 0;
+ term_y < terminal.rows && map_y < game.map_size[0];
+ term_y++, map_y++) {
+ if (term_y >= 0) {
+ let to_draw = map_lines[map_y].join('').slice(0, terminal.cols / 2 - offset[1]);
+ terminal.write(term_y, offset[1], to_draw);
+ }