Exemplo n.º 1
0
def ShowStatus():
    """
    Displays the Spiral Size & Group Size
    """
    global grpSize, spiralSize

    tu3.clear()

    # Update Group Size
    pos = tf.PositionText(tt, txtPosition=1, vMargin=37)
    tf.GoToPos(tu3, pos)
    tf.ShowText(tu3,
                "Group Size: " + str(grpSize),
                txtAlign="left",
                fontColor="black",
                fontSize=14)

    # Update Speed Level Display
    pos = (pos[0], pos[1] - 25)
    tf.GoToPos(tu3, pos)
    tf.ShowText(tu3,
                "Spiral Size: " + str(spiralSize),
                txtAlign="left",
                fontColor="black",
                fontSize=14)
Exemplo n.º 2
0
def ShowStatus():
    """
    Displays the Spiral Size & Group Size
    """
    global grpSize, bendAngle

    tu3.clear()

    # Update Group Size
    pos = tf.PositionText(tt, txtPosition=1, vMargin=37)
    tf.GoToPos(tu3, pos)
    tf.ShowText(tu3,
                "Number Of Spokes: " + str(grpSize),
                txtAlign="left",
                fontColor="black",
                fontSize=14)

    # Update Kink Ange
    pos = (pos[0], pos[1] - 25)
    tf.GoToPos(tu3, pos)
    tf.ShowText(tu3,
                "Kink Angle: " + str(bendAngle),
                txtAlign="left",
                fontColor="black",
                fontSize=14)
Exemplo n.º 3
0
def DrawSpiral():
    global colorIndexSpiral, colorListSpiral, colorCountSpiral
    global colorIndexScreen, colorListScreen, colorCountScreen
    global musicIndex, musicCount, mVol
    global musicListFullPaths, musicListFileNames
    global isPlayOn, isExitMode, spiralSize, grpSize, spiralType
    """
    Apparently, global declaration is not needed for object variables.
    """
    while True:
        if isExitMode:
            break

        if not isPlayOn:
            # Discontinue & display Stop notice
            tu3.clear()
            pos = tf.PositionText(tt, txtPosition=1, vMargin=35)
            tf.GoToPos(tu3, pos)
            tf.ShowText(tu3,
                        "Play Stopped: Click RESUME To Start Afresh",
                        txtAlign="left",
                        fontColor="red",
                        fontSize=14)
            break

        # Display Status:
        ShowStatus()

        # Set screen color as per color list
        clr = colorListScreen[colorIndexScreen]
        ts.bgcolor(clr)

        # Set spiral color as per color list
        clr = colorListSpiral[colorIndexSpiral]
        rr = clr[0]
        gg = clr[1]
        bb = clr[2]

        DrawSpokeSpiral(tu1, cRed=rr, cGreen=gg, cBlue=bb)

        colorIndexSpiral = colorIndexSpiral + 1
        if colorIndexSpiral > (colorCountSpiral - 1):
            colorIndexSpiral = 0

        colorIndexScreen = colorIndexScreen + 1
        if colorIndexScreen > (colorCountScreen - 1):
            colorIndexScreen = 0

        time.sleep(2)
Exemplo n.º 4
0
tu1.pensize(2)  # For Spirals

# Hide Turtles
# For un-hiding the turtles, use showturtle command like tu1.st()
tu1.ht()
tu2.ht()
tu3.ht()
tu4.ht()

# Make Labels:
lbList = [["RESUME", "green"], ["STOP", "red"], ["BIGGER", "black"],
          ["SHORTER", "black"], ["MORE", "black"], ["LESS", "black"],
          ["EXIT", "red"]]

# txtPosition=1 results in positioning the text at top left corner.
pos = tf.PositionText(tt, txtPosition=1, vMargin=105)

for s in lbList:
    tf.GoToPos(tu2, pos)
    lbAreaList.append(
        tf.MakeLabel(tu2,
                     txtString=s[0],
                     txtAlign="center",
                     fontColor=s[1],
                     fontName="Times New Roman",
                     fontSize=14,
                     fontWt="bold",
                     labelWd=lbWidth,
                     labelHt=30,
                     borderThickness=4,
                     borderColor="blue",