Skip to content

Commit

Permalink
Changed music offset default value
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiufeng54321 committed Jan 19, 2020
1 parent 22ece8c commit 5c80b0e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
Binary file modified muser/assets/resources.pyxres
Binary file not shown.
9 changes: 9 additions & 0 deletions muser/game/casts.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def increaseLevel(obj, inc):
def select(obj):
obj.finished = True
def __init__(self):
self.volume = 0.0
self.selection = 0
self.level_selection = 0
self.finished = False
Expand All @@ -86,13 +87,21 @@ def __init__(self):
print(self.sheets)
self.update_meta()
def update_meta(self):
self.volume = 0.0
self.level_selection = 0
self.sheet = SheetReader.from_sheets(self.sheets[self.selection])
self.music_source = self.sheet[self.level_selection].data["music"]
pygame.mixer.music.stop()
pygame.mixer.music.load(self.music_source)
pygame.mixer.music.play()
def update(self):
if self.volume >= 1.0:
self.volume = 1.0
else:
self.volume += 0.01
if self.volume > 1.0:
self.volume = 1.0
pygame.mixer.music.set_volume(self.volume)
for btn in Casts.LevelSelection.BUTTONS:
btn.update()
def draw(self):
Expand Down
2 changes: 1 addition & 1 deletion muser/game/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class LevelSelection:
PLAY_PRESSED = Frame(16, 64, 16, 16)
class PlayThrough:
# DIRECTIONS = [Frame(1 + x * 8, 5, 6, 6) for x in range(4)]
DIRECTIONS = [ArrowFrame(x, 6, 6) for x in range(4)]
DIRECTIONS = [ArrowFrame(x) for x in range(4)]
ARROW_FADE = [Frame(56 + 8 * x, 4, 8, 8) for x in range(4)]
INDICATOR_CIRCLE = Frame(32, 48, 32, 32)
# INDICATOR_RES = [Frame(x * 8, 16, 8, 8) for x in range(5)]
Expand Down
3 changes: 2 additions & 1 deletion muser/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import pyxel
import game_config as game_config
pyxel.init(256, 256,
caption="Muser", scale=48, fps=game_config.GLOB_CONFIG.fps)
caption="Muser", scale=48,
fps=game_config.GLOB_CONFIG.fps)

print("Window loaded")
pyxel.load(f"{game_config.GLOB_CONFIG.assets.root}/resources.pyxres")
Expand Down
2 changes: 1 addition & 1 deletion muser/sheet/gen/meta_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def proc(self):
indexes = sheet["indexes"]
effect_pool = sheet["effect_pool"] if "effect_pool" in sheet.keys() else []
effects = sheet["effects"] if "effects" in sheet.keys() else []
music_offset = sheet["music_offset"] if "music_offset" in sheet.keys() else 0
music_offset = sheet["music_offset"] if "music_offset" in sheet.keys() else 2000
mtas = MidiToAbsSheet(
abs_midi, tempo_index, indexes, music_offset, False)
abs_sheet = mtas.to_abs_sheet({
Expand Down

0 comments on commit 5c80b0e

Please sign in to comment.