Пример #1
0
def MakeScreenObject(game, vals, id=None):
    if vals["is_alive"] == False:
        return None

    #print "make object"
    #return
    obj = None
    type = vals["type"]
    if type == "AsteroidObject":
        obj = Asteroid.AsteroidObject(game, id)
    if type == "ShipObject":
        obj = Ship.ShipObject(game, id)
    if type == "BulletObject":
        obj = Bullet.BulletObject(None, game)

    LoadScreenObject(obj, vals)
    return obj
Пример #2
0
 def shoot(self):
     if self.time_reload <= 0:
         self.time_reload = 200 # TODO move this value out to a global constant
         Bullet.BulletObject(self)