diff --git a/js/game.js b/js/game.js index db2a264..551a90a 100644 --- a/js/game.js +++ b/js/game.js @@ -220,13 +220,23 @@ function preload() { function create() { // Add the background sprite - background = game.add.sprite(0, 0, "bg"); + var background = game.add.sprite(0, 0, "bg"); // create our player - player = new Player(myId, Math.random() * 100, Math.random() * 100); + player = new Player(myId, game.world.centerX + (25 - Math.random() * 50),game.world.centerY + (25 - Math.random() * 50) ); // Get controls controls = game.input.keyboard.createCursorKeys(); + + // Create the text group + textGroup = game.add.group(); + + // Create our title text + var titleText= game.add.text(game.world.centerX,10,"FOODICATOR", {font: "65px Arial", fill: "#FFFFFF" }); + titleText.anchor.x = Math.round(titleText.width * 0.5) / titleText.width; + + // Add to our group + textGroup.add(titleText); } // On update @@ -238,4 +248,6 @@ function update() { // update our player player.update(); + // Bring the text group to the top + game.world.bringToTop(textGroup); } \ No newline at end of file