first put you = null back the player function. then try making the enemy transparent to see if the target is inside him. if so, inscrease the temp.x value.