예제 #1
0
 def tick(self, room):
     BasicSprite.tick(self, room)
     if not self.isFalling:
         self.waitTime -= 1
         if self.waitTime < 0:
             self.waitTime = random.randint(300,500)
             self.yspeed = -1.0*random.randint(20,30) * ICON_SIZE / FPS
             self.xspeed = 1.0*random.randint(-3,3) * ICON_SIZE / FPS
예제 #2
0
 def hit(self):
     if self.canBeHurt:
         BasicSprite.hit(self)
         self.canBeHurt = False
         self.hurtCounter = 40
         self.xspeed = - self.xspeed
         self.yspeed = 0 #random.gauss(-10,2) - self.yspeed
         Player.hurtSound.play()
예제 #3
0
 def tick(self, room):
     BasicSprite.tick(self, room)
     if not self.isFalling:
         self.waitTime -= 1
         if self.waitTime < 0:
             self.waitTime = random.randint(300, 500)
             self.yspeed = -1.0 * random.randint(20, 30) * ICON_SIZE / FPS
             self.xspeed = 1.0 * random.randint(-3, 3) * ICON_SIZE / FPS
예제 #4
0
 def hit(self):
     if self.canBeHurt:
         BasicSprite.hit(self)
         self.canBeHurt = False
         self.hurtCounter = 40
         self.xspeed = -self.xspeed
         self.yspeed = 0  #random.gauss(-10,2) - self.yspeed
         Player.hurtSound.play()
예제 #5
0
    def __init__(self, pos):
        r = pygame.Rect(pos,(ICON_SIZE,ICON_SIZE))
        BasicSprite.__init__(self, r, health=15, mass=1.0)

        # graphics related
        self.movingRight = False
        self.movingLeft = False
        self.isWalking = False
        self.dir = 1
        
        # gameplay related
        self.canBeHurt = True
        self.hurtCounter = 0
        self.isShooting = False  #true when shooting
        self.score = 0
        self.hasBigWeapon = False
예제 #6
0
    def __init__(self, pos):
        r = pygame.Rect(pos, (ICON_SIZE, ICON_SIZE))
        BasicSprite.__init__(self, r, health=15, mass=1.0)

        # graphics related
        self.movingRight = False
        self.movingLeft = False
        self.isWalking = False
        self.dir = 1

        # gameplay related
        self.canBeHurt = True
        self.hurtCounter = 0
        self.isShooting = False  #true when shooting
        self.score = 0
        self.hasBigWeapon = False
예제 #7
0
 def hit(self):
     BasicSprite.hit(self)
     Insectoid.hitSound.play()
예제 #8
0
    def __init__(self, pos):
        r = pygame.Rect(pos, (ICON_SIZE, ICON_SIZE))
        BasicSprite.__init__(self, r, numberOfFrames=3, health=3, mass=0.6)

        self.moveTime = random.randint(100, 200)
        self.xspeed = 4.0 * ICON_SIZE / FPS
예제 #9
0
 def tick(self, room):
     BasicSprite.tick(self, room)
     self.moveTime -= 1
     if self.moveTime < 0:
         self.moveTime = random.randint(100, 200)
         self.yspeed = -15.0 * ICON_SIZE / FPS  # jump randomly
예제 #10
0
 def tick(self, room):
     BasicSprite.tick(self, room)
     self.moveTime -= 1
     if self.moveTime < 0:
         self.moveTime = random.randint(100, 200)
         self.yspeed = -15.0 * ICON_SIZE / FPS  #jump randomly
예제 #11
0
 def hit(self):
     BasicSprite.hit(self)
     Insectoid.hitSound.play()
예제 #12
0
 def hit(self):
     BasicSprite.hit(self)
     DerpBoss.hitSound.play()
예제 #13
0
    def __init__(self, pos):
        r = pygame.Rect(pos, (ICON_SIZE, ICON_SIZE))
        BasicSprite.__init__(self, r, numberOfFrames=3, health=3, mass=0.6)

        self.moveTime = random.randint(100, 200)
        self.xspeed = 4.0 * ICON_SIZE / FPS
예제 #14
0
 def tick(self, room):       
     BasicSprite.tick(self, room)
     if not self.canBeHurt:
         self.hurtCounter -= 1
         if self.hurtCounter < 0:
             self.canBeHurt = True
예제 #15
0
 def tick(self, room):
     BasicSprite.tick(self, room)
     if not self.canBeHurt:
         self.hurtCounter -= 1
         if self.hurtCounter < 0:
             self.canBeHurt = True
예제 #16
0
 def __init__(self, pos):
     r = pygame.Rect(pos,(2*ICON_SIZE,2*ICON_SIZE))
     BasicSprite.__init__(self, r, health=15, mass=2.0, numberOfFrames=2)
     
     self.waitTime = random.randint(300,500)
예제 #17
0
 def hit(self):
     BasicSprite.hit(self)
     DerpBoss.hitSound.play()
예제 #18
0
    def __init__(self, pos):
        r = pygame.Rect(pos, (2 * ICON_SIZE, 2 * ICON_SIZE))
        BasicSprite.__init__(self, r, health=15, mass=2.0, numberOfFrames=2)

        self.waitTime = random.randint(300, 500)