screen = pygame.display.set_mode((width, height)) white = (255, 255, 255) screen.fill((white)) running = True sc = Screen(width, height) clock = pygame.time.Clock() camera = Camera(None, 0, 0, -100, width / 2, height / 2) engine = Engine(sc, camera, Light(1, 1, 1)) camera.engine = engine engine.addComponent(Axis(engine, 1000)) #nastavenim hodnoty promenne col se zviditelni hranicni kostky col = (145, 20, 200) #engine.addComponent(Cube(engine, -50,0,0,30,col)) #engine.addComponent(Cube(engine, 50,0,0,30,col)) engine.addComponent(Cube(engine, 0, -50, 0, 30, col)) #engine.addComponent(Cube(engine, 0,50,0,30,col)) engine.addComponent(Pyramid(engine, 0, 20, 0, 1, 1, "rainbow", True)) for i in range(0, 10): #cb = DuhovyBoxik(engine,i*3-10,20,0,1,"rainbow", True) cb = Creature(engine, 0, i * 6 + 40, 0, (255, 0, 255)) engine.addComponent(cb) for face in cb.mesh.Faces: face.rFaze = random.randrange(0, 8)
screen = pygame.display.set_mode((width, height)) color = (255, 255, 255) screen.fill((color)) running = True sc = Screen(width, height, color) clock = pygame.time.Clock() camera = Camera(None, 0, 0, -20, width / 2, height / 2) engine = Engine(sc, camera, Light(1, 1, 1)) camera.engine = engine engine.addComponent(Axis(engine, 1000)) #cube = Cube(engine, 0, 0, 0, 1, "rainbow", False) engine.addComponent(Cube(engine, 0, 0, 0, 1, "rainbow", False)) #K - pyramida poskoci nahoru #L - pyramida poskoci "doprava" #J - pyramida poskoci "doleva" engine.addComponent(Pyramid(engine, 0, 10, 0, 1, -1, (255, 0, 0), True)) engine.addComponent(Cube(engine, 0, -20, 0, 10, (255, 255, 255), False)) while running: tm = time.time() try: engine.Update() engine.Draw()
color = (255, 0, 120) screen.fill((color)) running = True sc = Screen(width, height, color) clock = pygame.time.Clock() camera = Camera(None, 0, 0, -20, width / 2, height / 2) engine = Engine(sc, camera, Light(1, 1, 1)) camera.engine = engine cube = Cube(engine, 0, -5, 0, 1, "rainbow", False) engine.addComponent(cube) bc = Image.open("Snejky\\background_test.png") pixels = bc.convert("RGB").load() mk = MakeVideo() up = True frameNumber = 0 fps = 60 seconds = 1 finalFrameNumber = seconds * fps times = 0 tim = time.time()
screen = pygame.display.set_mode((width, height)) color = (255, 255, 255) screen.fill((color)) running = True sc = Screen(width, height, color) clock = pygame.time.Clock() camera = Camera(None, 0, 0, -50, width / 2, height / 2) engine = Engine(sc, camera, Light(1, 1, 1)) camera.engine = engine engine.addComponent(Axis(engine, 1000)) #engine.addComponent(Cube(engine, 0, 0, 0, 1, "rainbow", False)) for x in range(-10, 10): for y in range(-10, 10): z = x + y engine.addComponent(Cube(engine, x, z, y, 0.5, (255, 0, 0), False)) while running: tm = time.time() try: engine.Update() engine.Draw() except Exception as e:
white = (255, 255, 255) screen.fill(white) running = True sc = Screen(width, height, (179, 229, 252)) clock = pygame.time.Clock() camera = Camera(None, 0, 0, -400, width / 2, height / 2) engine = Engine(sc, camera, Light(1, 1, 1)) camera.engine = engine #engine.addComponent(Axis(engine, 1000)) #cube = Cube(engine, 0, 0, 0, 1, "rainbow", False) """engine.addComponent(DuhovyBoxik(engine, 0,0,0,1,"rainbow", True)) engine.addComponent(DuhovyBoxik(engine, 10,0,0,1,"rainbow", True)) engine.addComponent(DuhovyBoxik(engine, -20,10,0,1,"rainbow", True))""" col = None #(145,20,200) engine.addComponent(Cube(engine, -600, 0, 0, 300, col)) engine.addComponent(Cube(engine, 600, 0, 0, 300, col)) engine.addComponent(Cube(engine, 0, -400, 0, 300, (104, 159, 56))) engine.addComponent(Cube(engine, 0, 0, -600, 300, col)) engine.addComponent(Cube(engine, 0, 0, 600, 300, col)) engine.addComponent(Creature(engine, -20, 10, 0, "rainbow")) fps = 0 ticks = 0 while running: