def __init__(self, motor, ancho, alto, titulo, fps=60, gravedad=(0, -90), pantalla_completa=False): self.motor = motor self.motor.iniciar_ventana(ancho, alto, titulo, pantalla_completa) self.tweener = pytweener.Tweener() self.tareas = tareas.Tareas() self.control = control.Control() self.colisiones = colisiones.Colisiones() self.camara = camara.Camara(self) eventos.actualizar.conectar(self.actualizar_simuladores) try: self.fisica = fisica.Fisica(motor.obtener_area(), gravedad=gravedad) except Exception as e: print e print "ERROR: Se deshabilita la funcionalidad de Fisica." self.fisica = fisica.FisicaDeshabilitada() self.escena_actual = None
def __init__(self): self.image, self.rect = utils.load_images("mainmenu/title.png") self.rect.right = 0 self.tweener = pytweener.Tweener() self.x = -self.rect.width self.tweener.addTween(self, x=200, tweenTime=1, tweenType=pytweener.Easing.Elastic.easeOut)
def __init__(self, start_y, item_height, initial_selected): self.image, self.rect = utils.load_images("cursor.png") self.rect.centerx = 320 self.start_y = start_y self.y = 0 self.item_height = item_height self.tweener = pytweener.Tweener() self.set_position(initial_selected)
def __init__(self, ev_manager): self.ev_manager = ev_manager self.ev_manager.registerListener(self) pygame.init() self.window = pygame.display.set_mode(pref.WINDOW_SIZE) pygame.display.set_caption('my first game mvc') self.background = pygame.Surface(self.window.get_size()) self.background.fill(pref.BLACK) self.back_sprites = pygame.sprite.LayeredDirty() pygame.display.flip() self.front_sprites = pygame.sprite.LayeredDirty() self.dirty_rects = None self.tweener = pytweener.Tweener()
def __init__(self, motor, ancho, alto, titulo, fps=60, economico=True, gravedad=(0, -90), pantalla_completa=False): self.motor = motor self.motor.iniciar_ventana(ancho, alto, titulo, pantalla_completa) self.tweener = pytweener.Tweener() self.tareas = tareas.Tareas() self.control = control.Control() self.colisiones = colisiones.Colisiones() self.camara = camara.Camara(self) eventos.actualizar.conectar(self.actualizar_simuladores) self.fisica = fisica.Fisica(motor.obtener_area(), gravedad=gravedad) self.escena_actual = None
import pygame import pytweener import config tweener = pytweener.Tweener() def load(filepath, use_alpha=False): "Carga una imagen optimizando la velocidad de impresion." image = pygame.image.load("data/" + filepath) if config.LOWRES: image = pygame.transform.rotozoom(image, 0, 0.5) if use_alpha: return image.convert_alpha() return image.convert()
def __init__(self): self.tweener = pytweener.Tweener() self.switching = False self.last_update = 0 self.cues = {}
def __init__(self, game): self.game = game self.tweener = pytweener.Tweener() self.timer = 0 pass