def init(canvas): getNewRecipe(canvas) canvas.ingredientColor = None canvas.cupOnCounter = None canvas.onCounterCount = 0 myCauldron = cauldron.Cauldron(canvas) canvas.myCauldron = myCauldron drawScene(canvas)
def drawDynamicScene(canvas): # probably a whole different module cauldron = cauldron.Cauldron() cauldron.drawCauldron() if canvas.potionColor != None: cauldron.drawCauldronLiquid(canvas, canvas.potionColor) drawBottles(canvas) drawMeasuringCups(canvas) recipe = canvas.recipe recipe.checkRecipe(canvas, cauldron.inCauldron) recipe.displayProgress(canvas)
def keyPressed(event): canvas = event.widget.canvas if event.char == "r": canvas.ingredientColor = None canvas.cupOnCounter = None canvas.onCounterCount = 0 myCauldron = cauldron.Cauldron(canvas) canvas.myCauldron = myCauldron drawScene(canvas) if (event.char == "n"): #(canvas.recipe.complete == True) and getNewRecipe(canvas) init(canvas)
def init(canvas): getNewRecipe(canvas) canvas.ingredientColor = None canvas.cupOnCounter = None canvas.onCounterCount = 0 myCauldron = cauldron.Cauldron(canvas) canvas.myCauldron = myCauldron canvas.backgroundImage = PhotoImage(file="apothecaryBackground.gif") canvas.backgroundImage = canvas.backgroundImage.zoom(2, 2) canvas.ingredientsShelfImage = PhotoImage(file="ingredientsShelf.gif") canvas.measuresShelfImage = PhotoImage(file="measuresShelf.gif") canvas.personImage = PhotoImage(file="mcgontransp.gif") canvas.personImage = canvas.personImage.subsample(2, 2) canvas.woodCounter = PhotoImage(file="woodCounter.gif") drawScene(canvas)
def init(canvas, newRecipe): if newRecipe == "yes": getNewRecipe(canvas) canvas.progressMessage = "Let's get started making this potion!. \n Click anywhere to begin." canvas.ingredientColor = None canvas.cupOnCounter = None canvas.onCounterCount = 0 canvas.undoCount = 0 myCauldron = cauldron.Cauldron(canvas) canvas.myCauldron = myCauldron canvas.backgroundImage = PhotoImage(file="apothecaryBackground.gif") canvas.backgroundImage = canvas.backgroundImage.zoom(2, 2) canvas.ingredientsShelfImage = PhotoImage(file="ingredientsShelf.gif") canvas.measuresShelfImage = PhotoImage(file="measuresShelf.gif") canvas.personImage = PhotoImage(file="mcgontransp.gif") canvas.personImage = canvas.personImage.subsample(2, 2) canvas.woodCounter = PhotoImage(file="woodCounter.gif") drawScene(canvas) timerFired(canvas)
def clone(): n_cauldron = cauldron.Cauldron('cauldron', __file__) n_cauldron.set_description('iron cauldron', 'This is an iron cauldron.') n_cauldron.set_max_weight_carried(2000) n_cauldron.set_max_volume_carried(30) return n_cauldron