Ejemplo n.º 1
0
 def updateVelAndIntrvl(self):
     # TODO: adjast the coefs
     dif = (Score.getScore()//100)
     vel_x = self.INIT_VELOCITY_X - dif
     self.velocity = Vec(vel_x, 0)
     self.MIN_INTERVAL = 85 + 15*dif
     self.MAX_INTERVAL = 150 + 15*dif
Ejemplo n.º 2
0
    def draw(self):
        global WINDOW_HEIGHT, WINDOW_WIDTH, DEBUG
        pyxel.cls(ColPal.gray_dark)
        self.backgnd.blt()
        self.enemy.blt()
        self.player.blt()

        # show score
        pyxel.text(WINDOW_WIDTH - 50, 5,
                   "HI {}  {}".format(Score.getHighScore(),
                                      Score.getScore()), ColPal.white)
        # if gameover, show restart button
        if Player.getState() == "IDLE":
            pyxel.text(WINDOW_WIDTH // 2 - 5, WINDOW_HEIGHT // 2 - 5,
                       "GAME OVER\n[SPACE] TO CONTINUE", ColPal.white)
            pyxel.blt(WINDOW_WIDTH // 2 - 48, WINDOW_HEIGHT // 2 - 16,
                      App.IMG_ID, *App.BTN_RESTART.getRect())

        if DEBUG:
            pyxel.text(0, 20, "Frame: {}".format(pyxel.frame_count),
                       ColPal.orange)
Ejemplo n.º 3
0
 def updateVel(self):
     # TODO: adjast the coefs
     dif = (Score.getScore()//100)
     vel_x = self.INIT_VELOCITY_X - dif
     self.velocity = Vec(vel_x, 0)