Fix small errors in player sprite location on <standard size
This commit is contained in:
parent
32a9d7627a
commit
6740c59e8f
|
@ -918,18 +918,30 @@ function drawPlayer()
|
|||
local rotation = nil
|
||||
if player_direction == directions.up then
|
||||
rotation = 0
|
||||
x = x + scale/2
|
||||
y = y + scale
|
||||
if player_animation_flip then
|
||||
x = x + scale
|
||||
end
|
||||
elseif player_direction == directions.left then
|
||||
rotation = math.pi * 1.5
|
||||
x = x + scale
|
||||
y = y + scale/2
|
||||
if not player_animation_flip then
|
||||
y = y + scale
|
||||
end
|
||||
elseif player_direction == directions.down then
|
||||
rotation = math.pi
|
||||
x = x + scale/2
|
||||
if not player_animation_flip then
|
||||
x = x + scale
|
||||
y = y + scale
|
||||
else
|
||||
y = y + scale
|
||||
end
|
||||
elseif player_direction == directions.right then
|
||||
rotation = math.pi * 0.5
|
||||
y = y + scale/2
|
||||
if not player_animation_flip then
|
||||
x = x + scale
|
||||
else
|
||||
x = x + scale
|
||||
y = y + scale
|
||||
end
|
||||
else
|
||||
error("Player facing a direction without usable sprite")
|
||||
end
|
||||
|
@ -937,9 +949,9 @@ function drawPlayer()
|
|||
-- Our sprite image is drawn assuming 16 pixels per tile
|
||||
love.graphics.setColor(1, 1, 1)
|
||||
if not player_animation_flip then
|
||||
love.graphics.draw(sprite, x, y, rotation, scale/16, scale/16, scale/2, scale)
|
||||
love.graphics.draw(sprite, x, y, rotation, scale/16, scale/16)
|
||||
else
|
||||
love.graphics.draw(sprite, x, y, rotation, -scale/16, scale/16, scale/2, scale)
|
||||
love.graphics.draw(sprite, x, y, rotation, -scale/16, scale/16)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue