How to make gravity that works if you move too

laduester42laduester42 Member Posts: 10
edited July 2012 in Working with GS (Mac)
Hey guys,

in a new game I'm working on, it is similar to the game Red Ball. I have arrows that lead you in the direction you want with up as a jump. I have under all the arrows to push down (accelerate) to create a gravity, but when you press up and right, it makes more of a triangular jump than a smooth circular jump. Also, if I fall off a platform and still hold on to the arrows, I don't fall immediately like in Red Ball, but I slowly fall in the direction I am pressing. This gravity is stopping me from releasing the app. Without this, the game looks very amateur and that's not good. If any of you know how to make this work, that would be awesome. It seems on Youtube, no one made a video about this; just to fall.

Thanks,
LaDuester

Answers

  • NovicaStudioNovicaStudio Member Posts: 174
    Instead of using the move or accelerate behavior, have it so that when right is pressed, change attribute self.Motion.Linear Velocity.X to 300
    and for up change attribute self.Motion.Linear Velocity.Y to 300 For Left instead of 300 for the X, have -300.
  • laduester42laduester42 Member Posts: 10
    it's a little better, but still kind of has a triangular jump. as for my second problem, same thing: little better. Any suggestions?
  • laduester42laduester42 Member Posts: 10
    actually, i just tested my second problem again, and it's worse
  • WingmanappsWingmanapps Member Posts: 458
    its because you have a dual acceleration in two different directions.
    Make a true/false scenario where if.game.attribute.up is true = accelerate up
    otherwise accelerate down
  • laduester42laduester42 Member Posts: 10
    That works, but do you know how to make a circular jump when you press up and right instead of a triangular jump. If you can, that would be great.
  • GLGAMESGLGAMES SingaporeMember Posts: 988
    edited July 2012
    use the sin function?? might need to check with an expert on that. i have not use sin cos function personally.
Sign In or Register to comment.