Rob223
04-21-2007, 01:27 PM
I've attempted to create a ball gravity engine in TGF. It's a simple one, and It took me about half an hour, so don't expect any miracles. In fact, I would go on to say that it's terrible compared to modern physics, but hey, it's a start for me, i've never tried making a physics engine b
Here's some basic info about how the engine works.
The ball increases it's speed if it's facing downwards.
It decreases it's speed if it's facing upwards.
If it is facing upwards and to the right, it adds 1 to the direction value until it is facing (therefore going) downwards
If it is facing upwards to the left, it minuses 1 from the direction value until it is facing downwards.
It "bounces" off the walls and floor by taking or adding a different amount to it's direction value depending on which direction it is facing.
If the ball is facing directly upwards, it will randomly go slightly left or right to start off the gravity.
If the mouse is held, the ball will ignore all of these and head towards the pointer until the pointer is released.
I don't have friction yet, which produces some strange effects when you skim the ball along the ground (it speeds up >_<)
As I've said, it's simple, its not very realistic, but I'm hoping to improve it greatly in the future and possibly use it in one of my games.
Download Link (http://www.mooload.com/new/file.php?file=files/210407/1177161982/ballgravity.zip)
(scroll down to get to the download)
Can anyone help me with this? Does anyone want to help with this? Why is my cheese-bread not finished?
Here's some basic info about how the engine works.
The ball increases it's speed if it's facing downwards.
It decreases it's speed if it's facing upwards.
If it is facing upwards and to the right, it adds 1 to the direction value until it is facing (therefore going) downwards
If it is facing upwards to the left, it minuses 1 from the direction value until it is facing downwards.
It "bounces" off the walls and floor by taking or adding a different amount to it's direction value depending on which direction it is facing.
If the ball is facing directly upwards, it will randomly go slightly left or right to start off the gravity.
If the mouse is held, the ball will ignore all of these and head towards the pointer until the pointer is released.
I don't have friction yet, which produces some strange effects when you skim the ball along the ground (it speeds up >_<)
As I've said, it's simple, its not very realistic, but I'm hoping to improve it greatly in the future and possibly use it in one of my games.
Download Link (http://www.mooload.com/new/file.php?file=files/210407/1177161982/ballgravity.zip)
(scroll down to get to the download)
Can anyone help me with this? Does anyone want to help with this? Why is my cheese-bread not finished?