Math serious problem.

I have some math problem. I have an object SHIP that travells in X and Y direction. What I want to do is to spawn another object when SHIP is in X,Y direction but not exactly in X and Y but anywhere near this position. For examle:

SHIP is in 400x600 position and I want to spawn MONSTER object when SHIP is in X=400 (+/- 20px) and Y=600 (+/-20px)
So the object will be spawned when the ship is in X=from 380 to 420 and Y= from 580 to 620 direction.

I hope that this is clear enaugh.


Best Answer

  • gyroscopegyroscope I am here.Posts: 6,598
    edited November 2012 Accepted Answer

    @danielhalat

    Hi, try something like the following:

    Make two real attributes, let's call them ShipX and ShipY

    Constrain Attribute ShipX to ActorShip.Position.x
    Constrain Attribute ShipY to ActorShip.Position.y

    Rule: When All ShipX =>380 and ShipX =<420 and ShipY =>580 and ShipY =<620
    Spawn MONSTER

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Answers

Sign In or Register to comment.