Logo Search packages:      
Sourcecode: whichwayisup version File versions  Download package

frame.py

import pygame
import os

from pygame.locals import *

from locals import *

import data

class Frame:

  def __init__(self, object, anim_name, frameno, frame_length):
    try:
      self.image = pygame.image.load(data.picpath(object, anim_name, frameno)).convert_alpha()
    except:
      try:
        self.image = pygame.image.load(data.picpath("brown", anim_name, frameno)).convert_alpha() #Fallback to brown tileset
      except:
        self.image = pygame.image.load(data.picpath("object", "idle", 0)).convert_alpha() #Fallback to default object image
    self.frame_length = frame_length
    return

  def get_image(self):
    return self.image

  def get_time(self):
    return self.frame_length

Generated by  Doxygen 1.6.0   Back to index