Alpha Devlog 4:
Ok so I managed to do what is shown in the video ig, it was quite easy tbh.
Have some code:
if distance_to_finish < 1. {
linvel = Vec2::ZERO;
} else if distance_to_finish <= current_speed as f64 * 42. {
vel.brake(acceleration, &time);
} else {
vel.add_from_endpoint(pos, *endpoint, max_vel, acceleration, &time);
}
Here’s what I did ealier (I was sooo tired, okay? dont even ask about it
):
if distance_to_finish < 1. {
vel.linvel = Vec2::ZERO;
} else if target_speed == max_vel {
vel.add_from_endpoint(pos, *endpoint, max_vel, acceleration, &time);
} else {
vel.brake(acceleration, &time);
}
Stay hydrated (and don’t hate on me) ![]()
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.