Balls in a box.

MattVolletMattVollet Member Posts: 86
edited November -1 in Working with GS (Mac)
Hey all! I'm having a small problem with my new title. I am trying to have a few balls bounce around in a fricitonless box. All starts out okay, but over the course of about 60 seconds all of the bouncing balls even out to either bouncing on a strict X or Y axis.
I can't figure out why this is happening.. Any ideas?

Comments

  • design219design219 Member Posts: 2,273
    Are they sticking to the sides of the box, or just anywhere? I've seen this happen where they get stuck on a side wall and a small, invisible collision graphic in the corners can fix that when it happens.

    Also, would it affect your gameplay if you put a slight random movement every 60 seconds?

    _______________

    Nesen Probe http://itunes.apple.com/us/app/nesen-probe/id377766693?mt=8
    Tickle Stones http://itunes.apple.com/us/app/tickle-stones/id363484260?mt=8
    Food Fight! (free) http://itunes.apple.com/us/app/food-fight/id352646643?mt=8
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    best forum topic ever!

    I hate when they stick!

    :)
  • MattVolletMattVollet Member Posts: 86
    Nope, not always to the sides... It is at anywhere within the box, but they always end up going straight vertical or horizontal. So baffling. It would have a negative affect on the gameplay, unfortunately, to do that.
  • design219design219 Member Posts: 2,273
    Do you have the collision shapes set for circle, or rectangle? It shouldn't matter, but you might try changing to the other and see if it makes any difference.
  • ColorplayGamesColorplayGames PRO Posts: 69
    Matt - weirdly enough I have been having a very similar problem. I've been working on a pong/air-hockey-ish game and the puck for some reason always somehow ended up bouncing straight up and down. This is wild speculation on my part but I think this might be some sort of weird bug inherent to the physics system. Unfortunately I don't really have any useful suggestions beyond modifying your design and/or modifying the behavior of the balls.

    (If it's useful, I ended up creating a behavior in my game something like this: if X velocity of Puck is <500 and >0, change velocity of puck to 500. if velocity of puck is >-500 and <0, change velocity of puck to -500. So whenever it's moving too slowly in either direction I bump it back up.)
  • MattVolletMattVollet Member Posts: 86
    design: I've had them set to both, I had a huge "ah-ha!!!" moment when I switched it from rectangle to circle, but to no avail (what a let down).

    Colorplay:

    Thanks a lot. My balls are moving much slower than that, and are at a constant speed of either 150 or 200. Kind of a pain that this happens! Oh well, at least I know I'm not just going insane. Thanks for the info. Back to the drawing board.
  • iPhoneDevForMeiPhoneDevForMe Member Posts: 362
    How are your behaviors set up, if I may ask?

    Here is a demo I set up awhile back to show how to change velocity. The demo is literally "Balls in a box" haha! Let me know if this is what you are looking to do and if it works.

    http://gamesalad.com/game/play/59476

    I have not tested this yet to see if I have problems after 60 sec, so ill do that when I get home, but until then maybe you can check it out!

    Hope it helps!

    -Kyle
  • ChaserChaser Member Posts: 1,453
    Try placing a few circle collision objects against the walls of the box to get them moving off axis again
    Set them to non moveable and clear
  • A3MGA3MG Member Posts: 152
    I came across this in our game Space Bump where the ball would get stuck bouncing between two parallel objects. We fixed it by not having any parallel bumper objects.

    I like the few circle collision objects but you might also be able to add some rules to the ball that do a random change velocity (on the collide) but only do a very small change like 3 - 10 degrees or something. Then, it wouldn't get stuck bouncing.

    I have not worked it all out, just thinking of ideas.
Sign In or Register to comment.