Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Player.TestMap(x, y)
- local current_location = gamestate.current().layers[1]
- local tileheight, tilewidth = gamestate.current().tileheight, gamestate.current().tilewidth
- actual_position = vector(Player.position.x + 36.5, Player.position.y + 97) --valori numerici apposta per la sprite usata
- if current_location[math.floor(actual_position.x/tilewidth)+x][math.floor(actual_position.y/tileheight)+y]~=0 then
- return false
- return true
- end
- --[[
- if love.keyboard.isDown("up") then
- if TestMap(0,-1) then
- -- allow update position
- end
- end
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement