hexyz is tower defense game, and a lua library for dealing with hexagonal grids
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. SOUNDS = {
  2. -- sfxr_synth seeds
  3. EXPLOSION1 = 49179102, -- this slowed sounds metal as fuck
  4. EXPLOSION2 = 19725402,
  5. EXPLOSION3 = 69338002,
  6. EXPLOSION4 = 92224102,
  7. COIN1 = 10262800,
  8. HIT1 = 39920504,
  9. LASER1 = 79859301,
  10. LASER2 = 86914201,
  11. PUSH1 = 30455908,
  12. SELECT1 = 76036806,
  13. PUSH2 = 57563308,
  14. BIRD1 = 50838307,
  15. BIRD2 = 16549407,
  16. RANDOM1 = 85363309,
  17. RANDOM2 = 15482409,
  18. RANDOM3 = 58658009,
  19. RANDOM4 = 89884209,
  20. RANDOM5 = 36680709,
  21. -- audio buffers
  22. MAIN_THEME = am.track(am.load_audio("res/maintheme.ogg"), true, 1, settings.music_volume)
  23. }
  24. -- doesn't get unset when a track is 'done' playing automatically
  25. CURRENT_TRACK = nil
  26. function update_sfx_volume() end
  27. function update_music_volume(volume)
  28. if CURRENT_TRACK then
  29. CURRENT_TRACK.volume = math.clamp(volume, 0, 1)
  30. end
  31. end
  32. -- play sound effect with variable pitch
  33. function vplay_sfx(sound, pitch_range)
  34. local pitch = (math.random() + 0.5)/(pitch_range and 1/pitch_range or 2)
  35. win.scene:action(am.play(sound, false, pitch, settings.sfx_volume))
  36. end
  37. function play_sfx(sound)
  38. win.scene:action(am.play(sound, false, 1, settings.sfx_volume))
  39. end
  40. function play_track(track, loop)
  41. CURRENT_TRACK = track
  42. win.scene:action(am.play(track, loop or true))
  43. end