Exemplo n.º 1
0
    def __init__(self, scene, pos = (0, 0, 0), rot = (0, 0, 0)):
        Object.__init__(self, scene, 'Player',(0, 0, 0), pos, rot)

        self.speed = 5
        self.sensitivity = 100

        self.collisionR = 1
Exemplo n.º 2
0
    def __init__(self, name, path,              \
                 use, var, meth, call, types):

        # Call mother's init
        Object.__init__(self, name, path,      \
                        use, var, meth, call, types, "")  # last is function type

        self.in_module = []
Exemplo n.º 3
0
 def __init__(self,
              scene,
              colour=(255, 255, 255),
              pos=(0, 0, 0),
              rot=(0, 0, 0)):
     Object.__init__(self, scene, 'Light', colour, pos, rot)
     self.maxRange = 8
     self.intensity = 20
Exemplo n.º 4
0
    def __init__(self, name, path,      \
                 use, var, meth, call,  \
                 types, fun_type):

        # Call mother's init
        Object.__init__(self, name, path,      \
                        use, var, meth, call, types, fun_type)

        self.in_module = []
Exemplo n.º 5
0
class SequentialTests:
    _iteration_count = 0
    _deque = collections.deque()
    _object = Object()
    _lastObject = Object()

    def setup(self, iteration_count):
        self._iteration_count = iteration_count
        self._lastObject._intProp = 10

        for x in range(self._iteration_count - 1):
            self._deque.append(self._object)

        self._deque.append(self._lastObject)

    def test(self):
        return self._deque.remove(self._lastObject)

    def cleanup(self):
        self._deque.clear()
Exemplo n.º 6
0
    def __init__(self,
                 scene,
                 colour=(255, 255, 255),
                 pos=(0, 0, 10),
                 rot=(0, 0, 0)):
        Object.__init__(self, scene, 'Wall', colour, pos, rot)
        self.AddPoints((1, 1, 1))  #0
        self.AddPoints((-1, 1, 1))  #1
        self.AddPoints((-1, 1, -1))  #2
        self.AddPoints((1, 1, -1))  #3
        self.AddPoints((1, -1, 1))  #4
        self.AddPoints((-1, -1, 1))  #5
        self.AddPoints((-1, -1, -1))  #6
        self.AddPoints((1, -1, -1))  #7

        self.AddFace([0, 1, 5, 4])
        self.AddFace([0, 3, 7, 4])
        self.AddFace([6, 5, 1, 2])
        self.AddFace([6, 7, 3, 2])

        self.setImage("StoneB.png")
Exemplo n.º 7
0
class FifoTests:
    _iteration_count = 0
    _deque = collections.deque()
    _object = Object()

    def setup(self, iteration_count):
        self._iteration_count = iteration_count

    def test(self):
        for x in range(self._iteration_count):
            self._deque.append(self._object)

        for x in range(self._iteration_count):
            self._deque.popleft()
Exemplo n.º 8
0
class IndexRetrievalTests:
    _list = []
    _target = 0
    _object = Object()

    def setup(self, iteration_count, target):
        self._target = target

        for x in range(iteration_count):
            self._list.append(self._object)

    def test(self):
        return self._list[self._target]

    def cleanup(self):
        self._list[:] = []
Exemplo n.º 9
0
class KeyRetrievalTests:
    _dict = {}
    _target = 0
    _object = Object()

    def setup(self, iteration_count, target):
        self._target = target

        for x in range(iteration_count):
            self._dict[x] = self._object

    def test(self):
        return self._dict.get(self._target)

    def cleanup(self):
        self._dict.clear()
Exemplo n.º 10
0
 def __init__(self, scene, pos = (0, 0, 0), rot = (0, 0, 0)):
     Object.__init__(self, scene, 'Bullet', (0, 0, 0), pos, rot)
     self.speed = 10
     self.colour = (255, 255, 255)
     self.timer = 5