Author Topic: Manipulating projectile direction after hitting something? (preitty picturee)  (Read 1311 times)

Is someone up for this challenge? I really need this for a camera machine.

Code: [Select]
package hurr
{
function YourProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(%obj.reflected == 1)
{
parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
return;
}
%obj.setName("-TestProj");
%proj = new Projectile("-SpawnProj":"-TestProj")
{
initialVelocity = vectorScale(%obj.initialVelocity,-1);
reflected = 1;
};
%proj.setName("");
missionCleanup.add(%proj);
%obj.delete();
}
};
activatePackage(hurr);
« Last Edit: July 22, 2012, 04:28:18 PM by Slicks555 »


Projectiles do not belong in the MissionGroup.
I have no idea what you're trying to say.

I have no idea what you're trying to say.

Creating an object while a mission is running seems to add it to the MissionGroup. You should it remove it from it or add it to a different one (e.g. MissionCleanup).

Creating an object while a mission is running seems to add it to the MissionGroup. You should it remove it from it or add it to a different one (e.g. MissionCleanup).
I was unaware of this, but really it would make no difference. The projectile would be assuredly deleted after it's lifetime anyway, and if the mission changed it'd also get deleted.

Regardless, I updated my code.

I think the pinball projectile does this.

I think the pinball projectile does this.
No, it bounces just like pong does.

I think the pinball projectile does this.
Someone didn't look at the diagram