how do I get my actor to orbit around a planet after being shot out of a cannon? like a. birds space

So, what I want to know is how to get an actor launched from a cannon to orbit around a planet. I need to get it so that it gets "caught by th e gravitational pull, but doesn't land on the planet. (kind of like it becomes a satellite) Then I need to Know how to get it to break orbit when tapped and fly in the direction that it is going in.

Thanks, guys... :)

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2014

    Sounds like you want someone to code the entire mechanic of your game ? :) At least it's not a flappy bird, tell me it's not a flappy bird. :neutral_face: :wink:

    Here are the basics.

    Shoot the actor towards the planet however you like, when within a certain range (defined by magnitude measured between the planet and the actor - or maybe just detected by a larger, but invisible actor) constrain the X and Y of the actor to the cos and sin (respectively) of either the actor's self.time or the game's game.time . . . or any other increasing value, like an interpolating attribute.

    That's the simplest way, but from then onwards you might like to refine the look of it - for example rather than the actor simply being 'grabbed' by the orbit, you might want the path of the launched actor to morph into the orbit around the planet (using interpolate) so the transition is smoother.

    Hope that helps.

    interpolate

  • AngryBoiAngryBoi Member Posts: 586

    To have the actor go towards it, have the accelerate attribute say accelerate toward the planet actor. Also, have an attribute that says when actor collides with planet, bounce.

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2014

    @gamestudent

    Here are the basics:
    (pick up the white ball and throw it towards the blue circles).

    Link: https://www.mediafire.com/?mndyjjanmiill8u

  • gamestudentgamestudent Member Posts: 504

    No, it's not a angry bird clone, so you can breathe easy @socks. Thanks you guys, I'll get right to work on it.

  • gamestudentgamestudent Member Posts: 504

    Woah! Nice Job with the link, @Socks‌! Did you make that?

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    Good thing its not an angry birds space clone. Otherwise this demo might be useful:

    http://forums.gamesalad.com/discussion/comment/389695/#Comment_389695

  • SocksSocks London, UK.Member Posts: 12,822

    @gamestudent said:
    Woah! Nice Job with the link, Socks‌! Did you make that?

    No, it was passed down from the elders of GameSalad, it is believed to have been found in an archeological dig in the late 1800s and given to the elders sometime in the late 1970s, it was then kept refrigerated until around 2009 when it was deemed safe to release onto the forums.

    tl;dr Yes, I did make it.

  • SocksSocks London, UK.Member Posts: 12,822

    @RThurman said:
    Good thing its not an angry birds space clone. Otherwise this demo might be useful:

    http://forums.gamesalad.com/discussion/comment/389695/#Comment_389695

    I always thought this was a great piece of work ! Very impressive.

Sign In or Register to comment.