Where was that enemy radius detection example?
TouchTiltGames
Member Posts: 1,162
I think Tshirtbooth had it up somewhere, it was to demo - if an actor or bullet was close to an enemy radius it would react to it....Anyone know where that is?
Comments
magnitude is used like this:
myMagnitude = magnitude(Actor1.X - Actor2.X , Actor1.Y - Actor2.Y)
Rule
When myMagnitude < [some number]
-----[do something]
On the Actor:
When game.bombClose = 1
Change attribute: game.bombClose to: magnitude( game.bombRadiusX - self.Position.X , game.bombRadiusY - self.Position.Y )
When game.bombClose > 100
Play Sound
On the Bomb:
When game.bombClose = 1
game.bombRadiusX to: self.positionx
game.bombRadiusY to: self.positionY
Doesn't seem to be working for me
Do you have game.bombRadiusX constrained to the x position of something?
game.bombRadiusX to: self.positionx
game.bombRadiusY to: self.positionY
Still isn't working hmm..good thing I bought Photics GS book