Example #1
0
 def __init__(self):
     super(NewScene, self).__init__()
     EventManager.subscribe(self, 'onMouseDown')
     
     bg = Gradient.createVerticalGradient((20, 15), (255,255,255), (228, 139, 165), (111,86,117))
     bg = pygame.transform.scale(bg, (320, 240))
     self.add(Sprite(bg, (160, 120)))
Example #2
0
 def __init__(self):
     super(EmitterPerformanceTest, self).__init__()
     
     bg = Gradient.createVerticalGradient((20, 15), (255,255,255), (228, 139, 165), (111,86,117))
     bg = pygame.transform.scale(bg, (320, 240))
     self.add(Sprite(bg, (160, 120)))
     
     num_emitters = 8
     for i in range(num_emitters):
         e = Emitter(Particle, (ImageSheet(ResourceLoader.load('data//puffs.png'), (32, 32))[0], 1000), 40, self.onCreate)
         e.position = 40 + (i * (256 / (num_emitters - 1))), 216
         self.add(e)
     
     self.add(EndGameAfter(1000 * 30))
Example #3
0
 def __init__(self):
     super(NewScene, self).__init__()
     
     # Create a simple black to white gradient.
     surf = Gradient.createVerticalGradient((32, 208), (255,255,255), (0,0,0))
     self.add(Sprite(surf, (32, 120)))
     
     # Create a low-res and upscale it for a retro effect.
     surf = Gradient.createVerticalGradient((1, 26), (255,221,0), (255,221,0), (58,209,131), (32,169,131), (32,169,131), (17,115,117), (64,18,60), (64,18,60), (64,18,60))
     surf = pygame.transform.scale(surf, (32, 208))
     self.add(Sprite(surf, (80, 120)))
     
     # Create regular multi-stop gradient
     surf = Gradient.createVerticalGradient((32, 208), (255,237,171),(255,237,171), (255,224,137), (249,182,114), (252,136,97), (174,58,71), (174,58,71))
     self.add(Sprite(surf, (128, 120)))
     
     # Create simple black to white gradient
     surf = Gradient.createHorizontalGradient((144, 32), (255,255,255), (0,0,0))
     self.add(Sprite(surf, (232, 32)))
     
     # Create a low-res and upscale it for a retro effect.
     surf = Gradient.createHorizontalGradient((12, 32), (246,177,73), (246,177,73), (248,87,45), (223,42,51), (162,37,67), (107,49,45), (107,49,45), (107,49,45))
     surf = pygame.transform.scale(surf, (144, 32))
     self.add(Sprite(surf, (232, 80)))