Search found 82 matches

by unixfreak
Sun Feb 14, 2016 2:44 am
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 410934

Re: "Questions that don't deserve their own thread" thread

I'm afraid not. Another thing you could do is call math.random(20,70) then make a condition based on another math.random() where you multiply the result by -1. I had tried something similar to that. I guess just using a function to call itself again is probably the simplest way though. Thanks though.
by unixfreak
Sun Feb 14, 2016 2:03 am
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 410934

Re: "Questions that don't deserve their own thread" thread

Simple question. I've tried a few things, but unaware how to solve it; I have some pickups dropped by enemies as they die, and want them to float in a random direction. So i have these added as part of a table entry. xvel = math.random(-70,70), yvel = math.random(-70,70), The problem is, i don't wan...
by unixfreak
Sat Feb 06, 2016 2:57 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 410934

Re: "Questions that don't deserve their own thread" thread

I hope this makes sense as i have a hard time searching for a method on this. Is there a simple approach to getting a 'negative' colour depending on what is drawn behind? For instance, if i have a canvas with colours that clash with another transparent canvas drawn in front, is there a way to make t...
by unixfreak
Thu Jan 28, 2016 5:03 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 410934

Re: "Questions that don't deserve their own thread" thread

I have a question about keyboard shortcuts (desktop specific) and keybinds within a love application. For instance in a shoot-em-up style game, the player will be holding the fire/shoot key most of the time. If the key to pause the game is "escape", and the key to shoot is "rctrl"...
by unixfreak
Wed Jan 27, 2016 1:46 am
Forum: Support and Development
Topic: [Solved] objects twitching when moving / removing from table?
Replies: 6
Views: 2292

Re: objects twitching when moving / removing from table?

When you do table.remove all the elements further down the table are moved upwards one slot, but the for loop doesn't "know" so it just keeps going regularily, skipping the next item. The trick is to instead use a regular for loop and iterate backwards for i=#items,1,-1 do local item = it...
by unixfreak
Wed Jan 27, 2016 1:39 am
Forum: Support and Development
Topic: [Solved] objects twitching when moving / removing from table?
Replies: 6
Views: 2292

Re: objects twitching when moving / removing from table?

Well, I think i've just found a workaround. In love.update(dt) i move the table.remove( .. ) to another loop after shifting the x position, which seems to fix the problem... i'm not sure it it's ideal though -- is there a way to get that behaviour in a single loop? Original: for i,s in pairs(square....
by unixfreak
Wed Jan 27, 2016 1:35 am
Forum: Support and Development
Topic: [Solved] objects twitching when moving / removing from table?
Replies: 6
Views: 2292

Re: objects twitching when moving / removing from table?

Here's a screenshot from the game i am working on, which hopefully makes the problem more clear; screen1.jpg The sprites should stay in formation, like the ones at the top right of the screen. But as an enemy goes off the left side (it is just removed from the table) which causes the next enemy in t...
by unixfreak
Wed Jan 27, 2016 1:22 am
Forum: Support and Development
Topic: [Solved] objects twitching when moving / removing from table?
Replies: 6
Views: 2292

Re: objects twitching when moving / removing from table?

For me, they're constantly twitching, but that's an issue with my window manager. Either try math.floor-ing the x and y coordinates of your squares in your love.draw, or try running it in fullscreen, whether the issue exists there as well, or not. Unfortunately i've tried all of that. I did also di...
by unixfreak
Wed Jan 27, 2016 12:48 am
Forum: Support and Development
Topic: [Solved] objects twitching when moving / removing from table?
Replies: 6
Views: 2292

[Solved] objects twitching when moving / removing from table?

I have a side-scrolling project (like a space shooter) where enemies come in waves from the right side of the screen, and i have encountered a problem i haven't been able to solve. Basically, as an enemy goes off the left side of the screen, it is removed from the table -- however, the next enemy in...
by unixfreak
Sat Dec 05, 2015 11:00 pm
Forum: General
Topic: How to address unwanted motion blur?
Replies: 3
Views: 3025

How to address unwanted motion blur?

This is mostly relative to side-scrolling games, i tried searching the forum but only found this thread -- https://love2d.org/forums/viewtopic.php?f=4&p=91044 Basically, regardless of any colour palette, i can never seem to get around unwanted motion blur with a side-scrolling game. If you think...