How to make the actor rotate from corner

justpro5justpro5 Member Posts: 49
edited November -1 in Working with GS (Mac)
Hi mates
Please what is the way for the actor to be rotated from the corner rather than use transparent?

Comments

  • justpro5justpro5 Member Posts: 49
    hi tshirtbooth
    Thanks for your reply
    I really found that UtopianGame did it in his game bumps.
    I hope that he tells us how he did it.
  • calvin9403calvin9403 Member Posts: 3,186
    rotate form corner? what do you mean?

    ______________________________________________
    http://www.gamesaladforum.com/
  • calvin9403calvin9403 Member Posts: 3,186
    he can try animate
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I assume that someone with better math skills than me could use trig to do what you are trying to do. You could use sin and cos to make an actor rotate around the bottom edge center pretty easily. Not sure about bottom corner, though.
  • hdeandahdeanda Member, PRO Posts: 55
    Try this quick dirty example:

    Add to landscape scene:

    white square actor size width 75, height 75

    rotate manually to 45 degrees

    Add behavior Constrain Attribute

    constrain attribute: self.Position.X To: 40*cos(self.Time*180%360)+240

    Add behavior Constrain Atrribute

    constrain attribute: self.Position.Y To: 40*sin(self.Time*180%360)+160

    Add Rotate Behavior

    direction: Counter Clockwise
    speed: 180

    The 240 and 160 in the above constrains are the (x,y) center of rotation and can be moved with everything still rotating at the "corner".

    Refer also to "How do I make an actor move in a perfect circle?" in GameSalad's How To section for more on the variables.
  • justpro5justpro5 Member Posts: 49
    Thanks all for sharing ,
    Hdeanda I tried your example ,but it still rotate from the middle.Please can you do it and send attachment?
  • justpro5justpro5 Member Posts: 49
    tshirtbooth
    please check the UtopianGame "bumps" . I bought the game for checking this . It works .
    tshirtbooth if I use transparent will the actor hit the ball also if the ball collide with the transparent side or not . If yes this is not happened with the UtopianGame bumps.
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Here's what I think you'll have to do:

    1. Make your actor rotate normally from center.

    2. Make your actor move in a circle (http://gamesalad.com/wiki/how_tos:gsc_circular_movement) with a radius of 1/2 the actor's diagonal length (use pythagorean's theorm) and make it move at the same speed it's rotating at (you'll have to tweak it)

    I'll try making a demo.

    Asymptoteell
  • hdeandahdeanda Member, PRO Posts: 55
    Asymptoteell said:
    Here's what I think you'll have to do:

    1. Make your actor rotate normally from center.

    2. Make your actor move in a circle (http://gamesalad.com/wiki/how_tos:gsc_circular_movement) with a radius of 1/2 the actor's diagonal length (use pythagorean's theorm) and make it move at the same speed it's rotating at (you'll have to tweak it)

    I'll try making a demo.

    Asymptoteell

    exactly ;) The square will "orbit" a point that is the same distance from it's center to a corner while rotating at the same speed of its orbit.
  • AsymptoteellAsymptoteell Member Posts: 1,362
    I got a working one. You can suit it to your needs by changing the rotational speed (what it's constrained to) Also, the last number in the constraints for positions X and Y should be the positions X and Y of the corner.
    http://gamesalad.com/ontheappstore/22704
    Hope it helps.

    Asymptoteell
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Asymptoteell said:
    I got a working one. You can suit it to your needs by changing the rotational speed (what it's constrained to) Also, the last number in the constraints for positions X and Y should be the positions X and Y of the corner.
    http://gamesalad.com/ontheappstore/22704
    Hope it helps.

    Asymptoteell

    Very nice.

    yet another bit of proof anything can be done with math. Man I wish I didn't sleep/skip trig both times I took it in High School.

    Great work Asymptoteell
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Thanks, tendrmer. Is there a reason it isn't working on my computer online? Do I need to update the web thing?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I think the whole web thing is down I have noticed it on anything I have tried over the last week. it was actually down before the update.

    I got your demo by searching the name in GameSalads Dashboard.
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Thanks, tendrmer. Just wanted to make sure it wasn't my problem.
  • justpro5justpro5 Member Posts: 49
    Asymptoteell said:
    I got a working one. You can suit it to your needs by changing the rotational speed (what it's constrained to) Also, the last number in the constraints for positions X and Y should be the positions X and Y of the corner.
    http://gamesalad.com/ontheappstore/22704
    Hope it helps.

    Asymptoteell

    How to download your demo please?
  • AsymptoteellAsymptoteell Member Posts: 1,362
    I havent downloaded anything since they updated the website. Anyone know?
  • calvin9403calvin9403 Member Posts: 3,186
    just search it when you open GS
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Oh yeah. I forgot you can do that now.
  • justpro5justpro5 Member Posts: 49
    Asymptoteell

    Great Gob ... Thanks really very much.

    calvin9403
    thanks for clarification
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Happy to help. If you need anything else, just ask.
Sign In or Register to comment.