Add moving platform sounds

This commit is contained in:
James Lambert 2023-10-07 18:48:21 -06:00
parent 5526034235
commit 6035b8e6f9
7 changed files with 9 additions and 3 deletions

View file

@ -241,6 +241,7 @@ enum AnimationSoundType {
AnimationSoundTypeNone,
AnimationSoundTypeLightRail,
AnimationSoundTypePiston,
AnimationSoundTypeArm,
};
struct AnimationInfo {

View file

@ -202,7 +202,7 @@ static void gameProc(void* arg) {
contactSolverInit(&gContactSolver);
portalSurfaceCleanupQueueInit();
savefileLoad();
levelLoadWithCallbacks(3);
levelLoadWithCallbacks(MAIN_MENU);
gCurrentTestSubject = 0;
cutsceneRunnerReset();
controllersInit();

View file

@ -115,7 +115,7 @@ void ballInit(struct Ball* ball, struct Vector3* position, struct Vector3* veloc
dynamicSceneSetRoomFlags(ball->dynamicId, ROOM_FLAG_FROM_INDEX(startingRoom));
ball->soundLoopId = soundPlayerPlay(soundsBallLoop, 1.0f, 1.0f, &ball->rigidBody.transform.position, &ball->rigidBody.velocity);
ball->soundLoopId = soundPlayerPlay(soundsBallLoop, 1.5f, 1.0f, &ball->rigidBody.transform.position, &ball->rigidBody.velocity);
}
void ballTurnOnCollision(struct Ball* ball) {
@ -134,7 +134,11 @@ void ballInitBurn(struct Ball* ball, struct ContactManifold* manifold) {
vector3Negate(&normal, &normal);
}
effectsSplashPlay(&gScene.effects, &gBallBounce, &ball->rigidBody.transform.position, &manifold->normal);
soundPlayerPlay(soundsBallBounce, 1.0f, 1.0f, &manifold->contacts[0].contactAWorld, &gZeroVec);
struct Vector3 position = manifold->contacts[0].contactAWorld;
if (manifold->shapeA->body) {
transformPoint(&manifold->shapeA->body->transform, &position, &position);
}
soundPlayerPlay(soundsBallBounce, 1.5f, 1.0f, &position, &gZeroVec);
ball->flags |= BallJustBounced;
}

View file

@ -18,6 +18,7 @@ struct AnimatedAudioInfo {
struct AnimatedAudioInfo gAnimatedAudioInfo[] = {
{.startSoundId = SOUND_ID_NONE, .loopSoundId = SOUND_ID_NONE, .endSoundId = SOUND_ID_NONE},
{.startSoundId = SOUND_ID_NONE, .loopSoundId = SOUNDS_BEAM_PLATFORM_LOOP1, .endSoundId = SOUND_ID_NONE, .pitch = 0.5f},
{.startSoundId = SOUNDS_DOORMOVE1, .loopSoundId = SOUND_ID_NONE, .endSoundId = SOUND_ID_NONE, .pitch = 0.4f},
{.startSoundId = SOUNDS_TANK_TURRET_START1, .loopSoundId = SOUNDS_TANK_TURRET_LOOP1, .endSoundId = SOUNDS_ELEVATOR_STOP1, .pitch = 0.5f},
};