示例#1
0
文件: player.py 项目: ackwell/PyPunk
	def move(self):
		if Input.check(Key.RIGHT):
			self.x += self.speed * PP.elapsed
		if Input.check(Key.LEFT):
			self.x -= self.speed * PP.elapsed
		if Input.check(Key.DOWN):
			self.y += self.speed * PP.elapsed
		if Input.check(Key.UP):
			self.y -= self.speed * PP.elapsed 
示例#2
0
文件: test.py 项目: ackwell/PyPunk
	def update(self):
		self._time_interval += PP.elapsed
		if self._time_interval >= 3:
			self.graphic.play('Blinking')

		if Input.check('LEFT'):
			self.x -= 50 * PP.elapsed
		if Input.check('RIGHT'):
			self.x += 50 * PP.elapsed
		if Input.check('UP'):
			self.y -= 50 * PP.elapsed
		if Input.check('DOWN'):
			self.y += 50 * PP.elapsed
示例#3
0
文件: main.py 项目: ackwell/PyPunk
	def update(self):
		# Update the score text to reflect the current score
		self.score_text.text = str(self.score)

		# Restart the game if they died and press enter.
		if self._game_over and Input.check(Key.RETURN):
			PP.world = GameRoom()