Particles: Relative positioning?
Posted: Thu Jul 12, 2012 1:57 am
Hi,
I am trying to integrate some particle effects into our game.
I am using a table called "camera" with variables "x" and "y" to scroll a level in relation to the player. So, for instance, when I draw the player, it's drawn to player.x + camera.x and player.y + camera.y.
However, when I want to position a particle system on the player, I set it to player.x+camera.x, player.y+camera.y, and it works, but the particles themselves are not being drawn relative to the camera, like the emission point is. That is, I assume, because the particle emitter doesn't care about the camera.x and camera.y variables.
Is there a way that I can make this happen?
Thanks in advance.
I am trying to integrate some particle effects into our game.
I am using a table called "camera" with variables "x" and "y" to scroll a level in relation to the player. So, for instance, when I draw the player, it's drawn to player.x + camera.x and player.y + camera.y.
However, when I want to position a particle system on the player, I set it to player.x+camera.x, player.y+camera.y, and it works, but the particles themselves are not being drawn relative to the camera, like the emission point is. That is, I assume, because the particle emitter doesn't care about the camera.x and camera.y variables.
Is there a way that I can make this happen?
Thanks in advance.