Bouncing Beachball inside 4 walls with other beachballs.
CaptFinn
Member Posts: 1,828
I want to randomly spawn a beachball ever 4 secs at one of 4 locations within the scene. The scene is enclosed with 4 walls.
When it spawns it and every spawned beach ball will begin traveling at 1 set speed. These balls will collide with other balls and the 4 walls. At no point during the chaos do i want the beachballs to slow or speed up in speed. I want one constant speed at all times.
Thanks to the forum i have fixed the rotation issue. I now know how to make them rotate or not. Now im at a point to where the actors want to slow down and speed up after each contact. I just need the spawned balls to stay at a constant speed of my editing and choosing.
Any advice.
Comments
My magnitude demo over at gshelper.com solves the speed issue with bouncing balls losing speed over time. Or at least it did 7 years ago when i made it. :-)
Search for firemaplegames to bring up all my old demos.
Hope it helps!
Joe
Does this also stop them from speeding up real fast?
To stop something from moving too fast you can set a max speed for each actor and activate apply max speed in the actors settings. Then the actor won't move faster than its max speed.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Ok so set actor max speed 150 and it will never go faster than 150. Is that the same as constraining linear velocity X and Y to 150?
No. Max speed allows for changes up and down of velocity as where a constrain fixes it to that value.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
K so constrain self. Velocity to 150. And it will always stay at 150? What if 2 balls hit head on? Will they bounce off in opposite directions at 150?
There is no attribute called (simply) self.velocity, you have velocity X and velocity Y, but constraining either (or both) of these to 150 won't make the overall speed 150 (unless one of the two values is also always 0).
You could try something like:
Rule:
-When ball collides with ball
--Change Velocity
--Direction vectorToAngle (velocity X, velocity Y)
--Speed 150