Work on ball audio
This commit is contained in:
parent
47cd6c3c5e
commit
06593f221b
1
assets/sound/weapons/physcannon/energy_bounce1.sox
Normal file
1
assets/sound/weapons/physcannon/energy_bounce1.sox
Normal file
|
@ -0,0 +1 @@
|
|||
-c 1
|
1
assets/sound/weapons/physcannon/energy_disintegrate4.sox
Normal file
1
assets/sound/weapons/physcannon/energy_disintegrate4.sox
Normal file
|
@ -0,0 +1 @@
|
|||
-c 1
|
|
@ -0,0 +1 @@
|
|||
-c 1
|
1
assets/sound/weapons/physcannon/energy_sing_flyby1.sox
Normal file
1
assets/sound/weapons/physcannon/energy_sing_flyby1.sox
Normal file
|
@ -0,0 +1 @@
|
|||
-c 1
|
|
@ -25,4 +25,8 @@ unsigned short soundsPortalFizzle = SOUNDS_PORTAL_FIZZLE2;
|
|||
|
||||
unsigned short soundsElevatorDoor = SOUNDS_DOORMOVE1;
|
||||
|
||||
unsigned short soundsBallLoop = SOUNDS_ENERGY_SING_LOOP4;
|
||||
unsigned short soundsBallLoop = SOUNDS_ENERGY_SING_LOOP4;
|
||||
unsigned short soundsBallLaunch = SOUNDS_ENERGY_SING_FLYBY1;
|
||||
unsigned short soundsBallBounce = SOUNDS_ENERGY_BOUNCE1;
|
||||
unsigned short soundsBallKill = SOUNDS_ENERGY_DISINTEGRATE4;
|
||||
unsigned short soundsBallExplode = SOUNDS_ENERGY_SING_EXPLOSION2;
|
|
@ -13,5 +13,9 @@ extern unsigned short soundsPortalFizzle;
|
|||
extern unsigned short soundsElevatorDoor;
|
||||
|
||||
extern unsigned short soundsBallLoop;
|
||||
extern unsigned short soundsBallLaunch;
|
||||
extern unsigned short soundsBallBounce;
|
||||
extern unsigned short soundsBallKill;
|
||||
extern unsigned short soundsBallExplode;
|
||||
|
||||
#endif
|
|
@ -187,8 +187,9 @@ void playerHandleCollision(struct Player* player) {
|
|||
vector3ProjectPlane(&player->body.velocity, &contact->normal, &player->body.velocity);
|
||||
}
|
||||
|
||||
if (isColliderForBall(contact->shapeA) || isColliderForBall(contact->shapeB)) {
|
||||
if (((isColliderForBall(contact->shapeA) || isColliderForBall(contact->shapeB)) && !playerIsDead(player))) {
|
||||
playerKill(player, 0);
|
||||
soundPlayerPlay(soundsBallKill, 1.0f, 1.0f, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -152,6 +152,9 @@ void ballInitBurn(struct Ball* ball, struct ContactManifold* manifold) {
|
|||
burnTransform.scale = gOneVec;
|
||||
|
||||
transformToMatrixL(&burnTransform, &burn->matrix, SCENE_SCALE);
|
||||
|
||||
soundPlayerPlay(soundsBallBounce, 1.0f, 1.0f, &burnTransform.position, &gZeroVec);
|
||||
|
||||
burn->at = burnTransform.position;
|
||||
burn->normal = manifold->normal;
|
||||
}
|
||||
|
@ -183,6 +186,7 @@ void ballUpdate(struct Ball* ball) {
|
|||
collisionSceneRemoveDynamicObject(&ball->collisionObject);
|
||||
dynamicSceneRemove(ball->dynamicId);
|
||||
soundPlayerStop(ball->soundLoopId);
|
||||
soundPlayerPlay(soundsBallExplode, 1.0f, 1.0f, &ball->rigidBody.transform.position, &gZeroVec);
|
||||
ball->soundLoopId = SOUND_ID_NONE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,10 +6,13 @@
|
|||
#include "../physics/collision_scene.h"
|
||||
#include "dynamic_scene.h"
|
||||
#include "signals.h"
|
||||
#include "../audio/clips.h"
|
||||
#include "../audio/soundplayer.h"
|
||||
|
||||
#include "../build/assets/models/props/combine_ball_launcher.h"
|
||||
#include "../build/assets/materials/static.h"
|
||||
|
||||
|
||||
struct CollisionBox gBallLauncherBox = {
|
||||
{0.5f, 0.5f, 0.5f},
|
||||
};
|
||||
|
@ -92,6 +95,7 @@ void ballLauncherUpdate(struct BallLauncher* launcher) {
|
|||
|
||||
ballInit(&launcher->currentBall, &launcher->rigidBody.transform.position, &initialVelocity, launcher->rigidBody.currentRoom, launcher->ballLifetime);
|
||||
skAnimatorRunClip(&launcher->animator, &props_combine_ball_launcher_Armature_launch_clip, 0.0f, 0);
|
||||
soundPlayerPlay(soundsBallLaunch, 1.0f, 1.0f, &launcher->rigidBody.transform.position, &gZeroVec);
|
||||
}
|
||||
|
||||
if (ballIsActive(&launcher->currentBall) && !ballIsCollisionOn(&launcher->currentBall)) {
|
||||
|
|
Loading…
Reference in a new issue