I was thinking in terms of I'm just moving at a rate of 600 units or that is my current velocity.
Even in pure Physics terms, velocity is expressed as an expression of time. e.g. meters / seconds; miles / hour; kilometers / hour.
But either way in the case I was talking about it would be all in the one frame so it would just be:
velocity -= velocity * 0.5f;
If it is just one frame, then yes; that's the correct way of doing it.
Now in the case where I hit the poodle ;)
And the poodle makes me slow down my velocity over the time I'm colliding with them by half (or over a 60 frames assuming we are stimulating 16.67ms )
Then if I am correct my equation should be:
if(player.collides(poodle))
player.velocity -= player.velocity * 0.5f * deltatime;
Yes. You would have to have a way to ensure that "if(player.collides(poodle))" returns true for 60 frames. One way to ensure that is to run a routine that schedules itself to run for 60 frames; and this routine all it does is to decrease the player's velocity.
For example:
if(player.collides(poodle))
routineSystem.runRoutine( &decreasePlayerVelocity, player, 1.0f ); //Run the routine for one second
//Define the routine.
bool decreasePlayerVelocity( player )
{
player.velocity -= player.velocity * 0.5f * deltatime;
return true; //If we return false, then the routine was cancelled prematurely.
}
Having such generic system that schedules and runs arbitrary routines for a fixed amount of time is very useful in games. RPG games are a prime example: "Heal the player over the course of 5 seconds", "Poison an enemy for 20 seconds".
Once the routine is over (i.e. player died) or the time expires, the routine is de-scheduled.
This way you don't have to worry about ensuring player.collides(poodle) is true for 60 frames.