Quad Help
Posted: Sat Feb 21, 2015 8:36 pm
I have a list of quads for a small kids game. I wanted to know how would be the best way to pull out each variable in the quad and assign it to another variable.
Code: Select all
gr, down = love.graphics, love.keyboard.isDown
q_state = 0
q_zero = gr.newQuad(0, 0, 128, 128, img.sprite:getDimensions())
q_one = gr.newQuad(128, 0, 128, 128, img.sprite:getDimensions())
q_one = gr.newQuad(128, 0, 128, 128, img.sprite:getDimensions())
q_two = gr.newQuad(256, 0, 128, 128, img.sprite:getDimensions())
q_three = gr.newQuad(384, 0, 128, 128, img.sprite:getDimensions())
if key == "n" then q_state = q_state + 1 end
if q_state == 0 then q_display = q_zer0 end
if q_state == 1 then q_display = q_one end
-- ---QUESTION????----
-- now how do I get each variable out of q_display so i can use them
gr.draw( img.sprite, q_display, x, y )