Code: Select all
map = {
a1 = {
x = 0,
y = 0,
width = 640,
height = 480,
image = love.graphics.newImage("img/mapa1.png"),
data = love.image.newImageData("img/mapa1.png")
},
a2 = {
x = a1.x + a1.width, --this is line 11
y = a1.y,
width = 640,
height = 480,
image = love.graphics.newImage("img/mapa2.png"),
data = love.image.newImageData("img/mapa2.png")
},
b1 = {
x = a1.x,
y = a1.y + a1.height,
width = 640,
height = 480,
image = love.graphics.newImage("img/mapb1.png"),
data = love.image.newImageData("img/mapb1.png")
},
b2 = {
x = a1.x + a1.width,
y = a1.y + a1.height,
width = 640,
height = 480,
image = love.graphics.newImage("img/mapb2.png"),
data = love.image.newImageData("img/mapb2.png")
}
}
If I put "map" there, like this:
Code: Select all
x = map.a1.x + a1.width,
So, how do I refer to 'a1'?