basic sound support and added some rocking sounds
This commit is contained in:
@@ -62,11 +62,22 @@ int Model::OnInit (int argc, char* argv[]) {
|
||||
|
||||
mPlayerName = "Player";
|
||||
|
||||
Engine::PlayMusic ("./data/sounds/intro_music.ogg");
|
||||
|
||||
Engine::RegisterListener (this, EventAccelerateStart);
|
||||
Engine::RegisterListener (this, EventAccelerateStop);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool Model::OnReceiveEvent (const Engine::EventBasePtr &event) {
|
||||
switch (event->mEventType) {
|
||||
case EventAccelerateStart:
|
||||
Engine::PlaySoundLoop("./data/sounds/thrust.wav", -1);
|
||||
break;
|
||||
case EventAccelerateStop:
|
||||
Engine::HaltSoundLoop("./data/sounds/thrust.wav");
|
||||
break;
|
||||
case EventLevelComplete:
|
||||
return OnLevelComplete();
|
||||
break;
|
||||
@@ -415,6 +426,8 @@ void Model::OnKillEntity (const Engine::EntityBase *entity) {
|
||||
GameEntityType entity_type = (GameEntityType) entity->mType;
|
||||
|
||||
if (entity_type == GameEntityTypeAsteroid) {
|
||||
Engine::PlaySound("./data/sounds/rock_destroyed.wav");
|
||||
|
||||
unsigned int i;
|
||||
const AsteroidEntity *asteroid = static_cast<const AsteroidEntity*>(entity);
|
||||
mPoints += 150 + asteroid->mSubAsteroidsCount * 75;
|
||||
|
||||
@@ -126,6 +126,8 @@ void ShipEntity::Attack () {
|
||||
rocket_physics->mOrientation = entity_physic->mOrientation;
|
||||
rocket_physics->mVelocity = attack_dir.normalize();
|
||||
rocket_physics->mVelocity *= ShipEntity::VarMaxSpeed.GetFloatValue() + 0.5;
|
||||
|
||||
Engine::PlaySound ("./data/sounds/laser.wav");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user