stuarthoye / Observer_Effect

Ludum Dare Gamejam Project
0 stars 0 forks source link

Interaction between Red and Blue creates Purple #4

Closed Boombostak closed 9 years ago

Boombostak commented 9 years ago

We'll need to work out a smart way to store the location of the collision so that the colliding particles don't interaction with the created particle before they are culled.

stuarthoye commented 9 years ago

void OnCollisionEnter(Collision collision){/code/} -- we can access the transform at the location by calling collision.transform within the OnCollisionEnter method.

Boombostak commented 9 years ago

My concern is that if the purple particle reacts with the Red and Blue particles in some way, they will all inhabit the same space momentarily as the Purple is spawned and the Red and Blue are culled. We obviously can't call Destroy() on the Red/Blue particles before spawning the Purple. We may need to spawn an additional GameObject whose purpose is to delay the Purple spawn until the Red and Blue are culled and maybe also provide a visual effect like a flash or puff of smoke.

stuarthoye commented 9 years ago

Cool. So the spawner object will need to track the two colliding particles' color, and info about each particle's movement. Once it has all the info it needs, it can produce the visual effect (lensflare???) and destroy the two colliding particles. Then it instantiates the new particle.

I think color and movement info are the most important details to track. Are there other bits that you think are important for the spawner?

Boombostak commented 9 years ago

I think we need to move away from using color as the way we track particle types. It's too inflexible. We can check for the unique scripts associated with the particles, we can use tags, or we could use the name of the particles.