3 from keyhandler import *
4 from math import exp,pi,sqrt
6 # A rotowidget displays two axes of information in a rotary fashion. A
7 # central "pulser" is designed to show the score, and an arc around the
8 # edge shows the progress through the song.
10 # Color format: (level, color)
11 # If the first item's level is greater than zero, the first
13 pulsecolors = [(0,(180,0,0)), (80,(50,255,0))]
14 arccolors = [(0,(200,0,200))]
17 def __init__(self,center,radius,period):
18 self.screen = pygame.display.get_surface()
27 rad = self.radius * (self.pulsev / 100.0) + (0.1 * self.radius) * exp(self.r * (t % self.period))
32 for n in range(len(self.pulsecolors)-1,-1,-1):
33 if self.pulsecolors[n][0] <= self.pulsev:
34 pc = self.pulsecolors[n][1]
36 pygame.draw.circle(self.screen,pc,self.center,rad,0)
39 for n in range(len(self.arccolors)-1,-1,-1):
40 if self.arccolors[n][0] <= self.arcv:
41 ac = self.arccolors[n][1]
43 pygame.draw.arc(self.screen,ac,(self.center[0]-self.radius, self.center[1]-self.radius, self.radius*2, self.radius*2),0,2*pi*(self.arcv / 100.0),3)