Okay the update isn't quite done yet, but I just released a basic update for people to play with, so I'll tell you what the latest update contains:
---
This latest update is a big one!
This isn't a full update, it's more of a sneak peek. The update is 90% complete, but there's a bit of functionality which is missing that you'll get in a day or two.
So what's in this update?
Physics!
And not just moving sprites around and inverting their velocities when they collide, but REAL physics!
Sprites now have mass, velocity, and elasticity. When you detect a collision between them, you can call a simple function DoCollision() with just the two sprites involved, and it will recalculate their velocities!
There's three different functions for applying forces to sprites, and when completed, the system will automatically account for air friction and ground friction, which can also be set per sprite! These forces can be applied as a constant force, or as an instant impulse. Also, mass can be ignored when applying a force, which is useful in many circumstances, such as when applying gravity, which pulls down different masses at equal rates.
One of the force functions for example is ApplyField() which can be used to simulate magnetism, gravity, or explosions, depending on whether or not the force is positive or negatvie, you ignore mass or not, and whether you use the impulse flag to apply all the force instantaneously. You just specify the source sprite which the force emenated from, and use ApplyField() on all the sprites you want to be affected with the same parameters and voila, instant explosive force pushing everything nearby away at great velocity. Oh, did I mention this force can falloff with the square of the distance as well?
---
This latest update is a big one!
This isn't a full update, it's more of a sneak peek. The update is 90% complete, but there's a bit of functionality which is missing that you'll get in a day or two.
So what's in this update?
Physics!
And not just moving sprites around and inverting their velocities when they collide, but REAL physics!
Sprites now have mass, velocity, and elasticity. When you detect a collision between them, you can call a simple function DoCollision() with just the two sprites involved, and it will recalculate their velocities!
There's three different functions for applying forces to sprites, and when completed, the system will automatically account for air friction and ground friction, which can also be set per sprite! These forces can be applied as a constant force, or as an instant impulse. Also, mass can be ignored when applying a force, which is useful in many circumstances, such as when applying gravity, which pulls down different masses at equal rates.
One of the force functions for example is ApplyField() which can be used to simulate magnetism, gravity, or explosions, depending on whether or not the force is positive or negatvie, you ignore mass or not, and whether you use the impulse flag to apply all the force instantaneously. You just specify the source sprite which the force emenated from, and use ApplyField() on all the sprites you want to be affected with the same parameters and voila, instant explosive force pushing everything nearby away at great velocity. Oh, did I mention this force can falloff with the square of the distance as well?