Пример #1
0
class mainApplication(ApplicationBase):
	"""
	mainApplication Class
	The game it's self. Starts everything.
	"""
	def __init__(self):
		super(mainApplication,self).__init__()
		
		# Start a new instance of a World object
		self._world = world.World(self, self.engine, TDS)
		
		# Start a new listener object
		self._listener = ApplicationListener(self.engine, self._world)
		
		# Load GUI
		self._world._loadGui('LOAD', 'loading-1', False)
		self._world._loadGui('HUD', 'hud', False)
		self._world._loadGui('MAIN', 'menu', False)
		self._world._loadGui('SETTINGS', 'settings', False)
		self._world._loadGui('ABOUT', 'about', False)
		
		
		
		# TODO: Add loading a map based on the settings file.
		# Load a map
		self._world._loadMap('maps/zsc-test-6.xml', 'MENU')
		
		self._world._sounds._loadClip("beep", "sounds/beep.ogg", False, False)
		
		#self._world._sounds._loadClip('ambient', 'music/forestAmbient1.ogg', True, False)
		#self._world._sounds._startClip('ambient', True)
		
		self._testsound = ThreePartMusic('music/other/title/start.ogg', 'music/other/title/loop.ogg', 'music/other/title/end.ogg', True, self._world._soundmanager)
		self._testsound._start()
		

	def createListener(self):
		pass # already created in constructor

	def _pump(self):
		"""
		_pump Function
		Overwrites the default _pump function and is executed every frame.
		"""
		# Check to see if anything tried to quit
		if self._listener._quit or self._world._quit:
			self.breakRequested = True
		
		self._world._mouseMoved = False
		
		self._world._eventtracker._evaluateEvents()
		self._world._sounds._fade()
		self._world.cameraDrift()
		
		if not self._world._mouseMoved:
			self._world.mouseMoved(None, True, self.engine.getCursor())
Пример #2
0
	def __init__(self):
		super(mainApplication,self).__init__()
		
		# Start a new instance of a World object
		self._world = world.World(self, self.engine, TDS)
		
		# Start a new listener object
		self._listener = ApplicationListener(self.engine, self._world)
		
		# Load GUI
		self._world._loadGui('LOAD', 'loading-1', False)
		self._world._loadGui('HUD', 'hud', False)
		self._world._loadGui('MAIN', 'menu', False)
		self._world._loadGui('SETTINGS', 'settings', False)
		self._world._loadGui('ABOUT', 'about', False)
		
		
		
		# TODO: Add loading a map based on the settings file.
		# Load a map
		self._world._loadMap('maps/zsc-test-6.xml', 'MENU')
		
		self._world._sounds._loadClip("beep", "sounds/beep.ogg", False, False)
		
		#self._world._sounds._loadClip('ambient', 'music/forestAmbient1.ogg', True, False)
		#self._world._sounds._startClip('ambient', True)
		
		self._testsound = ThreePartMusic('music/other/title/start.ogg', 'music/other/title/loop.ogg', 'music/other/title/end.ogg', True, self._world._soundmanager)
		self._testsound._start()