Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

GUN MODE

  • Loading branch information...
commit 71273b360816d46cab70e84908ec4bd5472d1bb5 1 parent fa04e23
@sockser sockser authored
View
7 Arrow.py
@@ -24,9 +24,12 @@ def direction(x, y):
class Arrow(pygame.sprite.Sprite):
- def __init__(self,playerX,playerY,mouseX,mouseY):
+ def __init__(self,playerX,playerY,mouseX,mouseY,gun):
pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load(os.path.join(os.curdir, 'arrow.png')).convert_alpha()
+ if(gun):
+ self.image = pygame.image.load(os.path.join(os.curdir, 'missile.png')).convert_alpha()
+ else:
+ self.image = pygame.image.load(os.path.join(os.curdir, 'arrow.png')).convert_alpha()
self.rect = self.image.get_rect()
self.rect = self.rect.move(playerX,playerY)
self.x = playerX
View
BIN  Enemy.pyc
Binary file not shown
View
BIN  Explo.pyc
Binary file not shown
View
25 Main.py
@@ -95,21 +95,21 @@ def main():
if event.button in (1,2,3):
mousex, mousey = event.pos
if player.Arrows - 1 >= 0:
- arrow = Arrow(player.x,player.y+24,mousex,mousey)
+ arrow = Arrow(player.x,player.y+24,mousex,mousey,player.gunmode)
ArrowList.append(arrow)
if player.MultiShot2:
- arrow = Arrow(player.x,player.y+24,mousex,mousey+20)
+ arrow = Arrow(player.x,player.y+24,mousex,mousey+20,player.gunmode)
ArrowList.append(arrow)
- arrow = Arrow(player.x,player.y+24,mousex,mousey-20)
+ arrow = Arrow(player.x,player.y+24,mousex,mousey-20,player.gunmode)
ArrowList.append(arrow)
- arrow = Arrow(player.x,player.y+24,mousex,mousey+40)
+ arrow = Arrow(player.x,player.y+24,mousex,mousey+40,player.gunmode)
ArrowList.append(arrow)
- arrow = Arrow(player.x,player.y+24,mousex,mousey-40)
+ arrow = Arrow(player.x,player.y+24,mousex,mousey-40,player.gunmode)
ArrowList.append(arrow)
elif player.MultiShot:
- arrow = Arrow(player.x,player.y+24,mousex,mousey+30)
+ arrow = Arrow(player.x,player.y+24,mousex,mousey+30,player.gunmode)
ArrowList.append(arrow)
- arrow = Arrow(player.x,player.y+24,mousex,mousey-30)
+ arrow = Arrow(player.x,player.y+24,mousex,mousey-30,player.gunmode)
ArrowList.append(arrow)
soundObjectArrow.play()
player.Arrows -= 1
@@ -210,14 +210,16 @@ def main():
tmp = ArrowList[i]
tmp = enemyList[count]
if ArrowList[i].rect.colliderect(enemyList[count].rect):
- ArrowList.pop(i)
- i = i - 1
+ if(not player.gunmode):
+ ArrowList.pop(i)
+ i = i - 1
enx = enemyList[count].x
eny = enemyList[count].y
if(enemyList[count].Hit(enemyList,count,5)):
exploList.append(Explo(enx, eny))
x = random.randint(0,100)
- if x <= 20:
+ print x
+ if x <= 90:
tmp = PowerUp(enx,eny)
PowerUpList.append(tmp)
soundObjectExplosion.play()
@@ -248,6 +250,9 @@ def main():
HP = 100
else:
HP += 10
+ elif PowerUpList[i].type == 4:
+ player.gunmode = True
+ #soundObjectArrow = pygame.mixer.Sound("laser.wav")
PowerUpList.pop(i)
else:
windowSurfaceObj.blit(PowerUpList[i].images[PowerUpList[i].image], PowerUpList[i].rect)
View
5 PowerUp.py
@@ -18,7 +18,9 @@ def __init__(self,x,y):
self.y = y
self.rect = self.rect.move(x,y)
x = random.randint(0,100)
- if x < 30:
+ if x < 20:
+ self.type = 4
+ elif x < 40:
self.type = 0
elif x < 70:
self.type = 3
@@ -30,6 +32,7 @@ def __init__(self,x,y):
#1 = Multi Shot 3 Arrows
#2 = Rapid Fire (Infinite Arrows)
#3 = Heal Castle
+ #4 = Piercing rounds
def updateBoxSprite(self):
self.framenumber += 0.33
View
BIN  PowerUp.pyc
Binary file not shown
View
BIN  Vector.pyc
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.