Пример #1
0
    def begin(self):
        
        # Initialise some things
        self.x = randrange(50, 600)
        self.y = randrange(50, 450)

        self.alpha = 120
        self.size = randrange(10, 250)
        
        self.graph = Program.new_map(100,100)
        Program.map_clear(self.graph, (randrange(50, 200), randrange(50, 200), randrange(50, 200)))
                 
        direction = randrange(0, 2)
        size_to = 0 if direction else 250
        
        # In-game loop
        while True:
            
            # Spin these dudes
            self.angle += 5000 if direction else -5000 
            
            # Size them around
            if size_to == 250:
                self.size += 5
                if self.size >= size_to:
                    size_to = 0
            if size_to == 0:
                self.size -= 5
                if self.size <= size_to:
                    size_to = 250
                    
            # leave frame
            yield
Пример #2
0
	def begin(self, game, color):

		self.x = game.screen_size[0]/2
		self.y = game.screen_size[1]/2
		self.size = 100
		self.graph = Program.new_map(game.screen_size[0], game.screen_size[1])
		Program.map_clear(self.graph, color)

		while True:

			yield
Пример #3
0
	def begin(self, bars, idx):

		self.bars = bars

		bar_width = round((self.bars.main.game.screen_size[0] / self.bars.bars_count))
		bar_height = round(self.bars.main.game.screen_size[1] / 2)

		self.x = ((bar_width) * idx) + round(bar_width/2)
		self.size = 100

		while True:

			if (self.bars.values[idx] != self.bars.prev_values[idx]):
				self.bars.prev_values[idx] = self.bars.values[idx]
				self.y = bar_height - round(((bar_height/2) * self.bars.values[idx]) / 100)
				self.graph = Program.new_map(bar_width-4, round(bar_height * self.bars.values[idx] / 100) )
				cl = self.bars.values[idx] * 255 / 100
				self.alpha = cl
				color = (0, 0, 255)
				Program.map_clear(self.graph, color)

			yield