It's been long since the last time, but real life got me away from GE.
I'm in another project and having a problem with directional velocity:
I want the player to change its speed when clicking on a button, but slowly. For instance, when is stopped, I want it to speed up gradually to 5:
- Code: Select all
if (player.directional_velocity < 5);
{
player.directional_velocity = player.directional_velocity * 1.2;
if (player.directional_velocity == 5);
{
player.directional_velocity = 5;
}
Te player actor accelerates, but instantly, from 0 to 5. Same happens form moving to halt.
I tried also using in draw actor directional_velocity = directional_velocity * Delta and the changing Delta values, but with the same results.
I'm sure I'm doing something wrong, but can't realize what... Any advice?
Thanks in advance.