@@ -936,7 +936,8 @@ def __init__(self, tutorial=False, debug=False):
936
936
else :
937
937
self .drop_constant = 1
938
938
while name_length == 0 :
939
- name_length = self .get_name ()
939
+ name = self .get_name ()
940
+ name_length = name [0 ]
940
941
if name_length == - 1 :
941
942
warning = "Are you sure you want to close the window? (Hit escape to cancel, enter to confirm)"
942
943
brlb .printf (self .screen_x // 2 - len (warning )// 2 , self .screen_y // 2 + 1 , warning )
@@ -949,6 +950,9 @@ def __init__(self, tutorial=False, debug=False):
949
950
elif key == brlb .TK_ESCAPE :
950
951
name_length = 0
951
952
break
953
+ else :
954
+ self .gamer = name [1 ]
955
+ print (self .gamer )
952
956
if name_length == - 1 :
953
957
brlb .close ()
954
958
return
@@ -1029,7 +1033,7 @@ def descend(self, game_start=False):
1029
1033
elif not game_start :
1030
1034
self .dungeon = self .dungeons [self .dungeons .index (self .dungeon ) + 1 ]
1031
1035
else :
1032
- self .dungeons .append (Dungeon (len (self .dungeons ) + 1 , name = self .dungeon_name ))
1036
+ self .dungeons .append (Dungeon (len (self .dungeons ) + 1 , name = self .dungeon_name , animate = False ))
1033
1037
self .dungeon = self .dungeons [- 1 ]
1034
1038
self .log .update ()
1035
1039
self .log .log ('Welcome to level {l} of ' .format (l = self .dungeon .level ) + self .dungeon .name )
@@ -1080,8 +1084,8 @@ def get_name(self):
1080
1084
brlb .color (brlb .color_from_argb (255 , 255 , 255 , 255 ))
1081
1085
brlb .layer (2 )
1082
1086
user_input = brlb .read_str (start_x , start_y , self .gamer , 24 )
1083
- # print(user_input)
1084
- return user_input [ 0 ]
1087
+ print (user_input )
1088
+ return user_input
1085
1089
# brlb.refresh()
1086
1090
1087
1091
@@ -1669,7 +1673,7 @@ def on_move_events(self):
1669
1673
character .map_direction = "up"
1670
1674
if self .character .hp <= 0 :
1671
1675
self .log .log (self .character .name .capitalize () + ' died' )
1672
- self .log .log (self .character .name .capitalize () + ' killed ' + str (self .kills ) + ' enemies' )
1676
+ self .log .log (self .character .name .capitalize () + ' killed ' + str (self .character . kills ) + ' enemies' )
1673
1677
self .end_game ()
1674
1678
moved_ids = []
1675
1679
for item in self .inventory .items :
0 commit comments