added egg and moved stuff from main to player.js