Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

GRAPHICS

  • Loading branch information...
commit 5c38e92cdb3b10a981815ec410d5cea91295b479 1 parent e284827
@sockser sockser authored
View
19 Explo.py
@@ -6,15 +6,22 @@
class Explo(pygame.sprite.Sprite):
- def __init__(self, x, y):
+ def __init__(self, x, y, player):
pygame.sprite.Sprite.__init__(self)
self.image = 0
self.framenumber = 0
- self.images = [pygame.image.load(os.path.join(os.curdir, 'expl1.png')).convert_alpha(),
- pygame.image.load(os.path.join(os.curdir, 'expl2.png')).convert_alpha(),
- pygame.image.load(os.path.join(os.curdir, 'expl3.png')).convert_alpha(),
- pygame.image.load(os.path.join(os.curdir, 'expl4.png')).convert_alpha(),
- pygame.image.load(os.path.join(os.curdir, 'expl5.png')).convert_alpha()]
+ if player:
+ self.images = [pygame.image.load(os.path.join(os.curdir, 'pexpl1.png')).convert_alpha(),
+ pygame.image.load(os.path.join(os.curdir, 'pexpl2.png')).convert_alpha(),
+ pygame.image.load(os.path.join(os.curdir, 'pexpl3.png')).convert_alpha(),
+ pygame.image.load(os.path.join(os.curdir, 'pexpl4.png')).convert_alpha(),
+ pygame.image.load(os.path.join(os.curdir, 'pexpl5.png')).convert_alpha()]
+ else:
+ self.images = [pygame.image.load(os.path.join(os.curdir, 'expl1.png')).convert_alpha(),
+ pygame.image.load(os.path.join(os.curdir, 'expl2.png')).convert_alpha(),
+ pygame.image.load(os.path.join(os.curdir, 'expl3.png')).convert_alpha(),
+ pygame.image.load(os.path.join(os.curdir, 'expl4.png')).convert_alpha(),
+ pygame.image.load(os.path.join(os.curdir, 'expl5.png')).convert_alpha()]
self.rect = self.images[self.image].get_rect()
self.x = x
self.y = y
View
BIN  Explo.pyc
Binary file not shown
View
10 Main.py
@@ -70,13 +70,13 @@ def main():
HP = HP -5
if HP < 0:
HP = 0
- exploList.append(Explo(enx, eny))
+ exploList.append(Explo(enx, eny, False))
soundObjectExplosion.play()
if HP == 0:
retry = gameOver(points, windowSurfaceObj,fpsClock, desertBackground)
playing = False
- exploList.append(Explo(enx, eny))
+ exploList.append(Explo(enx, eny, False))
count = count - 1
#DRAW EXLPLOSIONS
@@ -222,7 +222,7 @@ def main():
enx = enemyList[count].x
eny = enemyList[count].y
if(enemyList[count].Hit(enemyList,count,5)):
- exploList.append(Explo(enx, eny))
+ exploList.append(Explo(enx, eny, True))
x = random.randint(0,100)
print x
if x <= 90:
@@ -250,7 +250,7 @@ def main():
i = i - 1
else:
if missileList[i].rect.colliderect(player.rect):
- exploList.append(Explo(missileList[i].x, missileList[i].y))
+ exploList.append(Explo(missileList[i].x, missileList[i].y, True))
soundObjectExplosion.play()
missileList.pop(i)
player.Lives -= 1
@@ -294,7 +294,7 @@ def main():
while i >= 0:
if player.rect.colliderect(enemyList[i].rect):
player.Lives -= 1
- exploList.append(Explo(enemyList[i].x, enemyList[i].y))
+ exploList.append(Explo(enemyList[i].x, enemyList[i].y, False))
enemyList.pop(i)
if player.Lives <= 0:
gameOver(points, windowSurfaceObj,fpsClock, desertBackground)
View
BIN  Missile.pyc
Binary file not shown
View
BIN  pexpl1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  pexpl2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  pexpl3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  pexpl4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  pexpl5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.