follow the bouncing balls...
harrio
Member Posts: 234
what's cookin,
hey fellow chefs, here is a template solution to the illusive 'bouncing balls on flat planes' problem. once again, the headchefs have come through.
http://gamesalad.com/game/play/35891
i know this was addressed in several different threads but never sufficiently solved. hope this helps everyone out.
noodles...
hey fellow chefs, here is a template solution to the illusive 'bouncing balls on flat planes' problem. once again, the headchefs have come through.
http://gamesalad.com/game/play/35891
i know this was addressed in several different threads but never sufficiently solved. hope this helps everyone out.
noodles...
Comments
it's an easy add tshirt. just add a collide behavior for the 'ball' actor. done.
i made the demo this way so that people could watch the balls over time and see that they don't get stuck horizontally or vertically like all the other ball demos do eventually.
noodles...
my bad, that's what i meant. i already tested it myself with 'ball collision' also and they maintain speed throughout. but i didn't tell you that, i just assumed it in my head and told you...'sure, just add the behavior...' when i should have said, 'i've already tested that. it works fine. so just add the behavior and your g2g.'
my apologies,
noodles...
hey tshirtbooth. my bad once again. i ran the demo again and it does slow down with 'ball collision' added in.
but i fixed that by using the code from the 'infinite bouncing balls w/constant speed' template demo. so it runs as desired for you now.
http://gamesalad.com/game/play/36030
my apologies for not checking it out thoroughly the first time. i've left both demos up so people can get exactly what they want.
noodles...
I was going to add that to my Magnitude demo, but I couldn't figure it out.
Great!
I'll add that in to my Magnitude demo when I get the chance.
there was also a subtle problem of ball actors which when set to collide with perpendicular walls would eventually settle into a fixed pattern either horizontally back in forth or vertically up and down.
so instead of relying on the 'physics' collision i aimed to fake the 'angle of reflection' at the point of collision. i apologize for the math-fanity to qsheep...lol. my equations got me almost there but i was getting some of the quadrant math wrong. namely when to be a positive or negative value. that's when math-deity jonathan samn swooped in and simplified my math to the point of making me feel stupid...again.
he just inverted the value of Motion.linearVelocity(x/y) at the point of collision depending on the wall type - horizontal/vertical and voila'...instant fake angle of reflection.
i'm glad it can help people. wish me luck in scrambling to get my game submitted to 'macworld' in time.
noodles...