assignment3/a3.cpp
void ClampVelocity(Ship *s) {
	if (s->vx > g_max_velocity) s->vx = g_max_velocity;
	if (s->vy > g_max_velocity) s->vy = g_max_velocity;
			
	if (s->vx < -g_max_velocity) s->vx = -g_max_velocity;
	if (s->vy < -g_max_velocity) s->vy = -g_max_velocity;
}
// This function just makes sure that a ship can't go faster than g_max_velocity.
// Sometimes they just disappear if we don't do this.
This function just makes sure that a ship can't go faster than g_max_velocity.
Sometimes they just disappear if we don't do this.
This function just makes sure that a ship can ' t go faster than g_max_velocity . Sometimes they just disappear if we don ' t do this .
void ClampVelocity(Ship *s) {
	if (s->vx > g_max_velocity) s->vx = g_max_velocity;
	if (s->vy > g_max_velocity) s->vy = g_max_velocity;
	if (s->vx < -g_max_velocity) s->vx = -g_max_velocity;
	if (s->vy < -g_max_velocity) s->vy = -g_max_velocity;
}
void ClampVelocity ( Ship * s ) { if ( s -> vx > g_max_velocity ) s -> vx = g_max_velocity ; if ( s -> vy > g_max_velocity ) s -> vy = g_max_velocity ; if ( s -> vx < - g_max_velocity ) s -> vx = - g_max_velocity ; if ( s -> vy < - g_max_velocity ) s -> vy = - g_max_velocity ; }
This function just makes sure that a ship can't go faster than g_max_velocity.
This function just makes sure that a ship can ' t go faster than g_max_velocity .