Rotating an actor with another actor.

mighty_poohmighty_pooh Member Posts: 20
edited August 2012 in Working with GS (Mac)
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?

Comments

  • MotherHooseMotherHoose Member Posts: 2,456
    gameAttribute: rotationSpeed … index type
    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

    image MH
  • mighty_poohmighty_pooh Member Posts: 20
    Thank you so much MotherHoose ill try this one out when i get home from work tonight.
  • mighty_poohmighty_pooh Member Posts: 20
    Does'nt seem to work. What i did was the following:

    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.
  • MotherHooseMotherHoose Member Posts: 2,456
    edited August 2012
    may be the rotate boolean is being made false before actor2 can rotate?

    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 …

    image MH
  • mighty_poohmighty_pooh Member Posts: 20
    Doesnt seem to get the job done. Let me clarify a bit, im making a watch.
    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?
  • MotherHooseMotherHoose Member Posts: 2,456
    aha … I am giving you gears
    … 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)

    image MH
  • mighty_poohmighty_pooh Member Posts: 20
    No what i want is what you are doing i think. Just with some functions i dont have the imagination to find. But yes some kind of gear system is there a function for "gears".
Sign In or Register to comment.