Permalink
Browse files

Begin work on the cam module

  • Loading branch information...
1 parent 3a1a065 commit d626bb0258c2dfbc8393af58d087d25e9fb909dc @szabba committed Nov 13, 2012
Showing with 30 additions and 0 deletions.
  1. +30 −0 src/cam.py
View
@@ -0,0 +1,30 @@
+# -*- coding: utf-8 -*-
+
+
+__all__ = ['Cam', 'StaticCam']
+
+
+class Cam(object):
+ """Abstract base class for Cams"""
+
+ def viewport(self, stage):
+ """C.viewport() -> a Box
+
+ The part of a Level to be mapped on-screen.
+
+ The behaviour of an Engine when the Box's ratio is different from the
+ one of the screen is undefined.
+ """
+
+
+class StaticCam(Cam):
+ """StaticCam(box) -> a Cam always returning the same viewport"""
+
+ def __init__(self, box):
+
+ self.__box = box
+
+ def viewport(self, stage):
+ """SC.viewport() -> always the same Box"""
+
+ return self.__box

0 comments on commit d626bb0

Please sign in to comment.