|
|
|
@ -47,16 +47,18 @@ class Hangman(object):
|
|
|
|
|
self._fo_word= (15, -1) #(15, -1)
|
|
|
|
|
self._fo_word2= (15, 7) #(15,7)
|
|
|
|
|
#self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/nomenliste_de.txt"
|
|
|
|
|
#self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/crodict_nomen.txt"
|
|
|
|
|
#self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/wordsonly.txt"
|
|
|
|
|
self._wordlist="/root/mqtt-to-flipdot/hangman/wordlists/wordsonly.txt"
|
|
|
|
|
|
|
|
|
|
self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/nerdwords.txt"
|
|
|
|
|
#self._wordlist="/home/pi/mqtt-to-flipdot/hangman/wordlists/nerdwords.txt"
|
|
|
|
|
#self._wordlist="./hangman/wordlists/nerdwords.txt" #<- use for local testing
|
|
|
|
|
self._gamestate=0# 0=start 1=ingame 2=lose 3=win
|
|
|
|
|
self._g_word="test" #word
|
|
|
|
|
self._g_displword="" #display word
|
|
|
|
|
self._g_chars="" #used characters
|
|
|
|
|
|
|
|
|
|
self._hmdir="/home/pi/mqtt-to-flipdot/hangman/stdhm/"
|
|
|
|
|
# self._hmdir="/home/pi/mqtt-to-flipdot/hangman/stdhm/"
|
|
|
|
|
self._hmdir="/root/mqtt-to-flipdot/hangman/stdhm/"
|
|
|
|
|
#self._hmdir="./hangman/stdhm/" #<- use for local testing
|
|
|
|
|
|
|
|
|
|
self._hmimg=[]
|
|
|
|
@ -236,7 +238,7 @@ class Hangman(object):
|
|
|
|
|
|
|
|
|
|
#font = ImageFont.truetype("/usr/share/fonts/truetype/fonts-japanese-gothic.ttf", FONT_SIZE_word)
|
|
|
|
|
#font = ImageFont.truetype("hangman/alterebro-pixel-font.ttf", FONT_SIZE_word)
|
|
|
|
|
font = ImageFont.truetype("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf", FONT_SIZE_word)
|
|
|
|
|
font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf", FONT_SIZE_word)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (self._g_gamestate!=3):
|
|
|
|
@ -260,9 +262,10 @@ class Hangman(object):
|
|
|
|
|
|
|
|
|
|
#for i in range(0,len(s2)):
|
|
|
|
|
# draw.text((fo_word2[0]+i*5, fo_word2[1]), s2[i], font=font, fill=C_TEXT)
|
|
|
|
|
|
|
|
|
|
draw.text(self._fo_word, s1.upper(), font=font, fill=C_TEXT)
|
|
|
|
|
draw.text(self._fo_word2, s2.upper(), font=font, fill=C_TEXT)
|
|
|
|
|
if (len(s1)>0):
|
|
|
|
|
draw.text(self._fo_word, s1.upper(), font=font, fill=C_TEXT)
|
|
|
|
|
if (len(s2)>0):
|
|
|
|
|
draw.text(self._fo_word2, s2.upper(), font=font, fill=C_TEXT)
|
|
|
|
|
|
|
|
|
|
def _drawLoseScreen(self,draw):
|
|
|
|
|
self._drawGameScreen(draw)
|
|
|
|
|