Пример #1
0
    def draw( self, frame ):
        TipDlg.draw( self, frame )

        frame.optimize_speed = False
        frame.draw( self.playfield )
        frame.optimize_speed = True

        resman.get("gui.enterdlg_surf").draw(frame.surface, geo.Vec2D(0,0))
Пример #2
0
    def draw_background(self, frame):
        for tile in self.model.tiles:
            if not isinstance(tile, tiles.Enterance):
                x = tile.pos.x * 32 + tile.pos.y * 32 + frame.X_OFFSET
                y = -tile.pos.x * 16 + tile.pos.y * 16 + frame.Y_OFFSET
                pos = geo.Vec2D(x, y)

                tile_surf = resman.get("game.tile%d_surf" % tile.type)
                if not hasattr(tile, "view_surf_nr"):
                    tile.view_surf_nr = random.randint(0, 4)
                tile_surf.nr = tile.view_surf_nr
                tile_surf.draw(frame.surface, pos)
Пример #3
0
    def init_background(self):
        self.background = gfx.Surface((800, 600))
        frame = frm.Frame(self.background, 0, 0)
        frame.X_OFFSET, frame.Y_OFFSET = 20, 300

        for tile in self.model.tiles:
            if not isinstance(tile, tiles.Enterance):
                x = tile.pos.x * 32 + tile.pos.y * 32 + frame.X_OFFSET
                y = -tile.pos.x * 16 + tile.pos.y * 16 + frame.Y_OFFSET
                pos = geo.Vec2D(x, y)

                tile_surf = resman.get("game.tile%d_surf" % tile.type)
                tile_surf.nr = random.randint(0, 4)
                tile_surf.draw(frame.surface, pos)