I was thinking about trying to make a simple roguelike.
Years ago I knew there is no way I can achieve that but today I'm not so sure
Let's try to create some map
Code: Select all
map = {}
for i=1, 45, 1 do
map[i] = {}
for j=1, 27, 1 do
map[i][j] = insert_tile('stone_floor')
end
end
Code: Select all
function insert_tile(type)
local tile, rand, color
if type == 'stone_floor' then
-- make a copy of the tile
tile = deepcopy(tile_type.stone_floor)
-- choose random character
rand = math.random(1, #tile.char_pool)
tile.char = tile.char_pool[rand]
-- and random color
rand = math.random(1, #tile.pallete)
tile.color = tile.pallete[rand]
Now the real struggle is with drawing the map.
Drawing this simple rectangle of characters gives me 60-100 fps.
What if I want colors, background colors, custom font?
I can't update only changed positions because not drawing equals black screen. Canvases are not supported.
I'm not looking for Dwarf Fortress sized maps.. just the tip