Change attributes with location of actor

crapscraps Member Posts: 353
edited November -1 in Working with GS (Mac)
I have an actor who moves across the screen and when he's at x = 160 I have the following. Which turns on a light using interpolate.

(attribute.self.position.X = 160)
(change attribute to lights = true)

I would like to have the light go off again when the actor moves to a position greater than 170 or back less than 160.

I currently does work when the actor "hits" x = 160

Thx

Comments

  • SharpCreationsSharpCreations Member Posts: 7
    Create a new rule
    (attribute.self.position.x is equal to or greater than 170)
    (change attribute to lights = false)
  • crapscraps Member Posts: 353
    Got the idea - thanks.
  • crapscraps Member Posts: 353
    Problem - sort of works.

    Actor who moves -
    rule-
    attribute.self.positionX = 160
    change attribute.game.lights - to - TRUE

    rule- any
    attribute.self.positonX = 170
    attribute.self.positonX = 150
    change attribute.game.lights - to - False

    Works fine for moving to the right ( light goes on at 160 off at 170) but does not go off again when moving to the left and hit 150. It stays on. But then at 170 it does go back off again when moving to the right.

    Is this the best way to interpolate and image alpha 0/1 according to an actors position? I would like to do something like this multiple times across a screen.

    Ideas?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    try this

    make one rule and have when self positions x is > or equal to 151
    and when attribute self position x is < or equal to 169

    change attribute game lights to true

    then in the otherwise sectoin of the rule have a change attribute behavior change game.lights to false
  • crapscraps Member Posts: 353
    Thanks it works - very simple and effective.
    Is it an interpolate thing - if the actor moves too fast through these points it seems there is not enough time to turn the attribute false?
Sign In or Register to comment.