Radial Gravity

How to do in gamesalad?

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    Use the Move To or Interpolate behaviours.
  • KevinFlynnKevinFlynn Member Posts: 26
    Can give example?
  • SocksSocks London, UK.Member Posts: 12,822
    Yeah, throw a bunch of objects into a scene - on each have a 'move to' behaviour that moves them to the same X & Y coordinates.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    Use 'Accelerate Toward'

    Example:

    Collide: Bounce when colliding with actor of type [Planet]

    Rule: When Actor overlaps or collides with actor of type [Planet]
    -- (nothing goes here)
    otherwise
    -- Accelerate Toward
    ---- >scene.Background.Planet.Position.X
    ---- ^scene.Background.Planet.Position.Y
    ---- Relative to: scene
    ---- Acceleration: 200
  • KevinFlynnKevinFlynn Member Posts: 26
    If i want to do it on a planet that has radial gravity on my actors, how to implement on planet?
  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2013
    Use 'Accelerate Toward'
    @KevinFlynn
    @RThurman

    Yep, Accelerate Toward is much better as it's persistent - Move To / Interpolate behaviours both lose their way after colliding with the planet surface so ignore my suggestions !

    Demo attached in post below:
  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2013
    //

    Radial gravity demo:
  • KevinFlynnKevinFlynn Member Posts: 26
    edited March 2013
    Thanks a bunch.
  • DenimSharkDenimShark Member Posts: 192
    edited March 2013
    Ya use accelerate toward to the planet's coordinates. In Gravity Assist I also changed the accelerate magnitude to g/r^2 to simulate more realistic motion (like orbiting) where g is a some constant (obtain through testing) and r is the distance between the actor and the planet.
  • SocksSocks London, UK.Member Posts: 12,822
    Ya use accelerate toward to the planet's coordinates. In Gravity Assist I also changed the accelerate magnitude to g/r^2 to simulate more realistic motion (like orbiting) where g is a some constant (obtain through testing) and r is the distance between the actor and the planet.
    Great tip. :)
  • OskarDeveloperOskarDeveloper Member Posts: 533
    edited March 2013
    Really cool, thanks! @Socks and @DenimShark!
    but i can't get it to look nice.. I want them to stop "wobbling" after a while, and also i wonder why gs is making the actors float one pixel over the ground some times?
  • SocksSocks London, UK.Member Posts: 12,822
    Really cool, thanks! @Socks and @DenimShark!
    but i can't get it to look nice.. I want them to stop "wobbling" after a while, and also i wonder why gs is making the actors float one pixel over the ground some times?
    Looks nice :)

    I suspect the 1 pixel gap is a combination of GS's lack of AA and a less than perfectly flat angle.

    For the wobbling you will probably have to play around with angular drag / friction / density (etc).
  • OskarDeveloperOskarDeveloper Member Posts: 533
    @Socks
    Hahhaha gs is so much fun :D
    cant seem to get rid of the wobbling tough.. working on it



  • OskarDeveloperOskarDeveloper Member Posts: 533
    victory is mine! angular drag was the problem :)
  • DenimSharkDenimShark Member Posts: 192
    Ye also make sure you're previewing at 100% zoom. This might be why you experience the apparent 1 pixel gap. Game looking good though
Sign In or Register to comment.