## Weird effect on sprites while moving

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Urvorn
Prole
Posts: 7
Joined: Thu Apr 12, 2018 5:36 pm

### Weird effect on sprites while moving

Hello everyone !

So currently I'm trying to create a Space Invaders clone but I have a problem that I don't seen before.
When my sprites are moving there is a weird effect on the borders. When I've created the sprites I have set a background color and make it transparent and this the problem : sometimes when the sprites are moving we can see the background color of my sprites and it should not happen.

Sorry for the title of this topic but I don't know the problem so I try to be as precise as possible. And also I don't know how to create screenshots with LOVE.

Here is the code :

https://pastebin.com/tYtekk5G
Last edited by Urvorn on Mon Apr 16, 2018 9:37 am, edited 1 time in total.
"The most important is not to succeed, it's to try to succeed."

zorg
Party member
Posts: 2202
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

### Re: Weird effect on sprites while moving

if you're on windows, Alt + PrintScreen while having the löve window focused, should take a screenshot of the window's contents, then you can paste that into mspaint, save, upload and that's basically it. Edit: effort: A, reading comprehension: D-- .P

Also, show code (in [ code ] [ /code ] tags), and images.
Last edited by zorg on Mon Apr 16, 2018 11:19 am, edited 1 time in total.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

Urvorn
Prole
Posts: 7
Joined: Thu Apr 12, 2018 5:36 pm

### Re: Weird effect on sprites while moving

I've updated the first comment to show the code but the screenshots are not really good you will see nothing.
"The most important is not to succeed, it's to try to succeed."

grump
Party member
Posts: 297
Joined: Sat Jul 22, 2017 7:43 pm

### Re: Weird effect on sprites while moving

It's kind of hard to analyze a problem when you're unable to show what the problem is.

Taking a wild guess from your description: it may be caused by drawing the sprites at non-integer coordinates. Try rounding the sprite positions to the nearest integer coords in love.draw.

Code: Select all

love.graphics.draw(hero.image, math.floor(hero.x + .5), math.floor(hero.y + .5))

zorg
Party member
Posts: 2202
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

### Re: Weird effect on sprites while moving

Also, don't forget to do the same for the enemies as well, and probably the bullets too.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

Urvorn
Prole
Posts: 7
Joined: Thu Apr 12, 2018 5:36 pm

### Re: Weird effect on sprites while moving

Ok thank you I will try. But the screenshots don't work, they show my entire screen...
"The most important is not to succeed, it's to try to succeed."

grump
Party member
Posts: 297
Joined: Sat Jul 22, 2017 7:43 pm

### Re: Weird effect on sprites while moving

Crop it in mspaint, or do as zorg said, use Alt+PrintScreen. That will only capture the active window.

### Who is online

Users browsing this forum: No registered users and 8 guests