Skip to content

Commit

Permalink
SPRITE STUFF
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleMagocs committed Nov 6, 2011
1 parent e2a211b commit 588750f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions Enemy.py
Expand Up @@ -54,3 +54,4 @@ def Hit(self, enemyList, index, dmg):
self.HP = self.HP - dmg
if self.HP < 1:
enemyList.pop(index)
return True;
Binary file modified Enemy.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions Enemyflying.py
Expand Up @@ -61,3 +61,4 @@ def Hit(self, enemyList, index, dmg):
self.HP = self.HP - dmg
if self.HP < 1:
enemyList.pop(index)
return True;
7 changes: 4 additions & 3 deletions Explo.py
Expand Up @@ -21,14 +21,15 @@ def __init__(self, x, y):
self.rect = self.rect.move(self.x, self.y)

def updateEnemySprite(self, framestart, totalframes):
self.framenumber += 0.33
self.framenumber += 0.5
if self.framenumber > 5:
return True
if(self.framenumber > framestart + totalframes or self.framenumber < framestart):
self.framenumber = framestart
self.image = (int(self.framenumber)) % totalframes + framestart

def updateEnemyPos(self):
self.updateEnemySprite(0,5)
return False
return self.updateEnemySprite(0,5)

def Hit(self, enemyList, index, dmg):
self.HP = self.HP - dmg
Expand Down
Binary file modified Explo.pyc
Binary file not shown.
13 changes: 11 additions & 2 deletions Main.py
Expand Up @@ -166,10 +166,19 @@ def main():
count = end
chk = True
while count >= 0:
if i > (len(ArrowList)-1) or count > (len(enemyList)-1):
print "no"
print i
print len(ArrowList)-1
print count
print len(enemyList)-1
if ArrowList[i].rect.colliderect(enemyList[count].rect):
ArrowList.pop(i)
i = i - 1
enemyList[count].Hit(enemyList,count,5)
enx = enemyList[count].x
eny = enemyList[count].y
if(enemyList[count].Hit(enemyList,count,5)):
exploList.append(Explo(enx, eny))
points = points + 5
chk = False
count -= 1
Expand All @@ -192,7 +201,7 @@ def main():
if player.GravityRepl >= 1.0:
player.Gravity += 1
player.GravityRepl = 0.0
print player.Gravity
#print player.Gravity

#Enemy Function
def enemyGenerator(enemyList, maxEnemies):
Expand Down

0 comments on commit 588750f

Please sign in to comment.