def __init__(self, timer, length, height): PyGameScene.__init__(self, timer, length, height) self.borders = [] self.borders.append( Segment(Vertex(BORDER_SIZE, BORDER_SIZE), Vertex(length - BORDER_SIZE, BORDER_SIZE))) # Top self.borders.append( Segment(Vertex(length - BORDER_SIZE, BORDER_SIZE), Vertex(length - BORDER_SIZE, height - BORDER_SIZE))) # Right self.borders.append( Segment(Vertex(BORDER_SIZE, height - BORDER_SIZE), Vertex(length - BORDER_SIZE, height - BORDER_SIZE))) # Bottom self.borders.append( Segment(Vertex(BORDER_SIZE, BORDER_SIZE), Vertex(BORDER_SIZE, height - BORDER_SIZE))) # Left self.previewColor = (127, 127, 127) self.segmentColor = (0, 0, 127) # Track the four vertices/vectors comprising of the line segments AC and BD. self.capturePosition = False self.A = None self.AC = None # Indicate a 'mode' for checking for intersection between the line segments. self.checking = False self.derivativesColor = (127, 127, 0) self.intersectionColor = (255, 127, 127)
def __init__(self, timer, length, height, algorithm, data): PyGameScene.__init__(self, timer, length, height) resolution = Milli() Intervaled.__init__(self, 1 / (resolution.scalor * 120), resolution) self.origin = Vertex(length / 2, height / 2) self.radius = min(*self.origin.components) * 0.80 self.algorithm = algorithm self.reset(data)
def __init__(self, timer, length, height): PyGameScene.__init__(self, timer, length, height) Gravitational.__init__( self, 10, Vertex(DEMO_WINDOW_LENGTH / 2, DEMO_WINDOW_HEIGHT << 4)) self.ball = Ball( 32, Vertex(DEMO_WINDOW_LENGTH / 3, DEMO_WINDOW_HEIGHT / 3), Vector(BALL_VELOCITY, BALL_VELOCITY)) self.wind = Wind(0.125) self.addEntity(self.ball)
def __init__(self, timer, length, height, continuous=False): PyGameScene.__init__(self, timer, length, height) # Start a new clock at the current local time. instant = datetime.now() self.clock = Clock(instant.hour, instant.minute, instant.second) self.addEntity(self.clock) # Tap into the Temporal entity updating. # Use the center of the view as the origin of the clock face. self.origin = Vertex(length / 2, height / 2) # Track request for continuous mode or not. self.continuous = continuous
def __init__(self, timer, length, height, continuous=False): PyGameScene.__init__(self, timer, length, height) self.origin = Vertex(length / 2, height / 2) self.borders = list() self.borders.append(Segment(Vertex(BORDER_SIZE, BORDER_SIZE), Vertex(length - BORDER_SIZE, BORDER_SIZE))) # Top self.borders.append(Segment(Vertex(length - BORDER_SIZE, BORDER_SIZE), Vertex(length - BORDER_SIZE, height - BORDER_SIZE))) # Right self.borders.append(Segment(Vertex(BORDER_SIZE, height - BORDER_SIZE), Vertex(length - BORDER_SIZE, height - BORDER_SIZE))) # Bottom self.borders.append(Segment(Vertex(BORDER_SIZE, BORDER_SIZE), Vertex(BORDER_SIZE, height - BORDER_SIZE))) # Left # Ensure the radar beam can reach the corners of the screen. self.radar = Radar(self.origin) self.addEntity(self.radar) # Tap into the Temporal entity updating.
def __init__(self, timer, length, height): PyGameScene.__init__(self, timer, length, height) self.previewColor = (127, 127, 127) self.segmentColor = (0, 0, 127) # Track the four vertices/vectors comprising of the line segments AC and BD. self.capturePosition = False self.A = None self.AC = None self.B = None self.BD = None # Indicate a 'mode' for checking for intersection between the line segments. self.checking = False self.derivativesColor = (127, 127, 0) self.intersectionColor = (255, 127, 127)
def __init__(self, timer, length, height): PyGameScene.__init__(self, timer, length, height)
def __init__(self, timer, length, height): PyGameScene.__init__(self, timer, length, height) self.emitting = False self.wiping = True self.rays = list()
def __init__(self, timer, length, height, cameraLens): PyGameScene.__init__(self, timer, length, height) self.enlightening = False self.cameraLens = cameraLens self.wiping = False