Scrolling issue

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
User avatar
megalukes
Citizen
Posts: 94
Joined: Fri Jun 27, 2014 11:29 pm
Location: Brazil

Scrolling issue

Post by megalukes »

Hi there. I'm having some trouble with scrolling and I have no idea why this is happening. I made two gifs to explain it. When I scroll the screen, the arrow keeps changing its position/tripping for no reason. I was wondering if this is vsync's fault or something like that. Any help would be appreciated.
gifgif.gif
gifgif.gif (953.84 KiB) Viewed 3258 times
gifgif2.gif
gifgif2.gif (1.66 MiB) Viewed 3258 times
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Scrolling issue

Post by Positive07 »

Are you flooring your coordinates? I'm guessing that the arrow is at a position like 1.6 and the level is at 1, so when you scroll 0.4 to the left the map get's floored to 1 and the arrow is floored to 2 or something like that

If you want to make a pixel perfect game always floor your coordinates
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
megalukes
Citizen
Posts: 94
Joined: Fri Jun 27, 2014 11:29 pm
Location: Brazil

Re: Scrolling issue

Post by megalukes »

Oh, man. I was so traumatized about flooring coordinates since I tried to do it in a collision system that flooring in love.draw never crossed my mind. Thank you! :awesome: :awesome: :awesome: :awesome:
gifarrow.gif
gifarrow.gif (452.94 KiB) Viewed 3238 times
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Scrolling issue

Post by Positive07 »

Haha that's great!
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 38 guests