Exemplo n.º 1
0
def init(canvas):
    getNewRecipe(canvas)
    canvas.ingredientColor = None
    canvas.cupOnCounter = None
    canvas.onCounterCount = 0
    myCauldron = cauldron.Cauldron(canvas)
    canvas.myCauldron = myCauldron
    drawScene(canvas)
Exemplo n.º 2
0
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)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
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)
Exemplo n.º 5
0
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)
Exemplo n.º 6
0
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