Hello! I am VERY new to programming and everything so bear with me please
I'm working on a Pac-Man clone just to practice coding and I ran into an issue I don't really understand with rotating the image on my sprite. Without using rotatedImage, my animation plays fine:
(notice you can see the full circle)
However, adding a line of code applying rotatedImage cuts off the sides of my animation and makes this:
Here is the code, the only difference between the two screenshots is that I commented out the line "currentFrame = currentFrame:rotatedImage(0)" for the first screenshot. This problem occurs at 90 and 180 degrees as well. In addition, I'm definately still trying to wrap my head around how animation works (no PlayDate specific animation tutorials on YouTube yet XD) so I'd love any advice on how I coded that. Thank you!
local pd <const> = playdate local gfx <const> = pd.graphics class('Player').extends(gfx.sprite) function Player:init() local playerImageTable = gfx.imagetable.new("images/pacman") self.playerAnimation = gfx.animation.loop.new(100, playerImageTable, true) self:moveTo(50,50) self:add() end function Player:update() local currentFrame = self.playerAnimation:image() currentFrame = currentFrame:rotatedImage(0) self:setImage(currentFrame, gfx.kImageUnflipped, 4) end