GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

gravity help

jhaasjhaas Posts: 233Member
edited November -1 in Working with GS (Mac)
I'm working with gravity for the first time and need a little help. :)

When I set gravity above zero all movable actors slide off the screen as soon as I hit the preview. I need some actors to be able to move but how to I keep them from falling off the screen?

Setting movable to no keeps them in place, but it also prevents them from being able to move. I looked at the example games that use gravity and I'm missing something. ???

Comments

  • jhaasjhaas Posts: 233Member
    Never mind, I found the constrain attribute code that will counter act gravity.

    Sorry for the post - go back to your lives citizens. :)
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    Just note that when you use constrain to keep the actor in the Y position to make it seem like it is ignoring gravity, it is just redrawing your image every frame in that position. If you show the Y linear velocity, it is still increasing. So you may need to give it an acceleration opposite of gravity to fix that too.
This discussion has been closed.