-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildCharacter.py
More file actions
73 lines (52 loc) · 1.68 KB
/
buildCharacter.py
File metadata and controls
73 lines (52 loc) · 1.68 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import random
class person:
def __init__(self):
self.position_x = 0
self.position_y = 0
self.LIVES = 3
class Mandalorian(person):
def __init__(self):
super().__init__()
self.body = [' ', '_', '_', '_', ' ', ' ', '|', '+', '|', ' ', ' ', '-', '-', '-', ' ', '/', '|', ' ', '|', '\\', ' ', '-', '-', '-', ' ', ' ', '/', ' ', '\\', ' ']
self.bodyHeight = 6
self.bodyWidth = 5
self.LIVES = 3
self.SCORE = 0
self.isShield = 0
self.mandoSpeed = 1
self.shieldToggle = 0
def moveUp(self):
self.position_y += self.mandoSpeed
def moveDown(self):
self.position_y -= self.mandoSpeed
def moveRight(self):
self.position_x += self.mandoSpeed
def moveLeft(self):
self.position_x -= self.mandoSpeed
def print(self):
for i in self.body:
for j in i:
print(j, end='')
print()
class bossMan(person):
def __init__(self):
super().__init__()
self.LIVES = 20
class beamBarrier:
def __init__(self, x, y):
self.form1 = [['-', '-', '-', '-']]
self.form2 = [['-'], ['-'], ['-'], ['-']]
self.form3 = [['-'],[' ', '-'], [' ', ' ', '-'], [' ', ' ', ' ', '-']]
self.form4 = [[' ', ' ', ' ', '-'], [' ', ' ', '-'], [' ', '-'], ['-']]
self.formChoice = random.randint(1, 4)
self.vSize = 10
self.hSize = 15
self.crossSize = 8
self.position_x = x
self.position_y = y
class bullet:
def __init__(self, x, y):
self.position_x = x
self.position_y = y
def moveBullet(self):
self.position_x += 1