-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmy_boss.py
45 lines (37 loc) · 1.02 KB
/
my_boss.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#my_boss.py
import pygame
from my_player import *
class red_boss():
def __init__(self):
self.bossIMG = pygame.image.load('Corona_boss1_75x75.png')
self.bossIMG2 = pygame.image.load('Corona_boss1_90x90.png')
self.bossIMG3 = pygame.image.load('Corona_boss1_120x120.png')
self.bossX = 400
self.bossY = 130
self.boss_movX = 0
self.boss_movY = 0
self.boss_vel = 0.4
self.health = 3
def boss_draw(self, screen):
if self.health == 1:
screen.blit(self.bossIMG, (int(self.bossX), int(self.bossY)))
elif self.health == 2:
screen.blit(self.bossIMG2, (int(self.bossX), int(self.bossY)))
elif self.health == 3:
screen.blit(self.bossIMG3, (int(self.bossX), int(self.bossY)))
def check_bossX(self, bossX, boss_movX):
#for boss
if bossX < 0:
self.bossX = 0
return 0
elif bossX > 752:
self.bossX = 752
return 750
self.bossX += boss_movX
def check_bossY(self, bossY):
if bossY < 0:
self.bossY = 0
elif bossY > 552:
self.bossY = 552
# def home_missile(self, p, screen):
# self.