Match UV movement to object movement

So… making a minimap using the following code:

def getVerts(gObj): #gObj is the owner of the controller, the plane with UV map of level map imprinted    mesh = gObj.meshes[0] #getting the meshes associated with the obj
    material = 0
    verts = [] #creating an empty to store the verts in 
    for ver in range(mesh.getVertexArrayLength(material)):
        vertex = mesh.getVertex(material, ver)
        verts.append(vertex) #appending the vertex to the list
    return verts

def miniMapUpdate():
    verts = getVerts(own) #getting all of our verts in the mesh
    for v in verts:
        uv = v.getUV()
        uv[1] -= 0.015 #need change of position here
        #second UV
        uv = v.getUV()
        uv[0] -= 1

Now I am trying to think of a way to tie the players world position (mainly change of) to the minimap uv’s… to change their direction based on player movement.

I suppose I could recall the function every time I press any of my movement keys, and estimate how much I should move each uv, but was hoping for a more elegant solution… is there one?

UV’s in the game engine are normalized so that 0 corresponds the the left side of the texture and 1 corresponds to the right side (or bottom and top respectively on the y-axis). This means that all you have to do to get the shift you need to divide the distance the player has moved by the size of the world on the respective axis.

For example, if the world is 100 blender-units wide and and the player moves 5 units to the right, you would simply need to shift the minimap UV’s 5/100 = 0.05 to the right on the x-axis.

Ah I see, so I essentially just need to say, create a global dictionary entry that runs every tic on my movement script, stores the player.worldPosition, then pushes the next player.worldPosition into the stack, then once it has two, does the math for the x and y, then throws out the z, takes each x and y, divides it by world size, stores to dictionary. Then my minimap script reads the dictionary, grabs the value and uses that to move the uvs the x and y distance… I think I can figure all of that out…