Ejemplo n.º 1
0
def on_draw():
    global yrot
    win.clear()
    glLoadIdentity()
    glTranslatef(0, 0, -100)
    glRotatef(yrot, 0.0, 1.0, 0.0)
    default_system.draw()
    '''
Ejemplo n.º 2
0
def on_draw():
	global yrot
	win.clear()
	glLoadIdentity()
	glTranslatef(0, 0, -100)
	glRotatef(yrot, 0.0, 1.0, 0.0)
	default_system.draw()
	'''
Ejemplo n.º 3
0
    def on_draw(self):
        self.clear()
        self.background_batch.draw()
        glLoadIdentity()

        if DEBUG:
            self.space.debug_draw(self.debug_draw_options)

        self.foreground_batch.draw()
        self.hud_batch.draw()
        default_system.draw()
Ejemplo n.º 4
0
    def on_draw():
        glEnable(GL_BLEND)
        glShadeModel(GL_SMOOTH)
        glBlendFunc(GL_SRC_ALPHA,GL_ONE)
        glDisable(GL_DEPTH_TEST)

        # glClearColor(1,1,1,1)
        glClearColor(1,0,0,1)
        window.clear()
        glLoadIdentity()
        default_system.draw()
        # player.get_texture().blit(100, 200,width=400,height=300)
        console.draw()
Ejemplo n.º 5
0
def on_draw():
    global t, d, approach, rot
    win.clear()
    glLoadIdentity()
    glTranslatef(0, 0, -950)
    label.draw()
    glLoadIdentity()
    t += rot
    rot = rot * 0.995
    d += approach
    approach *= 0.9924
    glTranslatef(0, 0, min(d, -4.1))
    glRotatef(t, -1, -1, -1)
    default_system.draw()
Ejemplo n.º 6
0
def on_draw():
	global t, d, approach, rot
	win.clear()
	glLoadIdentity()
	glTranslatef(0, 0, -950)
	label.draw()
	glLoadIdentity()
	t += rot
	rot = rot * 0.995
	d += approach
	approach *= 0.9924
	glTranslatef(0, 0, min(d, -4.1))
	glRotatef(t, -1, -1, -1)
	default_system.draw()
Ejemplo n.º 7
0
def on_draw():
    global inBattle
    if inBattle:
        global i
        global yrot, xrot, ztra
        global camera
        win.clear()
        if cameraOn:
            camera.setPosition(xtra, ytra, ztra)
            camera.focus(win.width, win.height, xtra, ytra, ztra)
            glRotatef(yrot, 0.0, 1.0, 0.0)
            glRotatef(xrot, 1.0, 0.0, 0.0)
        else:  # Moves the world around the camera
            glLoadIdentity()
            glTranslatef(xtra, ytra, ztra)
            glRotatef(yrot, 0.0, 1.0, 0.0)
            glRotatef(xrot, 1.0, 0.0, 0.0)
    default_system.draw()
Ejemplo n.º 8
0
def on_draw():
    world.window.clear()

    #render your bg here if you want to see the shapes
    #world.bgimage.blit(0,0)
    
    for obj in world.map_objects:
        obj.render()
    
    world.bgimage.blit(0,0)
    
    for n, obj in world.players.items():
        obj.render()

    world.displayScore()

    glLoadIdentity()
    default_system.draw()
    fps_display.draw()
Ejemplo n.º 9
0
def on_draw():
	win.clear()
	glLoadIdentity()
	default_system.draw()
Ejemplo n.º 10
0
def on_draw():
    win.clear()
    glLoadIdentity()
    default_system.draw()
Ejemplo n.º 11
0
		template=Particle(position=(width/2, height-50, 0)),
		deviation=Particle(
			velocity=(5, 15, 0),
			size=(5, 5, 0)),
		position=[((width*i/4), height, 0) for i in range(5)]
	)

	bubble = pygame.image.load(os.path.join(os.path.dirname(__file__), 'bubble.png'))
	
	water = ParticleGroup(controllers=[bubbler], 
		renderer=BlitRenderer(display, bubble, rotate_and_scale=True))
	
	default_system.add_global_controller(
		Lifetime(7),
		Gravity((0,-30,0)), 
		Movement(), 
		Growth(4.5),
		#Fader(fade_in_end=5.0, max_alpha=0.005, fade_out_start=17, fade_out_end=20),
	)

	while 1:
		for event in pygame.event.get():
			if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE):
				raise SystemExit
		ms = clock.tick()
		default_system.update(ms / 1000.0)
		display.fill((0, 0, 0))
		default_system.draw()
		pygame.display.flip()

Ejemplo n.º 12
0
                                               size=(5, 5, 0)),
                            position=[((width * i / 4), height, 0)
                                      for i in range(5)])

    bubble = pygame.image.load(
        os.path.join(os.path.dirname(__file__), 'bubble.png'))

    water = ParticleGroup(controllers=[bubbler],
                          renderer=BlitRenderer(display,
                                                bubble,
                                                rotate_and_scale=True))

    default_system.add_global_controller(
        Lifetime(7),
        Gravity((0, -30, 0)),
        Movement(),
        Growth(4.5),
        #Fader(fade_in_end=5.0, max_alpha=0.005, fade_out_start=17, fade_out_end=20),
    )

    while 1:
        for event in pygame.event.get():
            if event.type == QUIT or (event.type == KEYDOWN
                                      and event.key == K_ESCAPE):
                raise SystemExit
        ms = clock.tick()
        default_system.update(ms / 1000.0)
        display.fill((0, 0, 0))
        default_system.draw()
        pygame.display.flip()
Ejemplo n.º 13
0
def on_draw():
	win.clear()
	glLoadIdentity()
	glTranslatef(0, 0, -50)
	default_system.draw()
Ejemplo n.º 14
0
def on_draw():
    win.clear()
    glLoadIdentity()
    glTranslatef(0, 0, -50)
    default_system.draw()