Take initial position.
Do anything you want to it, move it, update collisions, move it some more.
Subtract initial position from current position, and that's how fast it's moving. This will make things slide off walls, accelerate, decelerate, and can be modified to transfer energy or bounce.
Do anything you want to it, move it, update collisions, move it some more.
Subtract initial position from current position, and that's how fast it's moving. This will make things slide off walls, accelerate, decelerate, and can be modified to transfer energy or bounce.