- if ((on_ground()) && (fabs(physic.vx) < WALK_SPEED)) {
- physic.vx = 0;
- physic.ax = 0;
- } else if(physic.vx < 0) {
- physic.ax = WALK_ACCELERATION_X * 1.5;
+ if ((on_ground()) && (fabs(physic.get_velocity_x()) < WALK_SPEED)) {
+ physic.set_velocity_x(0);
+ physic.set_acceleration_x(0);
+ } else if(physic.get_velocity_x() < 0) {
+ physic.set_acceleration_x(WALK_ACCELERATION_X * 1.5);