def recolor(self, hour, minute): h, m = hour, minute if self.dawn <= h < self.noon_start: start = "night" finish = "day" minutes = ((h - self.dawn) * 60) + m lerp_val = (minutes / ((self.noon_start - self.dawn) * 60)) % 1. elif self.noon_start <= h < self.noon_end: start = "day" finish = "day" lerp_val = 0 elif self.noon_end <= h < self.midnight_start: start = "day" finish = "night" minutes = ((h - self.noon_end) * 60) + m lerp_val = minutes / ((self.midnight_start - self.noon_end) * 60) elif (self.midnight_start <= h <= 24) or (0 <= h < self.dawn): start = "night" finish = "night" lerp_val = 0 self.sky = tools.lerp(self.colors[start]["sky"], self.colors[finish]["sky"], lerp_val) self.grass = tools.lerp(self.colors[start]["grass"], self.colors[finish]["grass"], lerp_val) for tree in self.trees: color = tools.lerp(self.colors[start][tree.name], self.colors[finish][tree.name], lerp_val) tree.recolor(color)
# print(str(selected)) if oldDownPressed == 0 and downPressed != 0: selected += 1 changeSong = True # print(str(selected)) if oldEnterPressed == 0 and enterPressed != 0: song = songsList[selected] GameDisplayLauncher.clear() GameDisplayLauncher.destroy() pygame.quit() subprocess.call(["python", "OsuPi.py", song.folder]) selected = clamp(selected, 0, len(songsList) - 1) for i in range(len(songObjectList)): songObjectList[i].position(0, lerp(songObjectList[i].y(), ((i - selected - 1) * -90) - 140, 0.5), 3.0) songObjectList[i].draw() texty = lerp(texty, targety, 0.5) # MenuString.position(0, texty - 40, 3.0) # MenuString.draw() # MenuString.quick_change(str(songsString)) if not FlippedScreenFake: FakeScreen.blit(bg, (0, 0, 1920, 1080)) FlippedScreenFake = True pygame.display.flip()
x_catcher = clamp(x_catcher, GameEdgeXLeft, GameEdgeXRight) catcher.position(x_catcher, y_catcher, 4.0) catcherFlipped.position(x_catcher, y_catcher, 4.0) if(catcherFlopped == 1): catcherFlipped.draw() else: catcher.draw() # Lerpa o score pra dar aquele $wang score_lerp = int(math.ceil(lerp(score_lerp, score_count, 0.2))) score_text = str(score_lerp).zfill(10) ComboString.position(x_catcher, 0, 4.0) ComboString.draw() ScoreString.draw() AccuracyString.draw() ComboString.quick_change(str(combo_text)) ScoreString.quick_change(str(score_text)) AccuracyString.quick_change(str(accuracy_text)) # TIMER INTERPOLATION count += 1 timer = FrameTick.tick()