-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdonsol.py
More file actions
78 lines (60 loc) · 2.19 KB
/
Copy pathdonsol.py
File metadata and controls
78 lines (60 loc) · 2.19 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
73
74
75
76
77
78
#Donsol game
import random
import math
from time import sleep
import argparse
from blessed import Terminal
from game.models import *
parser = argparse.ArgumentParser()
TERM = Terminal()
def main():
print(TERM.enter_fullscreen)
print(TERM.clear)
dungeon = Dungeon()
renderer = Renderer(dungeon, TERM)
history = []
with TERM.cbreak():
keyval = ''
while keyval.lower() != 'q':
#HANDLE INPUT
dungeon.handle_input(keyval)
#RENDER
renderer.render()
# with TERM.location(margin,margin+2):
# if can_escape and PLAYER.health > 0:
# print( PALETTE['shield'] (TERM.black_on_white('f>') + ' flee'))
# else:
# print(TERM.black('f> flee'))
#
# #Print my stats!
# with TERM.location(y=margin*2):
# healthbar = '#' * PLAYER.health
# print(
# TERM.move_x(margin) + "HEALTH: " + str(PLAYER.health)
# + TERM.move_x(margin+12) + PALETTE['potion'] (healthbar)
# )
# if PLAYER.shield:
# if PLAYER.last_monster_value:
# print(TERM.move_x(margin) +
# "SHIELD: "
# + str(PLAYER.shield.value) + " "
# + TERM.move_x(margin+12) + PALETTE['shield'] ('#' * PLAYER.shield.value)
# + TERM.red(" ≠" + str(PLAYER.last_monster_value)))
#
# else:
# print(
# TERM.move_x(margin) + "SHIELD: " +
# str(PLAYER.shield.value) +
# TERM.move_x(margin+12) + PALETTE['shield'] ('#' * PLAYER.shield.value))
#
# #Print my messages!
# with TERM.location(y=margin*3):
# for message in history[-6:]:
# print(TERM.move_x(margin) + TERM.yellow(message))
#SLEEP before getting INPUT
# time.sleep(0.11)
#GET INPUT
keyval = TERM.inkey()
print(TERM.exit_fullscreen)
if __name__ == "__main__":
main()