a hack! damn. i added block_width/2 to p_x and subtracted block_height/4
from p_y to get the player aligned with the proper grid space it's supposed to be standing on. woe is me. will work for now. until it doesn't!
This commit is contained in:
parent
97e9dc2c50
commit
ba2e986ee5
6
main.lua
6
main.lua
|
@ -1,5 +1,7 @@
|
|||
function love.load()
|
||||
|
||||
math.randomseed(os.time())
|
||||
|
||||
load_sounds()
|
||||
|
||||
--load graphics
|
||||
|
@ -226,7 +228,9 @@ function draw_player()
|
|||
|
||||
--test
|
||||
--love.graphics.draw(player_dr.spriteSheet, player_dr.quads[spriteNum], player_x, player_y, 0, 2)
|
||||
love.graphics.draw(player_dr.spriteSheet, player_dr.quads[spriteNum], grid_x + ((p_y-p_x) * (block_width / 2)), grid_y + ((p_x+p_y) * (block_depth / 2)) - (block_depth * (grid_size / 2)) - block_depth, 0, 2)
|
||||
--note: there's some weird half-solution that will come back to bite me. i added block_width/4 to p_x and subtracted block_height/2 from p_y to get player to right place in grid
|
||||
love.graphics.draw(player_dr.spriteSheet, player_dr.quads[spriteNum], grid_x + ((p_y-p_x) * (block_width / 2)) + block_width/4, grid_y + ((p_x+p_y) * (block_depth / 2)) - (block_depth * (grid_size / 2)) - block_depth - block_height/2, 0, 2)
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue