Esempio n. 1
0
File: pilot.py Progetto: kozbot/kecb
 def generate(self):
     return [
         ITERM(right=False),
         entity.Line(start=entity.Point(10, -5), end=entity.Point(50, -5)),
         entity.Line(start=entity.Point(30, -5), end=entity.Point(30, 10)),
         ITERM(left=False).translate(xoff=40, yoff=0)
     ]
Esempio n. 2
0
 def generate(self):
     return [
         entity.Line(entity.Point(0, 0), entity.Point(0, -12)),
         entity.Line(entity.Point(-6, -12), entity.Point(6, -12)),
         entity.Line(entity.Point(-4, -14), entity.Point(4, -14)),
         entity.Line(entity.Point(-2, -16), entity.Point(2, -16)),
     ]
Esempio n. 3
0
 def generate(self):
     return [
         entity.Line(entity.Point(0, 0), entity.Point(5, 0)),
         entity.Line(entity.Point(15, 0), entity.Point(20, 0)),
         entity.Line(entity.Point(5, 10), entity.Point(5, -10)),
         entity.Line(entity.Point(15, 10), entity.Point(15, -10)),
     ]
Esempio n. 4
0
File: limit.py Progetto: kozbot/kecb
 def generate(self):
     return [
         LSW_NC(),
         entity.Line(start=entity.Point(*LSW_NC_LINE_INTERSECT), end=entity.Point(30, -15)),
         entity.Arc.from_crse(center=entity.Point(30, -25), radius=10, start=0, end=180),
         entity.Line(start=entity.Point(20, -25), end=entity.Point(40, -25))
     ]
Esempio n. 5
0
 def generate(self):
     return [
         entity.Line(entity.Point(0, 0), entity.Point(0, -12)),
         entity.Line(entity.Point(-6, -12), entity.Point(6, -12)),
         entity.Line(entity.Point(-6, -12), entity.Point(-9, -17)),
         entity.Line(entity.Point(0, -12), entity.Point(-3, -17)),
         entity.Line(entity.Point(6, -12), entity.Point(3, -17)),
     ]
Esempio n. 6
0
    def generate(self):
        base: List[entity.Entity] = [entity.Circle(entity.Point(10, 0), 5)]

        if self.left:
            base.append(entity.Line(entity.Point(0, 0), entity.Point(5, 0)))

        if self.right:
            base.append(entity.Line(entity.Point(15, 0), entity.Point(20, 0)))

        return base
Esempio n. 7
0
 def generate(self):
     return [
         ETERM(),
         entity.Line(start=entity.Point(20, 0), end=entity.Point(40, 0)),
         NC().translate(xoff=40, yoff=0),
         entity.Line(start=entity.Point(60, 0), end=entity.Point(80, 0)),
         entity.Rect(points=[
             entity.Point(-10, 20),
             entity.Point(110, 20),
             entity.Point(110, -20),
             entity.Point(-10, -20),
         ], linetype='PHANTOM'),
         ETERM().translate(xoff=80, yoff=0)
     ]
Esempio n. 8
0
 def __init__(self, player_left, player_right, configuration):
     self.player_left = player_left
     self.player_right = player_right
     self.configuration = configuration
     self.background = pygame.Surface(configuration['screen_size'])
     self.sprites = pygame.sprite.OrderedUpdates()
     line = entity.Line(load_image(configuration['line_image']), self.sprites)
     line.rect.topleft = ((configuration['screen_size'][0]-line.rect.width)/2, 0)
     paddle_image = load_image(configuration['paddle_image'])
     self.paddle_left = entity.Paddle(configuration['paddle_velocity'], paddle_image, configuration['paddle_bounds'], self.sprites)
     self.paddle_right = entity.Paddle(configuration['paddle_velocity'], paddle_image, configuration['paddle_bounds'], self.sprites)
     self.paddle_left.rect.topleft = (self.configuration['paddle_left_position'], (self.configuration['screen_size'][1]-self.paddle_left.rect.height)/2)
     self.paddle_right.rect.topleft = (self.configuration['paddle_right_position'], (self.configuration['screen_size'][1]-self.paddle_left.rect.height)/2)
     digit_images = [load_image(configuration['digit_image'] % n) for n in xrange(10)]
     self.score_left = entity.Score(digit_images, self.sprites)
     self.score_left.rect.topleft = configuration['score_left_position']
     self.score_right = entity.Score(digit_images, self.sprites)
     self.score_right.rect.topleft = configuration['score_right_position']
     ball_image = load_image(configuration['ball_image'])
     self.ball = entity.Ball(self.configuration['ball_velocity'], ball_image, self.sprites)
     self.bounds = pygame.Rect(20, 0, configuration['screen_size'][0]-ball_image.get_width()-20, configuration['screen_size'][1]-ball_image.get_height())
     self.sound_missed = pygame.mixer.Sound(configuration['sound_missed'])
     self.sound_paddle = pygame.mixer.Sound(configuration['sound_paddle'])
     self.sound_wall = pygame.mixer.Sound(configuration['sound_wall'])
     self.reset_game(random.random()<0.5)
     self.running = True
Esempio n. 9
0
 def generate_multipole(self, poles=1):
     entities = self.generate_multipole_basic(poles=poles)
     entities.append(
         entity.Line(start=entity.Point(30, 20),
                     end=entity.Point(30,
                                      20 + (cfg.POLE_OFFSET * (poles - 1))),
                     linetype='PHANTOM'))
     return entities
Esempio n. 10
0
 def generate(self):
     return [
         entity.Line(entity.Point(0, 0), entity.Point(0, -12)),
         entity.PolyLine(points=[
             entity.Point(-6, -12),
             entity.Point(6, -12),
             entity.Point(0, -18)
         ],
                         closed=True)
     ]
Esempio n. 11
0
 def generate(self):
     return [
         NO(),
         entity.Line(entity.Point(0, 10), entity.Point(20, -10)),
     ]
Esempio n. 12
0
File: limit.py Progetto: kozbot/kecb
 def generate(self):
     return [
         ITERM(right=False),
         entity.Line(entity.Point(15, 0), entity.Point(*LSW_NC_LINE_END)),
         ITERM(left=False).translate(xoff=40, yoff=0)
     ]
Esempio n. 13
0
File: limit.py Progetto: kozbot/kecb
 def generate(self):
     return [
         LSW_NC(),
         entity.Line(start=entity.Point(*LSW_NC_LINE_INTERSECT), end=entity.Point(30, -15)),
         entity.Circle(center=entity.Point(30, -25), radius=10)
     ]