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
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()
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
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()
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
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
def hit(self): BasicSprite.hit(self) Insectoid.hitSound.play()
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
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
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
def hit(self): BasicSprite.hit(self) DerpBoss.hitSound.play()
def tick(self, room): BasicSprite.tick(self, room) if not self.canBeHurt: self.hurtCounter -= 1 if self.hurtCounter < 0: self.canBeHurt = True
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)
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)