dying = false;
}
-HitResponse
-Kugelblitz::collision_solid(GameObject& , const CollisionHit& chit)
+void
+Kugelblitz::collision_solid(const CollisionHit& chit)
{
- return hit(chit);
+ hit(chit);
}
HitResponse
}
HitResponse
-Kugelblitz::hit(const CollisionHit& chit)
+Kugelblitz::hit(const CollisionHit& hit)
{
// hit floor?
- if(chit.normal.y < -.5) {
+ if(hit.bottom) {
if (!groundhit_pos_set)
{
pos_groundhit = get_pos();
movement_timer.start(MOVETIME);
lifetime.start(LIFETIME);
- } else if(chit.normal.y < .5) { // bumped on roof
+ } else if(hit.top) { // bumped on roof
physic.set_velocity_y(0);
}
movement_timer.start(MOVETIME);
}
}
+ /*
if (Sector::current()->solids->get_tile_at(get_pos())->getAttributes() == 16) {
//HIT WATER
Sector::current()->add_object(new Electrifier(75,1421,1.5));
//HIT ELECTRIFIED WATER
explode();
}
+ */
}
- BadGuy::active_update(elapsed_time);
+ BadGuy::active_update(elapsed_time);
}
void
{
if (!dying) {
sprite->set_action("pop");
- lifetime.start(0.2);
+ lifetime.start(0.2f);
dying = true;
}
else remove_me();