feat: add plasma gun weapon implementation and new pause menu system with loadout management
This commit is contained in:
@@ -261,4 +261,127 @@ for i in range(int(sample_rate * dj_duration)):
|
||||
dj_samples.append((filtered * 0.4 + lift) * env)
|
||||
write_wav('assets/sounds/double_jump.wav', dj_samples)
|
||||
|
||||
|
||||
# ==========================================
|
||||
# NEW WEAPONS (AK47, M4, MP7, DMR, Plasma, Nail)
|
||||
# ==========================================
|
||||
|
||||
# 11. AK47 (Heavy punch, low thud, sharp crack)
|
||||
ak_duration = 0.2
|
||||
ak_samples = []
|
||||
for i in range(int(sample_rate * ak_duration)):
|
||||
t = i / sample_rate
|
||||
noise = random.uniform(-1.0, 1.0)
|
||||
|
||||
# Sharp metallic crack
|
||||
crack_env = math.exp(-t * 100.0)
|
||||
crack = noise * crack_env * 0.4
|
||||
|
||||
# Deep heavy punch (70Hz sweep down to 40Hz)
|
||||
punch_freq = max(40.0, 70.0 - t * 300.0)
|
||||
punch_env = math.exp(-t * 20.0)
|
||||
punch = math.sin(t * punch_freq * 2 * math.pi) * punch_env * 0.6
|
||||
|
||||
# Mechanism ring
|
||||
ring_env = math.exp(-t * 15.0)
|
||||
ring = math.sin(t * 800.0 * 2 * math.pi) * ring_env * 0.05
|
||||
|
||||
ak_samples.append(crack + punch + ring)
|
||||
write_wav('assets/sounds/ak47_fire.wav', ak_samples)
|
||||
|
||||
|
||||
# 12. M4 (Moderate punch, sharper crack, tighter burst)
|
||||
m4_duration = 0.15
|
||||
m4_samples = []
|
||||
for i in range(int(sample_rate * m4_duration)):
|
||||
t = i / sample_rate
|
||||
noise = random.uniform(-1.0, 1.0)
|
||||
|
||||
crack_env = math.exp(-t * 120.0)
|
||||
crack = noise * crack_env * 0.5
|
||||
|
||||
punch_freq = 90.0
|
||||
punch_env = math.exp(-t * 25.0)
|
||||
punch = math.sin(t * punch_freq * 2 * math.pi) * punch_env * 0.4
|
||||
|
||||
m4_samples.append(crack + punch)
|
||||
write_wav('assets/sounds/m4_fire.wav', m4_samples)
|
||||
|
||||
|
||||
# 13. MP7 (Very fast, light pop, high pitched)
|
||||
mp7_duration = 0.1
|
||||
mp7_samples = []
|
||||
for i in range(int(sample_rate * mp7_duration)):
|
||||
t = i / sample_rate
|
||||
noise = random.uniform(-1.0, 1.0)
|
||||
|
||||
pop_env = math.exp(-t * 80.0)
|
||||
pop = noise * pop_env * 0.3
|
||||
|
||||
punch_freq = 150.0
|
||||
punch_env = math.exp(-t * 35.0)
|
||||
punch = math.sin(t * punch_freq * 2 * math.pi) * punch_env * 0.2
|
||||
|
||||
mp7_samples.append(pop + punch)
|
||||
write_wav('assets/sounds/mp7_fire.wav', mp7_samples)
|
||||
|
||||
|
||||
# 14. DMR (Extremely loud, echoing boom, very sharp)
|
||||
dmr_duration = 0.4
|
||||
dmr_samples = []
|
||||
for i in range(int(sample_rate * dmr_duration)):
|
||||
t = i / sample_rate
|
||||
noise = random.uniform(-1.0, 1.0)
|
||||
|
||||
crack_env = math.exp(-t * 50.0)
|
||||
crack = noise * crack_env * 0.6
|
||||
|
||||
boom_freq = max(30.0, 60.0 - t * 100.0)
|
||||
boom_env = math.exp(-t * 8.0)
|
||||
boom = math.sin(t * boom_freq * 2 * math.pi) * boom_env * 0.7
|
||||
|
||||
tail_env = math.exp(-t * 5.0)
|
||||
tail = noise * tail_env * 0.1 # outdoor echo reflection
|
||||
|
||||
dmr_samples.append(crack + boom + tail)
|
||||
write_wav('assets/sounds/dmr_fire.wav', dmr_samples)
|
||||
|
||||
|
||||
# 15. Plasma Gun (Sci-Fi pew, tonal sweep)
|
||||
plasma_duration = 0.2
|
||||
plasma_samples = []
|
||||
for i in range(int(sample_rate * plasma_duration)):
|
||||
t = i / sample_rate
|
||||
|
||||
# Sweep from 1200 Hz down to 300 Hz rapidly
|
||||
freq = max(300.0, 1200.0 * math.exp(-t * 30.0))
|
||||
pew_env = math.exp(-t * 15.0)
|
||||
pew = math.sin(t * freq * 2 * math.pi) * pew_env * 0.6
|
||||
|
||||
plasma_samples.append(pew)
|
||||
write_wav('assets/sounds/plasma_fire.wav', plasma_samples)
|
||||
|
||||
|
||||
# 16. Nail Gun (Clack clack clack, metallic hit)
|
||||
nail_duration = 0.1
|
||||
nail_samples = []
|
||||
for i in range(int(sample_rate * nail_duration)):
|
||||
t = i / sample_rate
|
||||
noise = random.uniform(-1.0, 1.0)
|
||||
|
||||
# Sharp metallic impact
|
||||
hit_env = math.exp(-t * 150.0)
|
||||
hit = noise * hit_env * 0.4
|
||||
|
||||
# Ringing metal (two tones)
|
||||
ring_env = math.exp(-t * 40.0)
|
||||
ring = (math.sin(t * 3500.0 * 2 * math.pi) + math.sin(t * 4100.0 * 2 * math.pi)) * ring_env * 0.15
|
||||
|
||||
# Mechanism chunk
|
||||
chunk_env = math.exp(-t * 30.0)
|
||||
chunk = math.sin(t * 200.0 * 2 * math.pi) * chunk_env * 0.2
|
||||
|
||||
nail_samples.append(hit + ring + chunk)
|
||||
write_wav('assets/sounds/nailgun_fire.wav', nail_samples)
|
||||
|
||||
print("Generated all sounds!")
|
||||
|
||||
Reference in New Issue
Block a user