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
- Update 128 - Patchy 1.12: New Music, Italien, Performance, Bugfixing, Tweaks5 days ago
- Update 127 - STEAM RELEASE!14 days ago
- Update 126 - All Events > Cozy Space Survivors Events > Damage Numbers, Impact P...17 days ago
- Update 125 - Mine Push, Tweaks, Bugfixes19 days ago
- Update 124 - Hula-Hoop Tweaks26 days ago
- Upadte 123 - End Game Animation27 days ago
- Update 122 - Release-Date-Trailer!!!!29 days ago
- Update 121 - Rainbow of Love & Boxy Guidance33 days ago
- Update 120 - Missile Launcher Unlock, Splash Damage Visualization34 days ago
- Update 119 - Missile Launcher39 days ago
Leave a comment
Log in with itch.io to leave a comment.