Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

Commit

Permalink
minor tweaks for better fps/ups stability
Browse files Browse the repository at this point in the history
  • Loading branch information
RiedleroD committed Oct 27, 2020
1 parent a1550a5 commit fd3fe12
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(self,*args,**kwargs):
self.curval=None
self.gen=None
self.aconcur=0
self.playing=True
self.stats=[0,0,0,0,0]
self.labels=[]
self.btns=[]
Expand Down Expand Up @@ -157,13 +158,21 @@ def update(self,dt):
self.labels[6].setText("Pass:%02i"%self.stats[4])
self.play_all()
def play_all(self):
for i,apl in enumerate(self.apls):
if (not self.toplay) or not self.btns[4].pressed:
apl.volume=0
else:
item=self.toplay.pop()
apl.volume=1/self.aconcur
apl.pitch=1+item/BUCKLEN
if self.btns[4].pressed and self.toplay:
for apl in self.apls:
if not self.toplay:
apl.volume=0
else:
item=self.toplay.pop()
apl.volume=1/self.aconcur
apl.pitch=1+item/BUCKLEN
if not self.playing:
apl.play()
self.playing=True
elif self.playing:
for apl in self.apls:
apl.pause()
self.playing=False
self.toplay.clear()
def play(self,item):
self.toplay.append(item)
Expand Down

0 comments on commit fd3fe12

Please sign in to comment.