Rotating an actor with another actor.
When i touch and use rotate to position on actor one i want actor two to start rotating aswell but 60 times slower.
The best i did was making it rotate in a 60 degree angle. I did this some time back and i cant remmber how to rotate it at all now.
Does anyone have any idea how i get on going with this? I would guess i have to work with either self.angle or self.angularvelocity but i have no clue how.
I guess i can save self.angle to an actor and then ask actor two to rotate to that angle. save self.angular.velocity to another one rotate to angle with speed angular velocity. I just have no clue on how to do this. Can anyone give me some help with this?
The best i did was making it rotate in a 60 degree angle. I did this some time back and i cant remmber how to rotate it at all now.
Does anyone have any idea how i get on going with this? I would guess i have to work with either self.angle or self.angularvelocity but i have no clue how.
I guess i can save self.angle to an actor and then ask actor two to rotate to that angle. save self.angular.velocity to another one rotate to angle with speed angular velocity. I just have no clue on how to do this. Can anyone give me some help with this?
Comments
gameAttribute: doRotation … boolean
actor1
attribute: mySpeed … index type… set to what you want
Rule: when
event or attribute that triggers the rotation
-changeAttribute: game.doRotation To: true
Rule: when
Attribute: game.doRotation is true
-changeAttribute: game.RotationSpeed To: mySpeed
-Rotate behavior … Speed: self.mySpeed
actor2
Rule: when
Attribute: game.doRotation is true
-Rotate behavior Speed: expression: game.RotationSpeed*0.6
Create attribute mySpeed tryed index and integer same !@#$% realy.
Create attribute rotate boolean
Touch pressed (
rotate to touch x and y.
Change attribute rotate boolean - true
Constrain attribute mySpeed
)
Touch released
Change attribute rotate bolean - false.
actor two
Attribute boolean true (
Behavior rotate clockwise - speed = mySpeed
)
Tryed both constrain and change mySpeed at one point it moved every time i stopped actor one and accelrated it again.
as you know the speed … only need:
1 gameAttribute: boolean type … rotate?
actor1
Rule: when
Event: touch is pressed
-changeAttribute: game.rotate? To: true
-Rotate To Angle … Direction: game.Touches.Touch 1.X , game.Touches.Touch 1.Y
… Relative to: actor
… Speed: 100 √Run to completion √Stops on destination
actor2
Rule: when
Attribute: game.rotate? is true
-Rotate To Angle … Direction: game.Touches.Touch 1.X , game.Touches.Touch 1.Y
… Relative to: actor
… Speed: 60 √Run to completion √Stops on destination
-changeAttribute: game.rotate? To: false
this work fine for me …
When i touch and rotate the large pointer i want the smaller one to follow.
But alot slower as statet. When i rotate clockwise it should follow clockwise but only untill i rotate counterclockwise. Can this actually be done with Gamesalad or am i trying to do something undoable?
… and you want clockHands that may or may not be operated by gears
which hand is the player moving? minuteHand?
as far as I remember:
when one changed the time on a clock …
the minuteHand moved … the hourHand moved in reference to the minuteHand
and the secondHand just kept ticking at its regular beat
(one could change the minuteHand which caused the hourHand to follow
but, secondHand could not be changed from its patterned behavior)
I would use the systemClock.Seconds to have the secondHand just ticking away
(OSTimeDemo.gameproj … template in previous versions of GS
if you are use 0.10 but still have an older version
… Show Package Contents … Resources … Templates)