示例#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)