-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgameFunctions.py
More file actions
50 lines (37 loc) · 1.02 KB
/
gameFunctions.py
File metadata and controls
50 lines (37 loc) · 1.02 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
import os
import globals
import input
from buildCharacter import Mandalorian
from gameHandler import mandoHandler
from gameBoard import GameBoard
from printMessages import printGameOver
def endGame():
printGameOver()
return 1
def gameLoop(board, mando):
# Handling lives
if mando.LIVES <= 0:
gameEnd = endGame()
else:
board.updateClock()
board.printBoard(mando)
board.updateFrame(mando)
gameEnd = 0
return gameEnd
def startGame():
# create instances of mando'a and initialize the score to zero and what not
# Creating our character
jango = Mandalorian()
os.system('clear')
boardInstance = GameBoard(jango)
#for i in range(10):
while(1):
gameEnd = gameLoop(boardInstance, jango)
char = input.get()
if char == 'q':
gameEnd += endGame()
else:
mandoHandler(boardInstance, jango, char)
if gameEnd == 1:
break
# Run the LIVEs to 0 to check if it ends