Ejemplo n.º 1
0
 def load(self, date_board):
     self.end(False)
     if self.loaded:
         camera.unregisterMap()
         self.crosshair.close()
         self.keyboard.close()
     self.engine = pickle.loads(date_board)
     self.game_map = self.engine.getGameMap()
     camera.reset()
     camera.setScreen()
     camera.registerMap(self.game_map)
     camera.registerObjects(self.engine.objects)
     self.set_player_owner(self.my_id, self.ch_img)
     self.loaded = True
     self.start()
Ejemplo n.º 2
0
	def load(self,date_board):
		self.end(False)
		if self.loaded:
			camera.unregisterMap()
			self.crosshair.close()
			self.keyboard.close()
		self.engine=pickle.loads(date_board)
		self.game_map=self.engine.getGameMap()
		camera.reset()
		camera.setScreen()
		camera.registerMap(self.game_map)
		camera.registerObjects(self.engine.objects)
		self.set_player_owner(self.my_id,self.ch_img)
		self.loaded = True
		self.start()
Ejemplo n.º 3
0
 def create(self, map_name):
     self.game_map = GameMap(map_name)
     self.engine = Board(self.game_map)
     camera.registerMap(self.game_map)
Ejemplo n.º 4
0
	def create(self,map_name):
		self.game_map = GameMap(map_name)
		self.engine = Board(self.game_map)
		camera.registerMap(self.game_map)
Ejemplo n.º 5
0

def quit(event):
	pygame.quit()
	sys.exit(1)


screen = pygame.display.set_mode((800, 600))
camera.setScreen()

player = Player(0,0,0,"hero.png", "hero.png")
dummy = Player(10,20,0,"hero.png", "hero.png")

gm = GameMap("bigmap.png")
engine = Board(gm)
camera.registerMap(gm)
engine.registerPlayer(player)
engine.registerPlayer(dummy)

event_callback = EventCallback()
crosshair = Crosshair("crosshair.png",player,event_callback)
keyboard = KeyboardController(player,event_callback)
event_callback.registerCallback(pygame.QUIT, quit)
camera.trackObject(player)

while 1:

	event_callback.processEvents()
	crosshair.epoch()
	engine.epoch()
	camera.show()
Ejemplo n.º 6
0

def quit(event):
    pygame.quit()
    sys.exit(1)


screen = pygame.display.set_mode((800, 600))
camera.setScreen()

player = Player(0, 0, 0, "hero.png", "hero.png")
dummy = Player(10, 20, 0, "hero.png", "hero.png")

gm = GameMap("bigmap.png")
engine = Board(gm)
camera.registerMap(gm)
engine.registerPlayer(player)
engine.registerPlayer(dummy)

event_callback = EventCallback()
crosshair = Crosshair("crosshair.png", player, event_callback)
keyboard = KeyboardController(player, event_callback)
event_callback.registerCallback(pygame.QUIT, quit)
camera.trackObject(player)

while 1:

    event_callback.processEvents()
    crosshair.epoch()
    engine.epoch()
    camera.show()