MCPcopy Create free account
hub / github.com/brain-workshop/brainworkshop / __init__

Method __init__

brainworkshop.py:2670–2710  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2668# Circles is the 3-strikes indicator in the top left corner of the screen.
2669class Circles:
2670 def __init__(self):
2671 self.y = from_top_edge(20)
2672 self.start_x = from_left_edge(30)
2673 self.radius = scale_to_width(8)
2674 self.distance = scale_to_width(20)
2675 if cfg.BLACK_BACKGROUND:
2676 self.not_activated = [64, 64, 64, 255]
2677 else:
2678 self.not_activated = [192, 192, 192, 255]
2679 self.activated = [64, 64, 255, 255]
2680 if cfg.BLACK_BACKGROUND:
2681 self.invisible = [0, 0, 0, 0]
2682 else:
2683 self.invisible = [255, 255, 255, 0]
2684
2685 self.circle = []
2686 for index in range(0, cfg.THRESHOLD_FALLBACK_SESSIONS - 1):
2687 if have_shapes:
2688 self.circle.append([pyglet.shapes.Rectangle(self.start_x + self.distance * index - self.radius,
2689 self.y + self.radius,
2690 self.start_x + self.distance * index + self.radius,
2691 self.y + self.radius,
2692 color=self.not_activated[:3], batch=batch),
2693 pyglet.shapes.Rectangle(self.start_x + self.distance * index + self.radius,
2694 self.y - self.radius,
2695 self.start_x + self.distance * index - self.radius,
2696 self.y - self.radius,
2697 color=self.not_activated[:3], batch=batch)])
2698 else:
2699 self.circle.append(batch.add(4, pyglet.gl.GL_QUADS, None, ('v2i', (
2700 self.start_x + self.distance * index - self.radius,
2701 self.y + self.radius,
2702 self.start_x + self.distance * index + self.radius,
2703 self.y + self.radius,
2704 self.start_x + self.distance * index + self.radius,
2705 self.y - self.radius,
2706 self.start_x + self.distance * index - self.radius,
2707 self.y - self.radius)),
2708 ('c4B', self.not_activated * 4)))
2709
2710 self.update()
2711
2712 def update(self):
2713 if mode.manual or mode.started or cfg.JAEGGI_MODE:

Callers

nothing calls this directly

Calls 4

updateMethod · 0.95
from_top_edgeFunction · 0.85
from_left_edgeFunction · 0.85
scale_to_widthFunction · 0.85

Tested by

no test coverage detected