firstly I wish to thank the LOVE creators, I'm learning to use this game engine but I feel already quite comfortable with it.
Here's my problem:
I'm developing a little fighting style game (a "street fighter" cartoon remake). Every player is composed of 5 separated images (I've used a spritesheet of course): body, two legs and two hands.
When a player goes to the right side of the screen (facing the enemy to his left) I have to reverse the player, so, in my love.draw() I have:
Code: Select all
love.graphics.push()
if (self.reversed) then
love.graphics.translate(pl.body.x + pl.body.width/2, pl.body.y + pl.body.height/2)
love.graphics.scale(-1,1)
love.graphics.translate(-(pl.body.x + pl.body.width/2), -(pl.body.y + pl.body.height/2))
end
--Draw Body parts--
love.graphics.pop()
Could you suggest me a nice solution to this?
Thank you in advance