Extend map

This commit is contained in:
Anton Vakhrushev 2019-10-08 16:24:42 +03:00
parent ae3e220dfa
commit 28b0204fdd

View File

@ -1,3 +1,4 @@
require "colorize"
require "./game/**"
require "./cli/**"
@ -41,14 +42,14 @@ def render_map(world)
if x == 0
printf "+"
(0...size).each do |y|
printf "-----+"
printf "------+"
end
print "\n"
end
printf "|"
(0...size).each do |y|
tile = world.map.get(x, y)
printf "%c %d%d|", tile.letter, x, y
printf "%s %d%d|", tile.letter.colorize(:green), x, y
end
print "\n"
printf "|"
@ -60,7 +61,7 @@ def render_map(world)
(0...size).each do |y|
tile = world.map.get(x, y)
if tile.letter == 'f'
printf "%5d|", world.map.get(x, y).cur
printf "%6d|", world.map.get(x, y).cur
else
printf " |", world.map.get(x, y).cur
end
@ -68,7 +69,7 @@ def render_map(world)
print "\n"
printf "+"
(0...size).each do |y|
printf "-----+"
printf "------+"
end
print "\n"
end