Rotating and Images!
ExplosiveGamer
Member Posts: 33
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
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?
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@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
Glad it worked for you!
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page