Need help for tile map system

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
VXDev
Prole
Posts: 6
Joined: Sun May 28, 2023 6:12 pm

Need help for tile map system

Post by VXDev »

i need help with my tile system i attached my file and the outline of the tiles whenever i move looks like green or black when i move around
pls help
Attachments
game.zip
heres the source
(4.85 MiB) Downloaded 42 times
User avatar
knorke
Party member
Posts: 274
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: Need help for tile map system

Post by knorke »

It seems to be some subpixel/rounding problem.
I added rounding here and that fixed it:

Code: Select all

function love.update(dt)
    camera:lookAt(math.floor(player.x+0.5), math.floor(player.y+5))
--was:    camera:lookAt(player.x,player.y)
Also those 31.9999999999999 can just be 32.
VXDev
Prole
Posts: 6
Joined: Sun May 28, 2023 6:12 pm

Re: Need help for tile map system

Post by VXDev »

thank you sm
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 4 guests