Hearthstone-like card hold mechanic?
Posted: Mon Jan 21, 2019 2:17 am
Hey guys, its been awhile since i last asked a question, huh? so what are we waiting for! I'm working on a bakugan-like game and i'm trying to make card holding mechanic that similar to hearthstone. I made something like that:
It almost works good but the display not the same as the one one the hearthstone.
So the question here is, i guess, how can i reorganize the rotation of the cards whenever a new card added to our hand? or should i put limits like if cards==5 or cards==3 etc.
by the way, is there a solution about bad rendered rectangles?
Code: Select all
cards=0;
lp=love.graphics;
function love.keypressed(key)
if key=="w" then
cards=cards+1;
elseif key=="s" then
cards=cards-1;
end
end
function love.draw()
for i=1, cards do
if i%2==0 then
lp.setColor(255, 40, 40);
else
lp.setColor(30, 30, 30);
end
lp.push();
lp.rotate(220+(i*220)-220);
lp.rectangle("fill", 100+(i*100)-100, 100-(i*5)-5, 140, 205);
lp.pop();
end
end
It almost works good but the display not the same as the one one the hearthstone.
So the question here is, i guess, how can i reorganize the rotation of the cards whenever a new card added to our hand? or should i put limits like if cards==5 or cards==3 etc.
by the way, is there a solution about bad rendered rectangles?