|
|
@ -3,10 +3,11 @@ import pygame_menu |
|
|
|
import sys |
|
|
|
import sys |
|
|
|
import random |
|
|
|
import random |
|
|
|
import time |
|
|
|
import time |
|
|
|
from bullets import * |
|
|
|
from bullets import Bullet |
|
|
|
from player import * |
|
|
|
from player import Player |
|
|
|
from enemy import * |
|
|
|
from enemy import Enemy |
|
|
|
from surfaces import Surface |
|
|
|
from surfaces import Surface |
|
|
|
|
|
|
|
|
|
|
|
######## Set up things that will not change |
|
|
|
######## Set up things that will not change |
|
|
|
pygame.init() |
|
|
|
pygame.init() |
|
|
|
pygame.display.set_caption('Healthless') |
|
|
|
pygame.display.set_caption('Healthless') |
|
|
@ -41,7 +42,7 @@ def play(): |
|
|
|
|
|
|
|
|
|
|
|
window.fill((41, 64, 59)) # (41,64,59) |
|
|
|
window.fill((41, 64, 59)) # (41,64,59) |
|
|
|
|
|
|
|
|
|
|
|
test_surface.place(window,352,352) |
|
|
|
test_surface.place(window,100,100) |
|
|
|
|
|
|
|
|
|
|
|
player.teleportation() |
|
|
|
player.teleportation() |
|
|
|
player.shoot(window,start_color,bullet_image) |
|
|
|
player.shoot(window,start_color,bullet_image) |
|
|
@ -50,8 +51,14 @@ def play(): |
|
|
|
|
|
|
|
|
|
|
|
enemy.draw(window,start_color,enemy_image) |
|
|
|
enemy.draw(window,start_color,enemy_image) |
|
|
|
enemy.update() |
|
|
|
enemy.update() |
|
|
|
|
|
|
|
enemy.collision(enemy) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if player.out_of_area(): |
|
|
|
|
|
|
|
print(player.x, player.y) |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
|
|
|
|
if player.y <= 0: #Just to try a "death" |
|
|
|
if enemy.out_of_area(): |
|
|
|
|
|
|
|
print('Random is on our side') |
|
|
|
break |
|
|
|
break |
|
|
|
|
|
|
|
|
|
|
|
clock.tick(FPS) |
|
|
|
clock.tick(FPS) |
|
|
|