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
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
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()