rickydamta Posted November 9, 2015 Share Posted November 9, 2015 Hi everyone.I am a newbie in phaser and in english I am making a tower defense game,and i need to make 2 different layers.One for the background and one for the sprites.How do I make that? Thanks Link to comment Share on other sites More sharing options...
chongdashu Posted November 9, 2015 Share Posted November 9, 2015 preload : function () { this.game.load("background", "res/background.png"); this.game.load("character", "res/character.png"); } create : function () { // create layers this.backgroundLayer = this.game.add.group(); this.spriteLayer = this.game.add.group(); // add stuff to layers var bg = this.backgroundLayer.create(this.game.with/2, this.game.height/2, "background"); var sprite1 = this.spriteLayer.create(0, 0, "character"); var sprite2 = this.spriteLayer.create(10, 0, "character"); var sprite3 = this.spriteLayer.create(20, 0, "character"); } WombatTurkey 1 Link to comment Share on other sites More sharing options...
rickydamta Posted November 9, 2015 Author Share Posted November 9, 2015 Thanks Link to comment Share on other sites More sharing options...
Recommended Posts