Ejemplo n.º 1
0
	def wave_loading(self, param1):
		log.info("Starting Wave {} Loading ...".format(param1))
		self.clear_all_objects()

		banner = Banner("Wave {} Loading ...".format(param1), GameBase.get_font_normal(), 
		color=invaderutils.COLOR_WHITE, pos=(250,325))
		GameObjectKeeper.setup(banner, 1000)
Ejemplo n.º 2
0
	def wave_winner(self, parm1):
		log.info("WINNER")
		self.clear_all_objects()

		banner = Banner("Winner!", GameBase.get_font_normal(), 
		color=invaderutils.COLOR_WHITE, pos=(250,325))
		GameObjectKeeper.setup(banner, 1000)
		self.set_game_mode(invaderutils.GAME_END_EVENT)
Ejemplo n.º 3
0
	def _wave_basics(self):
		self.clear_all_objects()

		# Setup Banners for User
		
		banner = Banner("SCORE", GameBase.get_font_normal(), color=invaderutils.COLOR_WHITE, pos=(0, 10))
		GameObjectKeeper.setup(banner, 1000)

		myscoreboard = Score( 0, 35, GameBase.get_font_normal(), invaderutils.COLOR_YELLOW)
		GameObjectKeeper.setup(myscoreboard, 1000, name = "myscoreboard")

		banner = Banner("HIGH SCORE", GameBase.get_font_normal(), color=invaderutils.COLOR_WHITE, pos=(300, 10))
		GameObjectKeeper.setup(banner, 1000)

		banner = Banner("{0:010}".format(GameMachine.highscorestore.get_highscore()), 
		GameBase.get_font_normal(),  pos=(300, 35), color=invaderutils.COLOR_YELLOW)
		GameObjectKeeper.setup(banner, 1000)

		GameMachine.highscorestore.get_highscore()

		# setup the stars
		for star in invaderutils.star_field(20):
			GameObjectKeeper.setupmisc(star, 25)

		# setup hero
		GameObjectKeeper.setupfriendly(Hero(100, 710, invaderutils.hero_png(), mis_steps=75, steps=3, move_steps=2), 50)
Ejemplo n.º 4
0
	def collide_action(self, friend, enemy):
		""" TODO: really don't like this routine here.  """
		log.debug("COLLIDED: {0} {1}".format(type(friend),type(enemy)))
		Thump()

		friend.terminate()
		enemy.terminate()

		explosion = AutoMovingAnimatedSprite(enemy.x, enemy.y,invaderutils.explosion_png(), movex=0, movey=-1, msteps=1)
		if (isinstance(friend, Hero)):
			explosion = AutoMovingAnimatedSprite(friend.x, friend.y, invaderutils.hero_explosion_png(), movex=0, movey=-1, msteps=1)
		elif (not isinstance(enemy, Enemy)):
			explosion = AutoMovingAnimatedSprite(enemy.x, enemy.y, invaderutils.missile_explosion_png(), movex=0, movey=-1, msteps=1)

		GameObjectKeeper.setup(explosion, 35)
		
		# add to score 
		if (not isinstance(friend, Hero)):
			myscoreboard = GameObjectKeeper.get_by_name("myscoreboard")
			myscoreboard.addscore(enemy.get_bonus())
			self.highscorestore.set_highscore(myscoreboard.getscore())