def __init__(self): #Our main variables used within the game self.resolution = self.width, self.height = 800, 600 self.gridSize = self.xGrid, self.yGrid = 320, 240 self.movers = [] self._fontFile = pygame.font.match_font('freemono') self._fontSize = 14 #Build our main grid self.gameGrid = Grid() self.make_grid(self.gridSize) #Build the terrain as a single surface self.terrainSurf = pygame.Surface(self.gridSize) #Our main view port/camera self.view = ViewPort((0, 0, 0), self.resolution, self.gridSize, self.terrainSurf) #initialize and blank the screen pygame.init() self.screen = pygame.display.set_mode(self.resolution) pygame.display.set_caption('Project D.O.R.F.') pygame.key.set_repeat(500, 33) # Key repeating self.font = pygame.font.Font(self._fontFile, self._fontSize) self.font.set_bold(True) self.generate_terrain() self.update_terrain_surf()
def createVncViewPort(self, params): url = 'vnc://:' + params['password'] + '@127.0.0.1:' + str( params['port']) self.viewPort = ViewPort(url) self.viewPort.start() self.viewPort.mouseLeftButtonClicked.connect(self.focused) self.layout().addWidget(self.viewPort)