{
reader.get("x", start_position.x);
sprite->set_action("falling");
- physic.enable_gravity(false);
+ physic.gravity_enabled = false;
}
void
void
Kugelblitz::activate()
{
- physic.set_velocity_y(300);
- physic.set_velocity_x(-20); //fall a little to the left
+ physic.vy = 300;
+ physic.vx = -20; //fall a little to the left
direction = 1;
dying = false;
}
groundhit_pos_set = true;
}
sprite->set_action("flying");
- physic.set_velocity_y(0);
+ physic.vy = 0;
//Set random initial speed and direction
direction = systemRandom.rand(2)? 1: -1;
int speed = (BASE_SPEED + (systemRandom.rand(RAND_SPEED))) * direction;
- physic.set_velocity_x(speed);
+ physic.vx = speed;
movement_timer.start(MOVETIME);
lifetime.start(LIFETIME);
} else if(hit.top) { // bumped on roof
- physic.set_velocity_y(0);
+ physic.vy = 0;
}
return CONTINUE;
if (movement_timer.check()) {
if (direction == 1) direction = -1; else direction = 1;
int speed = (BASE_SPEED + (systemRandom.rand(RAND_SPEED))) * direction;
- physic.set_velocity_x(speed);
+ physic.vx = speed;
movement_timer.start(MOVETIME);
}
}