def draw(self): self.drawlasttime = time.time() self.scr.fill((255, 255, 255)) acomplex.atriangle(self.scr, (0, 255, 0), [self.x, self.y], 15, self.rot - 90, usecenter=1) self.drawnowtime = time.time() self.loopnow = self.drawnowtime fps.calcfps(self) self.looplast = time.time() if self.debug - 1: fps.printfps(self) if self.debugall - 1: fps.printall(self) p.display.flip()
def run(): global x, exit exit = 0 while not exit: for e in pg.event.get(): if e.type == pg.QUIT: exit = True window.fill((100, 100, 100)) x += 1 x %= 360 acomplex.arrect(window, (255, 0, 255, 100), [10, 10, 100, 100], x / 10) acomplex.acurve(window, (0, 0, 0, 100), [200, 200], 199, x, x + 180, lnwidth=5) acomplex.atriangle(window, (0, 255, 255, 150), [150, 150], 40, x, usecenter=1) acomplex.atriangle(window, (255, 255, 255, 150), [200, 150], 20, x, usecenter=0) acomplex.avector(window, (255, 255, 255, 150), [200, 150], x, x, 3) acomplex.avector(window, (255, 255, 0, 150), [300, 300], x, x, 1) acomplex.aregpolygon(window, (255, 255, 255, 100), [300, 300], 50, 7, x) acomplex.aregstar(window, (255, 255, 255, 150), [250, 400], 50, 9, 45, 2) acomplex.areggramm(window, (255, 255, 255, 150), [100, 300], 80, 8, 18) pg.display.update() c.tick(40)
def run(): global x, exit exit = 0 while not exit: for e in pg.event.get(): if e.type == pg.QUIT: exit = True window.fill((100, 100, 100)) x += 1 x %= 360 acomplex.arrect(window, (255, 0, 255, 100), [ 10, 10, 100, 100 ], x / 10) acomplex.acurve(window, (0, 0, 0, 100), [200, 200], 199, x, x + 180, lnwidth=5) acomplex.atriangle(window, (0, 255, 255, 150), [150, 150], 40, x, usecenter=1) acomplex.atriangle(window, (255, 255, 255, 150), [200, 150], 20, x, usecenter=0) acomplex.avector(window, (255, 255, 255, 150), [200, 150], x, x, 3) acomplex.avector(window, (255, 255, 0, 150), [300, 300], x, x, 1) acomplex.aregpolygon(window, (255, 255, 255, 100), [300, 300], 50, 7, x) acomplex.aregstar(window, (255, 255, 255, 150), [250, 400], 50, 9, 45, 2) acomplex.areggramm(window, (255, 255, 255, 150), [100, 300], 80, 8, 18) pg.display.update() c.tick(40)
def draw( self ): self.drawlasttime = time.time( ) self.scr.fill( ( 255, 255, 255 ) ) acomplex.atriangle( self.scr, ( 0, 255, 0 ), [ self.x, self.y ], 15, self.rot - 90, usecenter=1 ) self.drawnowtime = time.time( ) self.loopnow = self.drawnowtime fps.calcfps( self ) self.looplast = time.time( ) if self.debug - 1: fps.printfps( self ) if self.debugall - 1: fps.printall( self ) p.display.flip( )