396 |
} |
} |
397 |
contact.is_collision = contact.normal*ai.vel < 0; |
contact.is_collision = contact.normal*ai.vel < 0; |
398 |
contact.response = contact.stone->collision_response(contact); |
contact.response = contact.stone->collision_response(contact); |
399 |
|
contact.sound = contact.stone->collision_sound(); |
400 |
} |
} |
401 |
|
|
402 |
/* In Enigma, stones have rounded corners; this leads to realistic |
/* In Enigma, stones have rounded corners; this leads to realistic |
478 |
// The stone may kill itself during a call to actor_hit(), so |
// The stone may kill itself during a call to actor_hit(), so |
479 |
// extract all relevant data before invoking this method! |
// extract all relevant data before invoking this method! |
480 |
// GridPos stone_pos = sc.stone->get_pos(); |
// GridPos stone_pos = sc.stone->get_pos(); |
|
string collision_sound = sc.stone->collision_sound(); |
|
481 |
sc.stone->actor_hit(sc); |
sc.stone->actor_hit(sc); |
482 |
if (!sc.fake_collision && sc.response != STONE_PASS) { |
if (!sc.fake_collision && sc.response != STONE_PASS) { |
483 |
normal += sc.normal; |
normal += sc.normal; |
486 |
if (length(ai->vel) > 0.1) |
if (length(ai->vel) > 0.1) |
487 |
{ |
{ |
488 |
AddSprite(display::SPRITE_EFFECT, sc.contact_point, "ring-anim"); |
AddSprite(display::SPRITE_EFFECT, sc.contact_point, "ring-anim"); |
489 |
sound::PlaySound(collision_sound.c_str()); |
sound::PlaySound(sc.sound.c_str()); //collision_sound.c_str()); |
490 |
} |
} |
491 |
} |
} |
492 |
} |
} |