How can i create a pivot point

v00d0v00d0 Member Posts: 143
edited May 2012 in Working with GS (Mac)
i tried in several ways with sin, cos and vector to angle and all other things, but i couldn't create something that worked well.

so i wanna realize something like this

http://i48.tinypic.com/sqs4nm.gif

i saw wild runner from utopian games that have something like this. Anyone know a smooth and really functionable way to do this? Thanks a lot

Best Answers

Answers

  • v00d0v00d0 Member Posts: 143
    i'm trying the first method, (the second i think it's the same thing) .But how can i create an object that i just put in the scene and it work? with those methods i've to change manually the scenex and y everytime e i put the object inside the scene, my achivment is to program N objects and then just put them in the scenes and create levels.

    If i create another object that send it position on the scene, to 2 global variable X e Y, so the actor that have to rotate take the scenex and y from this offset actor, can it work???then i've to create N variables for N actors. :S
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    edited May 2012
    @v00d0 OK -- I think I see what you want.

    Please download the following file:
    http://www.mediafire.com/download.php?qn1f15f9stbla54

    In this version, all you need to do is pop your graphics into the prototype. Then open the prototype and specify the x and y offset of the actor's rotation point. That is done in first two behaviors.

    The x and y offsets are local to the actor. (Think of the actors center as the 0,0 point. Then find how many pixels from the center the rotation point needs to be.) For example, the prototype currently has its x offset set to 25 (which would put the rotation point to the right of center by 25 pixels). And the y offset is set to -60 (which would put the rotation point down from the center by 60 pixels) The point 25, -60 would be in the lower right secton of the actor.

    Then you can drag of the actor to any location of the screen and it will work for you.

    Hope this helps!
    RThurman
  • v00d0v00d0 Member Posts: 143
    I love you m8!
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Glad its working for you!

    Personally, I can hardly wait for joints to be implemented in GameSalad so this kind of workaround isn't needed.

    RThurman
  • v00d0v00d0 Member Posts: 143
    ye, i need joints for a lot of things. But i don't think they'll add them in the near future, so let's find other ways.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Joints are definitely doable in GameSalad as it is. In fact, the demo I posted above is how to create a 'revolute' joint (using Box2D terms). I've created many kinds of joints with the current version of GameSalad (using several different kinds of integration schemes). Its all doable!

    However, the problem is in using constraints to create the joints. In the current version of GameSalad, the use of constraints to 'join' several joints severely bogs down the system. For example, to make a simple ragdoll figure (with all the joints working correctly), the update rate drops to under 30fps. I am hoping that a future version of GameSalad will integrate box2D's joints capability directly into the engine so that it will be optimized for higher frame rates.
Sign In or Register to comment.