Created the Actor and Animation classes.

This commit is contained in:
2013-01-09 08:41:34 -04:30
parent fa3c92dd2e
commit 063ec6d22b
4 changed files with 79 additions and 2 deletions

20
actor.py Normal file
View File

@@ -0,0 +1,20 @@
###########################################
# Created on 1-9-2013. Miguel Angel Astor #
###########################################
import pygame
from animation import Animation
class Actor:
""" Represents any game object. """
def __init__(self):
""" Initializes the actor object. """
# All sprites for an actor are stored as a list of pygame sprites.
self.sprites = []
# Animations are stored as a key (animation name),
# value (list of sprite indices) pairs.
self.animations = {}
# Parameters.
self.angle = 0
self.speed = [0, 0] # [X speed, Y speed].
self.acceleration = [0, 0] # Ditto.
self.b_box = [0, 0] # [X length, Y length].