Weird effect on sprites while moving

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
Urvorn
Prole
Posts: 7
Joined: Thu Apr 12, 2018 5:36 pm

Weird effect on sprites while moving

Post by Urvorn » Mon Apr 16, 2018 8:48 am

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.

Thank you by advance.

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."

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

Re: Weird effect on sprites while moving

Post by zorg » Mon Apr 16, 2018 9:25 am

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. :3
Last edited by zorg on Mon Apr 16, 2018 11:19 am, edited 1 time in total.
Me and my stuff :3True 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.

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

Re: Weird effect on sprites while moving

Post by Urvorn » Mon Apr 16, 2018 9:48 am

Hey thank you for your quick reply !

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

Post by grump » Mon Apr 16, 2018 10:13 am

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))

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

Re: Weird effect on sprites while moving

Post by zorg » Mon Apr 16, 2018 10:22 am

Also, don't forget to do the same for the enemies as well, and probably the bullets too.
Me and my stuff :3True 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.

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

Re: Weird effect on sprites while moving

Post by Urvorn » Mon Apr 16, 2018 10:50 am

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

Post by grump » Mon Apr 16, 2018 11:00 am

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

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests