Sample code as to what I'm doing:
Code: Select all
function love.mousereleased(x, y, button)
if ((x > 0 and x < 21) == true) and ((y > 279 and y < 301) == true) and button == "l" then
aoff = 1
elseif ((x > 0 and x < 21) == true) and ((y > 279 and y < 301) == true) and button == "r" then
aoff = 2
end
Code: Select all
if aoff == 2 then
if blockcolor == "a" then
tiles.a = love.graphics.draw(water,0 , 280)
elseif blockcolor == "b" then
tiles.a = love.graphics.draw(redb, 0, 280)
elseif blockcolor == "c" then
tiles.a = love.graphics.draw(greenb, 0, 280)
end
end
The issue with this is that I have to do the code over and over again for every possible block. It's not like I won't do that or I'm too lazy , but I'd just like to know if a superior method exists.
Lastly, some screenshots showing blocks. =)
![Image](http://i.imgur.com/Zn7kd.png)
![Image](http://i.imgur.com/LgDhX.png)
I'd love some feedback so I can improve. Thanks for reading, regardless!