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
Weird effect on sprites while moving
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Weird effect on sprites while moving
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: 3470
- 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.
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.
Re: Weird effect on sprites while moving
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.
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."
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.
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: 3470
- 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.
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."
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: Ahrefs [Bot], Bing [Bot], Google [Bot] and 4 guests