Click on the picture!
The game actually was pretty interesting to develop the easy part was creating the level and getting the character controller working.
Instead of using the built in character controller I built my own. I needed the player to be able to be pushed around, go up elevators, and interact on almost every level. This would increase the realism.
I had to use a dynamic object and velocity instead of forces. Forces causes weird issues of forcing it's way through solid objects.
This one was pretty easy. I just used the physics sphere that was built in. The tricky part was getting the correct mass of the ball, bounciness right, and forces for each type of kick.
Kicking the ball I had to use some simple trig:
Add Physics Force cos(Angle Y) * Kick_Power, 0, sin(Angle Y) * Kick_Power
By using the Y Angle of the object it will go in the direction the object is facing. I know it technically isn't "physically" kicking the ball but its good enough for a mini game.
Getting those values correct was a lot of trial and error as these things affect the ball:
All those have to be balanced for it to feel correct.
It was pretty fun to build I have to admit and fun to play when it was done.
A good starting point!
Resources
Quick Links
Hello World: Repository
Dark Basic Pro ProjectSoccer Game: Repository
Dark Basic Pro ProjectDark Basic Pro: Repository
DBP Source CodeBall Capture
Dark Basic Pro BlogDodge Ball Game
Dark Basic Pro BlogSoccer Game
Dark Basic Pro BlogBasket Ball Game
Dark Basic Pro BlogBumper Balls
Dark Basic Pro Blog