Skip to content

Instantly share code, notes, and snippets.

@SpaceVoyager
Created October 8, 2016 19:11
Show Gist options
  • Save SpaceVoyager/93b353f61df1c133edf1387429409f12 to your computer and use it in GitHub Desktop.
Save SpaceVoyager/93b353f61df1c133edf1387429409f12 to your computer and use it in GitHub Desktop.
hangman.py
from scene import *
from ui import *
import speech
class MyScene (Scene):
def setup(self):
self.background_color = 'white'
keyboard_font = ('Futura', 40)
self.button_shape = ShapeNode(path=Path.rounded_rect(200, 250, 100, 80, 5), fill_color='blue', stroke_color='clear', parent=self)
self.button_shape.position = (self.size.w/2, self.size.h/2)
self.button_label = LabelNode('A', keyboard_font, parent=self)
self.button_label.position = (self.size.w/2, self.size.h/2)
self.button_label.color = 'white'
self.button_label.z_position = 1
run(MyScene())
'''
def newgame():
word = console.input_alert('Please enter a phrase you have in mind:')
return word
canvas.clear()
word = newgame()
font = 'Arial Rounded MT Bold'
canvas.draw_text(word, 50, 100, font_name=font, font_size=100)
word_len = len(word)
underscores = ''
for i in range(word_len):
underscores += '_ '
canvas.draw_text(underscores, 0, 200, font_name=font, font_size=100)
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment