Ejemplo n.º 1
0
 def __init__(self, position, newcolor=choice(color.LIST), special=False):
     GameObject.__init__(self)
     self._anim      = 0
     self.color      = newcolor
     self.temp_color = self.color
     self.current_frame_list = _block_frames_color_blind if settings.SETTINGS['color_blind'] else _block_frames
     self.image              = self.current_frame_list[id(self.color)][0]
     self.position = position
     self.rect     = pygame.Rect(position, self.image.get_size()) #(x, y)
     self._special = special
     self.state    = Block.STATES.IDLE
Ejemplo n.º 2
0
 def __init__(self, position, newcolor=choice(color.LIST), special=False):
     GameObject.__init__(self)
     self._anim = 0
     self.color = newcolor
     self.temp_color = self.color
     self.current_frame_list = _block_frames_color_blind if settings.SETTINGS[
         'color_blind'] else _block_frames
     self.image = self.current_frame_list[id(self.color)][0]
     self.position = position
     self.rect = pygame.Rect(position, self.image.get_size())  #(x, y)
     self._special = special
     self.state = Block.STATES.IDLE
Ejemplo n.º 3
0
    def __init__(self, startpos=(-300.0, -300.0), newcolor=choice(color.LIST)):
        GameObject.__init__(self)

        self._anim              = 0
        self.color              = newcolor
        self.current_frame_list = _ball_frames_color_blind if settings.SETTINGS['color_blind'] else _ball_frames
        self.image              = self.current_frame_list[id(newcolor)][0]
        size                    = self.image.get_size()
        self.rect               = Rect(startpos, size)
        self.position           = list(self.rect.topleft)
        self.progress           = 0
        self._target            = [None, 0]
        self.startpos           = startpos
        self.state              = BallOfLight.STATES.IDLE

        del self.acceleration, self.velocity
Ejemplo n.º 4
0
    def __init__(self, startpos=(-300.0, -300.0), newcolor=choice(color.LIST)):
        GameObject.__init__(self)

        self._anim = 0
        self.color = newcolor
        self.current_frame_list = _ball_frames_color_blind if settings.SETTINGS[
            'color_blind'] else _ball_frames
        self.image = self.current_frame_list[id(newcolor)][0]
        size = self.image.get_size()
        self.rect = Rect(startpos, size)
        self.position = list(self.rect.topleft)
        self.progress = 0
        self._target = [None, 0]
        self.startpos = startpos
        self.state = BallOfLight.STATES.IDLE

        del self.acceleration, self.velocity
Ejemplo n.º 5
0
    def __init__(self, settings):
        pyasge.ASGEGame.__init__(self, settings)
        self.gamedata = GameData()
        self.gamedata.inputs = self.inputs
        self.scene = GameMenu(self.gamedata)
        self.handler = self.inputs.addCallback(
            pyasge.EventType.E_KEY, self.scene.key_handler
        )

        self.inputs.setCursorMode(pyasge.CursorMode.HIDDEN)

        self.gamedata.background = GameObject("/data/images/background.jpg")
        self.gamedata.background.sprite.z_order = -50
        self.gamedata.background.sprite.width = 608
        self.gamedata.background.sprite.height = 1080

        self.gamedata.parallax = []
        self.gamedata.parallax.append(GameObject("/data/images/spr_stars00.png"))
        self.gamedata.parallax.append(GameObject("/data/images/spr_stars01.png"))
        self.gamedata.parallax[0].sprite.z_order = -20
        self.gamedata.parallax[0].sprite.width = 608
        self.gamedata.parallax[0].sprite.height = 1080
        self.gamedata.parallax[0].sprite.src_rect[3] = 1080 / 6
        self.gamedata.parallax[0].sprite.texture.setUVMode(
            Texture.UVWrapMode.REPEAT, Texture.UVWrapMode.REPEAT
        )

        self.gamedata.parallax[1].sprite.z_order = -10
        self.gamedata.parallax[1].sprite.width = 608
        self.gamedata.parallax[1].sprite.height = 1080
        self.gamedata.parallax[1].sprite.src_rect[3] = 1080 / 6
        self.gamedata.parallax[1].sprite.texture.setUVMode(
            Texture.UVWrapMode.REPEAT, Texture.UVWrapMode.REPEAT
        )

        self.gamedata.font = self.renderer.loadFont(
            "/data/fonts/kenvector_future.ttf", 96
        )
Ejemplo n.º 6
0
 def update(self):
     GameObject.update(self)
Ejemplo n.º 7
0
 def update(self):
     GameObject.update(self)