Ejemplo n.º 1
0
	def special_atk(self, screen):
		"""
		Spawns players at one side of map and himself at the other then
		creates waves of fire missles that must be dodged by the players.

		"""
		if not self.special_casting:
			engine.spawn_players(self.unit_roster.get("Players"))
			self.xpos = 750
			self.ypos = 450
			self.special_casting = 1
			self.special_cast_time = pygame.time.get_ticks()
			self.special_missles_box = []
			for j in range(len(self.temp_wave)):
				for i in range(len(self.temp_wave[j])):
					self.special_missles_box.append(self.FireMissle(self.unit_roster, 900+(j*300), self.temp_wave[j][i]))

		else:
			Animation(screen, self, 0,0, self.anim_standing, 1).animate()

			for missle in self.special_missles_box:
				Animation(screen, missle , 0,0, self.special_atk1, 10).animate()
				missle.move_left()

			#check for dmgs.
			for unit in self.unit_roster.get("Players"):
				if engine.detect_collision(unit, self.special_missles_box, 0, 0):
					unit.lose_health(self.special_dmg)

			if pygame.time.get_ticks() > self.special_cast_time + 20000:
				self.special_casting = 0
				self.special_offset = 0
				self.attack_status = "none"
Ejemplo n.º 2
0
	def queue_special(self):
		self.attack_status = "special"
		engine.spawn_players(self.unit_roster.get("Players"))
		self.xpos = 750
		self.ypos = 450
		self.special_casting = 1
		self.special_cast_time = pygame.time.get_ticks()
		self.special_missles_box = []
		for j in range(len(self.temp_wave)):
			for i in range(len(self.temp_wave[j])):
				self.special_missles_box.append(self.FireMissle(self.unit_roster, 900+(j*300), self.temp_wave[j][i]))