Example #1
0
File: fish.py Project: fanlix/fish
    def die(self):
	if self.last_player >= 0:
		import gmap
		p = gmap.players[self.last_player]
		p.score += self.cash
		res.play_sound(res.MUSIC_COIN)
	self.kill()
Example #2
0
File: fish.py Project: fanlix/fish
    def update(self, past):
	self._past += past
	self._frame = (self._past / self.rate) % self.frame_count
	if self._frame == 0 and self._past >= LARGE:
		self._past = 0
        self.image = self.get_frame_image(self._frame)

	if self.action == "move" and self.life <= 0:
		self.change_action("act")
		res.play_sound(res.MUSIC_DIE)
		self._dietime = self._past
	elif self.action == "act" and self._past - self._dietime >= 500:
		self.die()
Example #3
0
	def fire(self, direction=None):
		if self.action == "fire":
			# last bullet not finished
			return
		if not direction:
			direction = self.direction

		price = int(self.power * PRICE)
		if self.cash < price :
			return
		self.cash -= price

		bu = Bullet(self.pid, self.bullet_pos, direction, self.power)
		self.change_action("fire")
		self.fire_time = 0
		res.play_sound(res.MUSIC_SHOOT)