cards=0; lp=love.graphics; hand={x=200,y=400} pi= 3.1459 function hand_draw_logic(count) rotfirstcard=-(pi*0)-(pi/32)*(count-1) rotpercard=pi/16 xpercard=300/count xfirstcard=-150/count ypercard=0 end function draw_card(postion) lp.push() lp.translate(xpercard*postion+xfirstcard,ypercard*postion) lp.push() lp.rotate(postion*rotpercard+rotfirstcard) lp.translate(-70,-100) lp.rectangle("fill",0,0,140,200) lp.setColor(1, 0, 0); lp.rectangle("fill",0,0,10,10) lp.pop() lp.pop(); end function love.keypressed(key) if key=="w" then cards=cards+1; elseif key=="s" then cards=cards-1; end end function love.draw() hand_draw_logic(cards) lp.push() lp.translate(hand.x,hand.y) for i=1, cards do if math.mod(i,2)==0 then lp.setColor(1, 1, 1); else lp.setColor(.30, .30, .30); end draw_card(i) end lp.pop() end