games50 / breakout

Remake of the classic Atari game Breakout!
35 stars 82 forks source link

Visual Bug on Sprite Movement - Quads #3

Closed 09jlardinois closed 6 years ago

09jlardinois commented 6 years ago

Hey, I'm getting a visual bug where a sort of ghost line effect is seen during sprite movement (from a sprite sheet) whenever the sprite moves past / through its quad edge values.

I spent the night building an animation system that runs animations off of sprite sheets and noticed it and thought it was just my code, but then I tested it with a static, moving paddle and the same thing happens.

It's like there's an invisible grid of funny lines at each quad width / height interval that shows up on the sprite whenever it moves.

09jlardinois commented 6 years ago

I found someone that said something about screen scaling (like push) and sub-pixel rendering. It sounded convincing.

I tried to floor function the x / y changes like they said and the quad scaling, but it didn't work. I don't know why quad scaling would matter, but that's what they said.

Update: changed Push settings to PixelPerfect - fixed, but now there's a crazy black border.

09jlardinois commented 6 years ago

Solved:

Many Edits: GitHub formatting is somehow more buggy than StackOverflow. Deserves an award.

constants.lua WINDOW_WIDTH, WINDOW_HEIGHT = love.window.getDesktopDimensions()

main.lua push:setupScreen(VIRTUAL_WIDTH, VIRTUAL_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT, { vsync = true, fullscreen = true, resizable = true, pixelperfect = true, stretched = true })