Beispiel #1
0
 def __init__(self, subjectof, objectof, verb):
     listof = []
     Thing.__init__(self, 'The fact that' + subjectof + verb + objectof, '')
     Fact.listof.append(self)
     self.subjectof = subjectof
     self.objectof = objectof
     self.verb = Action
Beispiel #2
0
 def __init__(self, initial_pos = (15, 755), editable=False):
     image = pygame.Surface( (1770, 15) )
     image.fill( (255, 255, 255) )
     Thing.__init__(self,
         image, editable, None,
         initial_pos, elasticity = 100, mobility = False,
         gravity = 10)
    def __init__(self,
                 filename,
                 position,
                 default_velocity=[145.0, 0.0],
                 velocity=[0.0, 0.0],
                 acceleration=[0.0, GRAVITY],
                 jump_amount=JUMP_AMOUNT,
                 health=1,
                 max_y=None):
        # self.rect is the creature's RELATIVE position
        # self.position is the ABSOLUTE position
        Thing.__init__(self, filename)

        self.velocity = Vector(velocity[0], velocity[1], y_max=max_y)
        self.acceleration = Vector(acceleration[0], acceleration[1])
        self.default_velocity = Vector(default_velocity[0],
                                       default_velocity[1])

        self.position = pygame.rect.Rect(self.rect)
        self.position.topleft = position
        self.rect.topleft = position
        self.desired_position = pygame.rect.Rect(self.position)

        self.jumping = False
        self.jump_amount = jump_amount
        self.landed = True
        self.motion = "right" if self.velocity.x >= 0 else "left"

        self.health = health
        self.dead = False

        self.reload_time = time() - 10
        self.reload_wait = .75  #This gets tampered with elsewhere

        self.AI = AI()
    def __init__(self, filename, position, default_velocity = [145.0, 0.0],
                 velocity = [0.0, 0.0], acceleration = [0.0, GRAVITY],
                 jump_amount = JUMP_AMOUNT, health = 1, max_y = None):
        # self.rect is the creature's RELATIVE position
        # self.position is the ABSOLUTE position
        Thing.__init__(self, filename)
        
        self.velocity = Vector(velocity[0], velocity[1], y_max = max_y)
        self.acceleration = Vector(acceleration[0], acceleration[1])
        self.default_velocity = Vector(default_velocity[0], default_velocity[1])
        
        self.position = pygame.rect.Rect(self.rect)
        self.position.topleft = position
        self.rect.topleft = position
        self.desired_position = pygame.rect.Rect(self.position)
        
        self.jumping = False
        self.jump_amount = jump_amount
        self.landed = True
        self.motion = "right" if self.velocity.x >= 0 else "left"

        self.health = health
        self.dead = False

        self.reload_time = time() - 10
        self.reload_wait = .75 #This gets tampered with elsewhere

        self.AI = AI()
Beispiel #5
0
 def __init__(self, name, names, pluralised = 's', plural = 's'):
     Thing.__init__(self, name, names)
     Inanimate.listof.append(self)
     self.pluralised = pluralised
     if plural == 's':
         self.plural = name + 's'
     else:
         self.plural = plural
Beispiel #6
0
 def __init__(self, initial_pos=None, editable=True):
     Thing.__init__(self,
                    pygame.image.load(
                        os.path.join("data", "images", "target.png")),
                    editable,
                    None,
                    initial_pos,
                    elasticity=100,
                    mobility=False,
                    gravity=10)
Beispiel #7
0
 def __init__(self, initial_pos=None, editable=True):
     if pygame.mixer.get_init():
         snd = pygame.mixer.Sound(os.path.join("data", "snd",
                                               "BowlingBall.wav"))
     else:
         snd = None
     Thing.__init__(self,
           pygame.image.load(os.path.join("data", "images", "bola.png")),
           editable, snd,
           initial_pos, elasticity = 90, mobility = True, gravity = 5)
Beispiel #8
0
 def __init__(self, initial_pos=(15, 755), editable=False):
     image = pygame.Surface((1770, 15))
     image.fill((255, 255, 255))
     Thing.__init__(self,
                    image,
                    editable,
                    None,
                    initial_pos,
                    elasticity=100,
                    mobility=False,
                    gravity=10)
Beispiel #9
0
 def __init__(self, initial_pos=None, editable=True):
     if pygame.mixer.get_init():
         snd = pygame.mixer.Sound(os.path.join("data", "snd",
                                               "penguin.wav"))
     else:
         snd = None
     Thing.__init__(self,
          pygame.image.load(os.path.join("data", "images", "penguin.png")),
          editable, snd,
          initial_pos, elasticity = 100, mobility = True,
          gravity = 5)
     self.speed = [5, 0]
Beispiel #10
0
 def __init__(self, initial_pos = (0, 0), editable=True):
     Thing.__init__(self,
           pygame.image.load(os.path.join("data", "images",
                                          "esteira_dir.png")),
           editable, None,
           initial_pos, elasticity = 100, mobility = False,
           gravity = 10)
     self.sentido = 1
     self.image_dir = pygame.image.load(os.path.join("data", "images",
                                                     "esteira_dir.png"))
     self.image_esq = pygame.image.load(os.path.join("data", "images",
                                                     "esteira_esq.png"))
Beispiel #11
0
 def __init__(self, initial_pos=None, editable=True):
     if pygame.mixer.get_init():
         snd = pygame.mixer.Sound(
             os.path.join("data", "snd", "BowlingBall.wav"))
     else:
         snd = None
     Thing.__init__(self,
                    pygame.image.load(
                        os.path.join("data", "images", "futebol.png")),
                    editable,
                    snd,
                    initial_pos,
                    elasticity=70,
                    mobility=True,
                    gravity=5)
Beispiel #12
0
 def __init__(self, initial_pos=(0, 0), editable=True):
     Thing.__init__(self,
                    pygame.image.load(
                        os.path.join("data", "images", "esteira_dir.png")),
                    editable,
                    None,
                    initial_pos,
                    elasticity=100,
                    mobility=False,
                    gravity=10)
     self.sentido = 1
     self.image_dir = pygame.image.load(
         os.path.join("data", "images", "esteira_dir.png"))
     self.image_esq = pygame.image.load(
         os.path.join("data", "images", "esteira_esq.png"))
Beispiel #13
0
 def __init__(self, initial_pos=None, editable=True):
     if pygame.mixer.get_init():
         snd = pygame.mixer.Sound(os.path.join("data", "snd",
                                               "penguin.wav"))
     else:
         snd = None
     Thing.__init__(self,
                    pygame.image.load(
                        os.path.join("data", "images", "penguin.png")),
                    editable,
                    snd,
                    initial_pos,
                    elasticity=100,
                    mobility=True,
                    gravity=5)
     self.speed = [5, 0]
Beispiel #14
0
 def __init__(self, owner):
     Thing.__init__(self, owner._server)
     if hasattr(self, 'name'):
         self.name = self.name
     else:
         n = self.__class__.__name__
         i = 1
         while i < len(n):
             if n[i] in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ':
                 n = n[:i] + ' ' + n[i:]
                 i += 1
             i += 1
         self.name = n
     if hasattr(self, 'color'):
         self.color = self.color
     elif self.cost[-1].lower() in 'rgubw':
         self.color = self.cost[-1].lower()
     else:
         self.color = ''
     self.tapped = 0
     self._isDoneCasting = 0
     self._abilities = {}
     self.untapEvent = None
Beispiel #15
0
 def __init__(self, name, names=''):
     Thing.__init__(self, name, names)
     Place.listof.append(self)
Beispiel #16
0
 def __init__(self, name, names, elements, gender = 'F'):
     Thing.__init__(self, name, names)
     Garment.listof.append(self)
     self.elements = elements
     self.gender = gender
Beispiel #17
0
 def __init__(self, name, names, gender=None, comment=''):
     Thing.__init__(self, name, names, gender, 1)
     Person.listof.append(self)
     self.comment = comment
Beispiel #18
0
 def __init__(self, name, names, reasons, pluralised='s'):
     Thing.__init__(self, name, names)
     self.reasons = reasons
     self.pluralised = pluralised
     Doodad.listof.append(self)
Beispiel #19
0
 def __init__(self, name, names, transitive=0):
     Thing.__init__(self, name, names, 0, None)
     self.transitive = transitive
     Action.listof.append(self)
Beispiel #20
0
 def __init__(self, name, names='', positivity=0.5):
     Thing.__init__(self, name, names)
     self.positivity = positivity
     State.listof.append(self)
Beispiel #21
0
 def __init__(self, initial_pos=None, editable=True):
     Thing.__init__(self,
           pygame.image.load(os.path.join("data", "images", "target.png")),
           editable, None,
           initial_pos, elasticity = 100, mobility = False,
           gravity = 10)