def enter_roll_mode(): global scr global mode global form mode='roll' f.change_mode('window') f.wipe() f.frame('Roll your character') f.selector.wipe() f.text(20,50,'Choose your race:',fg='green',size=12) race_choice=f.selector(['human','orc','dwarf','elf','half-troll'],race_choice_agent) race_choice.activate(20,75) race_choice.focus(0) map=w.load_map() c=[rand(0,31),rand(0,31)] form['coord']=c #f.inform('Your coordinates are: '+str(c)) while (map[c[0]][c[1]]<40)|(map[c[0]][c[1]]>90): c=[rand(0,31),rand(0,31)] f.text(220,50,'Starting location:',fg='blue',size=12) f.text(240,80,'('+str(c[0])+','+str(c[1])+')',size=12) f.text(50,f.HEIGHT-50,"Press 's' to start...",fg='yellow',size=12) if map[c[0]][c[1]]<60: f.symbol(230//f.charsize,70//f.charsize+1,'+',color='green') else: f.symbol(230//f.charsize,70//f.charsize+1,'v',color='brown')
def enter_start_mode(): global scr global mode f.change_mode('window') f.wipe() mode='start' f.selector.wipe() f.frame('Welcome! I wish you die happily!') global main_menu main_menu=f.selector(['New game','Continue game','Create new world','Credits','Quit'],main_menu_agent,align='c',def_color='gray',act_color='red') main_menu.activate(f.WIDTH/2,f.HEIGHT/2-100) main_menu.focus(0)