Beginner Help :)
Schroeder
Member Posts: 6
in Help Wanted
I'm making a game where (so far) a ball bounces in between a top and bottom. I have everything made, what I'm having trouble with is getting the ball to accelerate gradually. I can make it accelerate towards either the top or bottom, but I want it to bounce off and keep accelerating the other way! Can anyone help me? I'm on Mac.
Comments
Do you have some sort of walls at the top and bottom? If your ball is set to bounce off those, it should accelerate and then keep bouncing until something changes.
You're using the accelerate and collide behaviours?
Age of Dominion RTS for iOS
Age of Dominion RTS for Android
I may not be using accelerate correctly. If I put it on, the ball speeds up exponentially, I'm trying to get something more gradual, I was thinking maybe put on a timer to increase max speed?
I'd use Gamesalad's built in physics engine. Add actors to the top and bottom area of your game, make them invisible if you don't want to see them or place them just outside the screen bounds. Then play with the bounciness settings of those two platforms and your ball until it acts like you want it too.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Here is a little sample. The ball starts moving at a random speed and angle and the built in physics engine does the rest. From here you can adjust the bounciness of the walls and ball to fine tune the effect. If you increase just the balls bounciness to 1.1, you'll see the speed will increase over time as it bounces off the walls. If that speed increase is too quick, try 1.05, etc...
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Perfect! Thanks