-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathframe_class.py
More file actions
30 lines (25 loc) · 976 Bytes
/
frame_class.py
File metadata and controls
30 lines (25 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import pygame
from variables import *
from text_writer import *
import math
class BeatLine():
def __init__(self,cur_beat_time,given_fps,show_beat = False):
self.name = 'beat line'
self.y = node_spawning_y_pos
self.cur_beat_time = cur_beat_time
self.show_beat = show_beat
self.color = (80,80,80)
self.width = 2
self.given_fps = given_fps
def draw(self,screen):
if self.show_beat:
write_text(screen, width//2, self.y-small_text, '%s'%self.cur_beat_time, small_text, background_color[0], self.color)
pygame.draw.line(screen, judgement_line_color, [0, self.y],
[width, self.y], self.width)
def move(self,speed):
self.y += (speed*10/self.given_fps)
def check_border(self,beat_list):
if self.y >= height: # then node arrived at the border!
beat_list.remove(self)
else:
pass