I just wanted to ask if there is a certain way to create stages / rooms properly.
What I'm currently have in mind is to create a table of invisible bounding boxes like this:
Code: Select all
{1, 1, 1},
{1, 0, 1}, where 1 = Solid, 0 = Free Space
{1, 1, 1}
Code: Select all
love.graphics.draw(ImageOfRoom, x, y)
Will it have an impact from the speed of the game? or is there a particular technique that can be used other than this?
EDIT:
Also, is there a way to insert the stage design from a text document?
For example, I have stg.txt:
Code: Select all
1,1,1,1
1,0,0,1
1,1,1,1
Code: Select all
self.stageDesign = {}
for line in love.filesystem.lines("stg.txt") do
table.insert(self.stageDesign, line)
end
It appears that it is storing them as a string which becomes
Code: Select all
Index 1 = "1,1,1,1"
Index 2 = "1,0,0,1"
Index 3 = "1,1,1,1"
AND NOT
Index 1 = 1
Index 2 = 1
..
Index 2,2 = 0
..
and so on ..