Skip to content

Commit

Permalink
Meow
Browse files Browse the repository at this point in the history
  • Loading branch information
Zcr1 committed Nov 6, 2011
1 parent 9d7a01d commit 15c1010
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Enemy.py
Expand Up @@ -36,6 +36,6 @@ def updateEnemyPos(self):
self.rect = self.rect.move(self.speed,0)

def Hit(self, enemyList, index, dmg):
self.HP = slef.HP - dmg
self.HP = self.HP - dmg
if self.HP < 1:
enemyList.pop(index)
6 changes: 3 additions & 3 deletions Enemyflying.py
Expand Up @@ -39,7 +39,7 @@ def swordHit(self, enemyList, index):
self.HP = slef.HP - 5
if self.HP < 1:
enemyList.pop(index)
def arrowHit(self, enemyList, index):
self.HP = slef.HP - 2.5
def Hit(self, enemyList, index, dmg):
self.HP = self.HP - dmg
if self.HP < 1:
enemyList.pop(index)
enemyList.pop(index)
27 changes: 23 additions & 4 deletions Main.py
Expand Up @@ -100,11 +100,30 @@ def main():
if not skipFall:
player.fall()

for i in range(len(ArrowList)):
arrowGroup = pygame.sprite.Group()
end = len(ArrowList)
i = end - 1

while i >= 0:
chk = ArrowList[i].updateArrowPos()
if chk:
ArrowObj = ArrowList[i].ArrowObj
windowSurfaceObj.blit(ArrowObj, ArrowList[i].rect)
if not chk:
ArrowList.pop(i)
i = i - 1
else:
end = len(enemyList) - 1
count = end
chk = True
while count >= 0:
if ArrowList[i].rect.colliderect(enemyList[count].rect):
ArrowList.pop(i)
i = i - 1
enemyList[count].Hit(enemyList,count,5)
chk = False
count -= 1
if chk:
ArrowObj = ArrowList[i].ArrowObj
windowSurfaceObj.blit(ArrowObj, ArrowList[i].rect)
i = i - 1

windowSurfaceObj.blit(player.images[player.image],player.rect)
#pygame.display.update()
Expand Down

0 comments on commit 15c1010

Please sign in to comment.