Explosion Area Define
I want to petrol tank for example patrol tank blast size is 150 width and 150 height and that time I want to define perticular area suppose car is park from 200 pixel. That time I want to blast car also with petrol tank. And suppose car park 300 away from petrol tank I donot want to blast car.
How to do that. Please explain. Its radius count or something else?
How to do that. Please explain. Its radius count or something else?
Comments
magnitude( game.carX - self.Position.X , game.carY - self.Position.Y )
Game objects would have a self.magnitude real attribute
Rules on the game objects that would take damage would look like this;
When explosion = True:
Change attribute self.magnitude to;
magnitude( game.position.X - self.Position.X , game.position.Y - self.Position.Y )
Rule; if magnitude = < 150 change attribute self.life to - ??? (whatever you want here)
if magnitude is >150 AND < 250 change attribute self.life to - ??? (whatever you want here)
if magnitude is > 250 change attribute self.life to - ??? (whatever you want here)
Chagne attribute self.magnitude to 0 (Put this last so it changes back for future explosions).
Hope this makes sense.