I am really stumped on this rotation
JN38
Member Posts: 57
I have an actor that rotates as it moves through the scene. No problem with this the actor moves just like I need it to.
What I want to happen is that when the actor reaches a certain position either 10deg or 249deg the image changes.
Right now I have the actor smiling - when the actor begins to rotate the image changes to an image of the actor being scared.
I have 3 attributes
actor-x 0 real
actor-y 0 real
actor-r 0 angle
In rules for the actor I have a group for position
Change attribute-
Change Attribute: self.actor-x To:self.Position.X
Change Attribute: self.actor-y To:self.Position.Y
Change Attribute: self.actor-R To:self.Rotation
This is set so when the scene starts the actor reacts to the scene gravity, set at 500, and begins to "roll" and collide with other actors. I just want the smiley face to turn into a scared face when the actor begins to roll then turn into a smile when it wins, cries when it loses.
I searched google, searched the forum, went through the cookbook and found lots of rotation stuff dealing with control issues. Lots of constraining an actors rotation in relation to another actor. Nothing on having an image change when an actor reaches a certain angle.
Any ideas?
What I want to happen is that when the actor reaches a certain position either 10deg or 249deg the image changes.
Right now I have the actor smiling - when the actor begins to rotate the image changes to an image of the actor being scared.
I have 3 attributes
actor-x 0 real
actor-y 0 real
actor-r 0 angle
In rules for the actor I have a group for position
Change attribute-
Change Attribute: self.actor-x To:self.Position.X
Change Attribute: self.actor-y To:self.Position.Y
Change Attribute: self.actor-R To:self.Rotation
This is set so when the scene starts the actor reacts to the scene gravity, set at 500, and begins to "roll" and collide with other actors. I just want the smiley face to turn into a scared face when the actor begins to roll then turn into a smile when it wins, cries when it loses.
I searched google, searched the forum, went through the cookbook and found lots of rotation stuff dealing with control issues. Lots of constraining an actors rotation in relation to another actor. Nothing on having an image change when an actor reaches a certain angle.
Any ideas?
Comments
have rules that states
when actor is rotating change scared boolean to true
so when scared = true change actor's self image to scared.png
then similarly you have to setup the win and lose conditions so they trigger accordingly. Not sure what your game is about so basically this is the kind of conditions you can use.
I'll have to get to it a bit later, it's 2:13am here and I don't want to mess up my app because I'm too tired to concentrate. Did that with another app and corrupted the file somehow.
The game itself is kind of a side bowler, knock over the blocks. Knock everything down and hit the back wall you win. Don't hit the back wall you lose.
Real basic.
if all blocks are knocked down = true & actor collides with back wall
change boolean win = true
and of course the opp will be for lose conditions.