Update 61 - Sound Regulation, Loot Magnet
Bugfix
- Fixed: Player could lose a Space-MooMoo while passing by the Pacman-Planet (MooMoo would stay there until player comes back).
Loot Magnet
Collecting one of those magnet will suck in ALL xp or chocolate from the whole level.
Video (with sound): https://imgur.com/vtyvp4T
Sound Regulation
I've prevented the game now from playing the same sound at the same time multiple times. Now it does not get too loud all the time.
Video Demo (with sound): https://imgur.com/gKxBfvm
My solution in code: I'm storing the resource path (e.g. ".../mysound.wav") into an array when I want to play it. Before playing it, I search the same array, if this resource-path is already in there. After a defined time, I remove the resource path from the array. In my case, the entries stay for 0.03s in there and then get removed. Meaning: Every frame (when we think of 30 FPS) you can play one sound of the same type.
Sound Manager (Autoload)
extends Node class sound_info: var timer var resource_path var recently_played_sounds = [] func _process(delta): for i in range(recently_played_sounds.size()-1, -1, -1): recently_played_sounds[i].timer -= delta if recently_played_sounds[i].timer <= 0.0: recently_played_sounds.remove_at(i) func register_sound(_stream, _timer = 0.03): var new_sound_info = sound_info.new() new_sound_info.resource_path = _stream.resource_path new_sound_info.timer = _timer recently_played_sounds.append(new_sound_info) func sound_was_recently_played(_stream): for my_sound_info in recently_played_sounds: if _stream.resource_path == my_sound_info.resource_path: return true return false
Usage in Code (Script added to AudioStreamPlayer):
func play_sound_stream(): if not SoundManager.sound_was_recently_played(stream): SoundManager.register_sound(stream) play()
Files
Get Cozy Space Survivors
Cozy Space Survivors
Cute Space Shooter with Auto-Firing like in Vampire Survivors and cozy quests.
Status | Released |
Publisher | |
Author | simonschreibt |
Genre | Action |
Tags | 2D, Bullet Hell, Controller, Cozy, Loot, Roguelite, rougelite, Sci-fi, Space, vampire-survivors |
Languages | English |
More posts
- Patchy 1.5.5: Bugfixes, TweaksJul 08, 2024
- Patchy 1.5.4: Guidance to Shop, BugfixJul 08, 2024
- Patchy 1.5.3: Fixed Mouse ControlsJul 07, 2024
- Update 135: Patchy 1.5.2: Bugfixes & Performance TweaksJul 07, 2024
- Update 134: Patchy 1.5.1: Bugfixes, LocaJul 04, 2024
- Update 133: Patchy 1.5: New "AI" ShipyJul 03, 2024
- Update 132: Patchy 1.4.1: Performance ImprovementsJun 24, 2024
- Update 131: Patchy 1.4: Shopkeeper, Mine-Tweaks, CatalanJun 23, 2024
- Update 130: Patchy 1.3: Gallery, Quest Overview & Guidance, Balancing, Portugues...Jun 02, 2024
- Update 129 - Patchy 1.2 - Progress-Sun, Turkish, Japanese, Balancing, BugfixesMay 20, 2024
Leave a comment
Log in with itch.io to leave a comment.