Exemple #1
0
def get_keypad(numRings, rng):
    positions = (RingTracks.center,
     RingTracks.up,
     RingTracks.down,
     RingTracks.left,
     RingTracks.right,
     RingTracks.ul,
     RingTracks.ur,
     RingTracks.lr,
     RingTracks.ll)
    tracks = []
    usedPositions = [None]
    posScale = 0.7 + rng.random() * 0.2
    for i in xrange(0, numRings):
        pos = None
        while pos in usedPositions:
            pos = rng.choice(positions)

        usedPositions.append(pos)
        scaledPos = [0, 0]
        scaledPos[0] = pos[0] * posScale
        scaledPos[1] = pos[1] * posScale
        action = RingAction.RingActionStaticPos(scaledPos)
        track = RingTrack.RingTrack([action], [1.0])
        tracks.append(track)

    return (tracks, None, 1.0)
Exemple #2
0
def get_evenCircle_withStationaryCenterRings(numRings, rng):
    tracks = []
    tOffsets = []
    numCenterRings = rng.randint(1, numRings - 1)
    positions = getTightCircleStaticPositions(numCenterRings)
    for i in xrange(0, numCenterRings):
        action = RingAction.RingActionStaticPos(positions[i])
        track = RingTrack.RingTrack([action])
        tracks.append(track)
        tOffsets.append(0)

    numOuterRings = numRings - numCenterRings
    for i in xrange(0, numOuterRings):
        actions, durations = RingTracks.getCircleRingActions()
        track = RingTrack.RingTrack(actions, durations)
        tracks.append(track)
        tOffsets.append(float(i) / numOuterRings)

    return (tracks, tOffsets, fullCirclePeriod)