Here you go. Thanks
Code:
def shootBullet():
global nextBullet
#find the next available ball to shoot
bullet = bullets[nextBullet]
nextBullet = (nextBullet + 1) % NUM_BULLETS
#Calculate the vector of the ball based on the mouse position
bulletvector = viz.screentoworld(viz.mousepos()+[0])
bullet.vector = viz.Vector(bulletvector[3]-bulletvector[0],bulletvector[4]-bulletvector[1],bulletvector[5]-bulletvector[2])
bullet.vector.normalize()
bullet.vector *= BULLET_SPEED
#translate the bullet to the head position
bullet.translate(viz.get(viz.HEAD_POS))
#make the bullet and it's shadow visible
bullet.visible(viz.ON)
bullet.shadow.visible(viz.ON)
#mark the bullet as active
bullet.active = 1