changing class instead of style.
make player object relative for easy calculation.
use functional object creation.
make player still in running state when moving to the edge.