Translations and particle systems: persistent coordinates?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
stcredzero
Prole
Posts: 11
Joined: Fri Apr 05, 2013 1:10 am

Translations and particle systems: persistent coordinates?

Post by stcredzero »

Hi. I'm writing a 2D scroller.

Image

I'm trying to get particle effects to stay below specific features in my map. This is confusing because all of the coordinate transforms are supposed to be over with when love.draw() is done. The locations of particle effects are persistent, however. How does this work?
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: Translations and particle systems: persistent coordinate

Post by adnzzzzZ »

Couldn't understand your question but I hope this helps:

Code: Select all

...
  ps = love.graphics.newParticleSystem(...)
  ps_p = love.graphics.newParticleSystem(...)
  ps_p:setPosition(100, 100)
...

love.draw()
  love.graphics.draw(ps, 400, 300) -- will draw ps at x = 400, y = 300
  love.graphics.draw(ps_p, 400, 300) -- will draw ps_p at x = 500, y = 400
stcredzero
Prole
Posts: 11
Joined: Fri Apr 05, 2013 1:10 am

Re: Translations and particle systems: persistent coordinate

Post by stcredzero »

It might come down to an inconsistency in the API applied to particle systems. I was not able to get love.graphics.translate() to work with them properly, but using the offset arguments in love.graphics.draw did the trick.
User avatar
markgo
Party member
Posts: 190
Joined: Sat Jan 05, 2013 12:21 am
Location: USA

Re: Translations and particle systems: persistent coordinate

Post by markgo »

I would suggest reporting it in the issues for bitbucket for future reference!
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Translations and particle systems: persistent coordinate

Post by bartbes »

Is it the old emitted particles that move about when you change the translation?
stcredzero
Prole
Posts: 11
Joined: Fri Apr 05, 2013 1:10 am

Re: Translations and particle systems: persistent coordinate

Post by stcredzero »

bartbes wrote:Is it the old emitted particles that move about when you change the translation?
From what I recall, it's the old emitted particles that *don't move* when you change the translation using love.graphics.translation() -- but only when you are using Tangential Acceleration. In that case, it worked when I changed to using the offset arguments or using setPosition. I can try to code up a simplified example/testcase to see if it wasn't something goofy in my code or if it is going wrong like I thought.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests