Added audio cue when player does not have the right key combination

dev
Shariq Shah 6 years ago
parent e8660d11e5
commit cd0416c1cf
  1. BIN
      assets/sounds/door_locked.wav
  2. 2
      src/common/version.h
  3. 13
      src/game/door.c
  4. 1
      src/game/entity.h
  5. 6
      todo.txt

Binary file not shown.

@ -4,7 +4,7 @@
/* Auto generated version file. DO NOT MODIFY */
#define SYMMETRY_VERSION_MAJOR 0
#define SYMMETRY_VERSION_MINOR 1
#define SYMMETRY_VERSION_REVISION 348
#define SYMMETRY_VERSION_REVISION 349
#define SYMMETRY_VERSION_BRANCH "dev"
#endif

@ -84,6 +84,16 @@ void door_update(struct Door* door, struct Scene* scene, float dt)
sound_source_buffer_set(game_state->sound, door->sound, "sounds/door_open.wav", ST_WAV);
sound_source_play(game_state->sound, door->sound);
}
else
{
// Player does not have the right keys so the door is locked
if(!door->lock_sound_played && sound_source_is_paused(game_state->sound, door->sound))
{
sound_source_buffer_set(game_state->sound, door->sound, "sounds/door_locked.wav", ST_WAV);
sound_source_play(game_state->sound, door->sound);
door->lock_sound_played = true;
}
}
}
break;
case DOOR_OPEN:
@ -107,6 +117,9 @@ void door_update(struct Door* door, struct Scene* scene, float dt)
door->state = DOOR_CLOSED;
break;
}
if(!door->trigger->triggered)
door->lock_sound_played = false;
}
void door_update_key_indicator_materials(struct Door* door)

@ -265,6 +265,7 @@ struct Door
float speed;
float open_position;
float close_position;
bool lock_sound_played;
struct Static_Mesh* mesh;
struct Static_Mesh* key_indicator_red;
struct Static_Mesh* key_indicator_green;

@ -1,7 +1,4 @@
Todo:
- RGB keys to progress to next level
- Visual indicator on doors corresponding to their key masks
- Audio cues when player does not have the right key combination to open a particular door
- Player/enemies getting hit by bullets
- Win/fail States
- Remove excessive repitition in scene and editor code that handles multiple entity types
@ -422,3 +419,6 @@ Done:
* Doors that open using the red/green/blue keys only as a way of progressing the level or cordoing off certain sections
* Implemented player footstep sounds for walking, running and jumping
* Player jump cooldown, don't allow jump until a certian time interval has passed, even if we're grounded
* RGB keys to progress to next level
* Visual indicator on doors corresponding to their key masks
* Audio cues when player does not have the right key combination to open a particular door
Loading…
Cancel
Save