I need someone to take a look and point out what i am doing wrong
What is meant to happen. press direction arrow , moves ship in the desired direction , particles come out flowing to the opposite direction.
what happens, ship rotates incorrectly , particles flow in weird directions.
particles and direction woes
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
particles and direction woes
- Attachments
-
test.love
- (2.06 KiB) Downloaded 164 times
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: particles and direction woes
Sounds to me like you've messed up some trigonometry (math.sin, math.cos, and the like). Sadly, I'm awful at math, so I doubt I could be of much assistance. So either play with that, or someone else will be along shortly to help.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Re: particles and direction woes
It's not a math thing. It's the way you store the angle information. You calculate the difference between previous and current "x" position and "y" position. The problem is, when you go only on the "x" position that "y differential" doesn't dissapear, so it keeps showing the ship and the particles as going diagonally. My suggestion is to widen your control "if" block with the 8 directions, turning each case into an "elseif".
Re: particles and direction woes
Ellohir wrote:It's not a math thing. It's the way you store the angle information. You calculate the difference between previous and current "x" position and "y" position. The problem is, when you go only on the "x" position that "y differential" doesn't dissapear, so it keeps showing the ship and the particles as going diagonally. My suggestion is to widen your control "if" block with the 8 directions, turning each case into an "elseif".
thanks i just worked it out just before rechecking the thread if your interested here is the fixed version
- Attachments
-
test.love
- (2.5 KiB) Downloaded 189 times
Re: particles and direction woes
Nice job, control feels great now 

-
- Prole
- Posts: 18
- Joined: Fri Dec 16, 2011 11:29 pm
Re: particles and direction woes
the particles look great!
Who is online
Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Bing [Bot] and 7 guests