Making an actor follow a circular or parabolic path with a fixed starting and end point

CoolgamerCoolgamer Member Posts: 16
edited January 2012 in Working with GS (Mac)
Hello Everyone,

Can I make an actor follow a semi-circular or parabolic path, with a fixed starting, end point and also have the capability to change it's velocity while traveling based on if touch is pressed or not. I am trying to do it but unsuccessful so far.

Would really appreciate your help.

Thanks,
Andy

Comments

  • POMPOM Member Posts: 2,599
    @Coolgamer

    I made this quick demo for you , it should help you get started , every aspect of the movement is editable by the attributes .
    http://www.mediafire.com/?pdzcrby4fynbevq

    Cheers

    Roy.
  • CoolgamerCoolgamer Member Posts: 16
    Thanks a lot Roy... U rock bro..

    Cheers,
    Andy
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    @P-O-M .... WOW! That demo is great. You nailed all five criteria that were packed into the original question. And you did it with easy to understand attribute names and with very easy to grasp equations.

    Thanks for sharing this!
    RThurman
  • ozboybrianozboybrian PRO Posts: 2,102
    Like a Boss!
  • CloudsClouds Member Posts: 1,599
    edited January 2012
    P-O-M 's arc was more of an arch than an actual semicircle (but that might be what you want ?) . . . . anyhow here's a perfect semicircle too, there are only two constraints and no attributes - the maths is easy to pick apart/modify.

    http://www.mediafire.com/?48nrzv21cbjvc8j
  • CloudsClouds Member Posts: 1,599
    Some curves using just interpolate between coordinates, not a sin or cos in sight ! (but a mostly useless method ! lol)

    http://www.mediafire.com/?adhssbstywcncuy

    8-X

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited January 2012
    @Tynan said:
    P-O-M 's arc was more of an arch than an actual semicircle (but that might be what you want ?)
    I thought that P-O-M planned it that way. When I read the original question, I thought that's a lot of criteria! Coolgamer requested an actor that could:

    1) travel in a semicircular path,
    2) or a parabolic path,
    3) have a fixed starting point,
    4) have a fixed ending point,
    5) and change speed.

    I thought to myself "I'm not touching that one! It will take at least there separate iterations for each criteria before this request will be satisfied (and probably many more)." Maybe I took the original question too literally.

    The way P-O-M set things up really makes it easy for users to experiment with the different parameters until they get just the form and speed they are looking for. That's what I was gushing at! (And I guess I still am.)

    RThurman
  • POMPOM Member Posts: 2,599
    edited January 2012
    I thought that P-O-M planned it that way
    Yep , tried to keep it simple , and to give the people who don't know the math an explanation on what every aspect of the equation does..

    Cheers
    Roy.
  • CoolgamerCoolgamer Member Posts: 16
    Guys,

    Thanks everyone for your replies. I really appreciate everyone's input to the answer.
    I used POM's solution and found it a well fit to my problem here, as I sometimes need parabolic paths too.

    Question: All the criterias are being covered by the solution except the last one (Change speed dynamically during flight).
    I am using my own real variable instead of self.Time (under constrain attribute)for predefining the parabolic path(fixed starting point), and interpolating the variable to a final value (completes the parabolic path). I was wondering if there is a way to change the interpolation duration dynamically for making the object fast or slow. I tried using a variable which changes it's value when screen is pressed or released dynamically but it did not work. The parabolic movement was becoming glitchy by changing the interpolation duration variable on the go.

    Thanks for your help.

    Andy
  • CoolgamerCoolgamer Member Posts: 16
    Hello everyone,

    I know I am somewhat bad at explaining my problem, and I did a really bad job while explaining it in the post above..
    Man, I have been struggling a lot with this problem of changing an object's speed while performing the parabolic or semicircular movement.

    Would appreciate a ton for some guidance towards how to approach it..

    Andy
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    @Coolgamer... I recall that P-O-M set the demo up with an attribute called "game.speed". All you would need to do is change game.speed to whatever it needs to be.

    RThurman
  • CoolgamerCoolgamer Member Posts: 16
    edited January 2012
    Thanks for your reply Rthurman..
    I tried doing that and changed "game.speed" while the object was in parabolic motion (based on user's touch pressed or not).. The result was that it changed the position of the object abruptly and the animation did not go smooth.. I think the reason for this happening is that game.speed is being included in the Sine & Cosine terms of constraint position X and Y, so any change in game.speed effects the position of the object..
    Can you please look into the issue or suggest an alternate solution..

    Thanks,
    Andy
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    @Coolgamer .... I see what you mean. I don't have an answer at hand. Perhaps P-0-M might.

    RThurman
  • CoolgamerCoolgamer Member Posts: 16
    No problem Rthurman.. Thanks for your concern though..
  • artefacto1971artefacto1971 Member, PRO Posts: 3
    No files in mediafire links
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @artefactor1971 That's a common problem with file-sharing links, especially after nearly two years. I recommend contacting the creators directly via private message to request the files.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

This discussion has been closed.