|
|
@ -20,10 +20,13 @@ def play(): |
|
|
|
pygame.mouse.set_visible(False) |
|
|
|
pygame.mouse.set_visible(False) |
|
|
|
slowsurf = SlowTimeSurf(384,64) |
|
|
|
slowsurf = SlowTimeSurf(384,64) |
|
|
|
enemy = Enemy(100,100) |
|
|
|
enemy = Enemy(100,100) |
|
|
|
|
|
|
|
#enemies_on_screen.append(enemy) |
|
|
|
enemy2 = Enemy(windowX,200) |
|
|
|
enemy2 = Enemy(windowX,200) |
|
|
|
|
|
|
|
#enemies_on_screen.append(enemy2) |
|
|
|
player = Player() |
|
|
|
player = Player() |
|
|
|
death_timer = 70 |
|
|
|
death_timer = 70 |
|
|
|
SCORE = 0 |
|
|
|
SCORE = 0 |
|
|
|
|
|
|
|
ppp = False |
|
|
|
########################## LAYER 0 |
|
|
|
########################## LAYER 0 |
|
|
|
while True: |
|
|
|
while True: |
|
|
|
for event in pygame.event.get(): |
|
|
|
for event in pygame.event.get(): |
|
|
@ -50,15 +53,16 @@ def play(): |
|
|
|
print("Colliding !") |
|
|
|
print("Colliding !") |
|
|
|
slowsurf.switch = False |
|
|
|
slowsurf.switch = False |
|
|
|
else: |
|
|
|
else: |
|
|
|
if slowsurf.timer >= 0: |
|
|
|
if slowsurf.activation_timer >= 0: |
|
|
|
slowsurf.timer -= 1 |
|
|
|
slowsurf.activation_timer -= 1 |
|
|
|
enemy.vel = 3 - 2 |
|
|
|
enemy.vel = 3 - 2 |
|
|
|
enemy2.vel = 3 - 2 |
|
|
|
enemy2.vel = 3 - 2 |
|
|
|
enemy.bul_cooldown += 1.5 |
|
|
|
enemy.bul_cooldown += 1.5 |
|
|
|
enemy2.bul_cooldown += 1.5 |
|
|
|
enemy2.bul_cooldown += 1.5 |
|
|
|
else: |
|
|
|
else: |
|
|
|
enemy.vel = 3 |
|
|
|
enemy.refresh() |
|
|
|
enemy2.vel = 3 |
|
|
|
enemy2.refresh() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
player.teleportation() |
|
|
|
player.teleportation() |
|
|
|
player.shoot(window) |
|
|
|
player.shoot(window) |
|
|
@ -81,17 +85,17 @@ def play(): |
|
|
|
|
|
|
|
|
|
|
|
########################## LAYER 2 |
|
|
|
########################## LAYER 2 |
|
|
|
if enemy.alive == True: |
|
|
|
if enemy.alive == True: |
|
|
|
enemy.enemy_shoot(window) |
|
|
|
|
|
|
|
enemy.draw(window) |
|
|
|
enemy.draw(window) |
|
|
|
enemy.move('right') |
|
|
|
enemy.move('right') |
|
|
|
|
|
|
|
enemy.enemy_shoot(window) |
|
|
|
enemy.collision(window) |
|
|
|
enemy.collision(window) |
|
|
|
if enemy.enemy_x >= windowX-10: #That returning thingy |
|
|
|
if enemy.enemy_x >= windowX-10: #That returning thingy |
|
|
|
enemy.enemy_x = 5 |
|
|
|
enemy.enemy_x = 5 |
|
|
|
|
|
|
|
|
|
|
|
if enemy2.alive == True: |
|
|
|
if enemy2.alive == True: |
|
|
|
|
|
|
|
enemy2.draw(window) |
|
|
|
enemy2.enemy_shoot(window) |
|
|
|
enemy2.enemy_shoot(window) |
|
|
|
enemy2.move('left') |
|
|
|
enemy2.move('left') |
|
|
|
enemy2.draw(window) |
|
|
|
|
|
|
|
enemy2.collision(window) |
|
|
|
enemy2.collision(window) |
|
|
|
if enemy2.enemy_x <= 5: #That returning thingy |
|
|
|
if enemy2.enemy_x <= 5: #That returning thingy |
|
|
|
enemy2.enemy_x = windowX |
|
|
|
enemy2.enemy_x = windowX |
|
|
@ -106,6 +110,15 @@ def play(): |
|
|
|
if enemy.alive == False and enemy2.alive == False: |
|
|
|
if enemy.alive == False and enemy2.alive == False: |
|
|
|
print('Win-win') |
|
|
|
print('Win-win') |
|
|
|
break |
|
|
|
break |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# for enemy in enemies_on_screen: |
|
|
|
|
|
|
|
# if enemy[0].alive == True: |
|
|
|
|
|
|
|
# enemy[0].move('right') |
|
|
|
|
|
|
|
# enemy[0].enemy_shoot(window) |
|
|
|
|
|
|
|
# enemy[0].draw(window) |
|
|
|
|
|
|
|
# enemy[0].collision(window) |
|
|
|
|
|
|
|
# else: |
|
|
|
|
|
|
|
# enemy[0].draw(window) |
|
|
|
########################## LAYER 2 END |
|
|
|
########################## LAYER 2 END |
|
|
|
|
|
|
|
|
|
|
|
########################## LAYER 3 |
|
|
|
########################## LAYER 3 |
|
|
|