Rotating and Images!

ExplosiveGamerExplosiveGamer Member Posts: 33
edited June 2014 in Working with GS (Mac)

Alright so I got fishes in my game and they rotate towards an actor. When they go right it's fine but when they go left they are upside down going left. I would like to have the actor flip horizontally when it decides to go left, so its facing upright when going left. Would it also be able to squeeze in quick animation to show the fish turning?
Here is the rule i am using so my fishes rotate towards actor. keep in mind i am broad casting the actors position through game attributes.

Rule
Rotate
Set: self.rotation to: vectortoangle(game.actorX - self.positionX, game.actorY - self.positionY)

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Not sure if this will help in your specific instance but are you aware that you can use a Change Attribute and then flip an actor Vertically or Horizontally by accessing their Graphics Attributes in the Attributes Browser?

  • ExplosiveGamerExplosiveGamer Member Posts: 33
    edited June 2014

    @jamie_c LOL, I cant believe i forgot about that!! Thanks man, I got it now! For anyone else that needs something similar.
    Add this rule to the actor that needs to be flipped.

    Rule
    if ALL
    Self.Rotation (>) ___ the degree of where you want to flip
    Self.Rotation (<) ___ the degree of where you want to flip back to normal

    Do
    change attribute
    self.HorizontalFlip(or self.verticalflip) to true

    else
    Change attribute
    self.HorizontalFlip(or self.verticalflip) to false

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Glad it worked for you!

Sign In or Register to comment.