Explosion pushes actor back

millerbrother1millerbrother1 Member Posts: 108
edited November -1 in Working with GS (Mac)
I have a bomb that explodes and spawns an explosion cloud actor that grows and fades away. The effect looks great, especially with a few particles thrown around for good measure.

However, I want to create a rule that when the Player is within X distance (or collides with the cloud could work). That the explosion will A) lower his health and more importantly B) throw the actor back with a significant amount of velocity.

Any ideas how to approach this?

In my mind I was thinking I would try adding the logic to the Player.

When Player Collides with Explosion Cloud

Change Attribute self.Health to self.Health-1

Timer > For .5 Seconds
- Change self.LinearVelocityX to ________.

This is where I'm stumped. How do I know which direction to move the Actor. It would depend on which side of the explosion he is on.

I was at first considering having a Bomb.X and Bomb.Y Game Attribute that is constrained to the bomb's X & Y. However, I don't think it would work because the bomb is spawned as ammo from an enemy and there is the possibility of having two bombs on the screen at once.

Any other ideas?

Comments

Sign In or Register to comment.