Example #1
0
	def __init__(self,scrw,scrh,function,obj_self,enable_fraping,ch_img=None,my_id=-1):
		utils.patch_copy_reg()	
		self.my_id = my_id
		self.screen = pygame.display.set_mode((scrw,scrh))
		camera.setScreen()
		self.event_callback = EventCallback()
		self.event_callback.registerCallback(pygame.QUIT, quit)
		self.crosshair = None
		self.loaded = False
		self.ch_img = ch_img
		self.obj_self = obj_self
		self.function = function
		self.running = False
		self.enable_fraping = enable_fraping
Example #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()
Example #3
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()
Example #4
0
 def __init__(self,
              scrw,
              scrh,
              function,
              obj_self,
              enable_fraping,
              ch_img=None,
              my_id=-1):
     utils.patch_copy_reg()
     self.my_id = my_id
     self.screen = pygame.display.set_mode((scrw, scrh))
     camera.setScreen()
     self.event_callback = EventCallback()
     self.event_callback.registerCallback(pygame.QUIT, quit)
     self.crosshair = None
     self.loaded = False
     self.ch_img = ch_img
     self.obj_self = obj_self
     self.function = function
     self.running = False
     self.enable_fraping = enable_fraping
Example #5
0
from player import *
from board import *
from camera import camera
from eventcallback import *
from keyboardcontroller import *
from crosshair import *
import sys


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)
Example #6
0
from player import *
from board import *
from camera import camera
from eventcallback import *
from keyboardcontroller import *
from crosshair import *
import sys


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)