RhythmGame/Receptors.gd

30 lines
1.2 KiB
GDScript3
Raw Normal View History

2019-11-10 15:09:14 +10:30
extends "res://main.gd"
var ring_px := 4
var receptor_px := 24
var shadow_px := 5
var shadow_color := Color.black
2019-11-18 13:11:02 +10:30
var center := Vector2(0.0, 0.0)
2019-11-10 15:09:14 +10:30
func _draw():
# Screen filter
draw_rect(Rect2(-screen_height/2, -screen_height/2, screen_height, screen_height), GameTheme.screen_filter)
2019-11-10 15:09:14 +10:30
# Receptor ring
var receptor_circle := arc_point_list(center, GameTheme.receptor_ring_radius, 0.0, 360.0, 360)
var receptor_centers := arc_point_list(center, GameTheme.receptor_ring_radius, Rules.FIRST_COLUMN_ANGLE_DEG, Rules.FIRST_COLUMN_ANGLE_DEG+360.0-Rules.COLS_ANGLE_DEG, Rules.COLS)
2019-11-10 15:09:14 +10:30
# Shadows
for i in range(len(receptor_circle)-1):
draw_line(receptor_circle[i], receptor_circle[i+1], shadow_color, ring_px + shadow_px, true)
for i in range(len(receptor_centers)):
draw_circle(receptor_centers[i], (receptor_px + shadow_px)/2, shadow_color)
# Foregrounds
for i in range(len(receptor_circle)-1):
draw_line(receptor_circle[i], receptor_circle[i+1], GameTheme.receptor_color, ring_px, true)
2019-11-10 15:09:14 +10:30
for i in range(len(receptor_centers)):
draw_circle(receptor_centers[i], receptor_px/2, GameTheme.receptor_color)
func _ready():
GameTheme.connect("screen_filter_changed", self, "update")