diff --git a/assets/sounds/door_locked.wav b/assets/sounds/door_locked.wav new file mode 100644 index 0000000..f26955d Binary files /dev/null and b/assets/sounds/door_locked.wav differ diff --git a/src/common/version.h b/src/common/version.h index 3c95f2c..56426bf 100755 --- a/src/common/version.h +++ b/src/common/version.h @@ -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 \ No newline at end of file diff --git a/src/game/door.c b/src/game/door.c index 38a1d5b..7975ad1 100644 --- a/src/game/door.c +++ b/src/game/door.c @@ -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) @@ -180,4 +193,4 @@ void door_on_trigger(struct Event* event, void* door_ptr) case DOOR_CLOSING: break; } -} +} \ No newline at end of file diff --git a/src/game/entity.h b/src/game/entity.h index d035545..5d49457 100755 --- a/src/game/entity.h +++ b/src/game/entity.h @@ -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; diff --git a/todo.txt b/todo.txt index 51b69f6..48b4ece 100644 --- a/todo.txt +++ b/todo.txt @@ -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 @@ -421,4 +418,7 @@ Done: * Switched transformation in property inspector to show/modify local transform values by default and show absolute transform values as read-only. * 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 \ No newline at end of file + * 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 \ No newline at end of file