ekeimaja Posted October 25, 2015 Share Posted October 25, 2015 Why is Phaser duplicating this sprite? It makes it like this in any scale mode. How can I get it appear only one? Link to comment Share on other sites More sharing options...
megmut Posted October 25, 2015 Share Posted October 25, 2015 Can you show your code please? Thanks Link to comment Share on other sites More sharing options...
ekeimaja Posted October 25, 2015 Author Share Posted October 25, 2015 in main.js isnew Phaser.Game(707,550, Phaser.AUTO, '');That is size of that image. in boot.js isthis.scale.scaleMode = Phaser.ScaleManager.NO_SCALE;in game.js isthis.katu = this.game.add.tileSprite(0, 0, 707, 550, 'katu');That road sprite should appear only once and slide downwards in constant speed. My other game, I have created with same template, works normally. Link to comment Share on other sites More sharing options...
chongdashu Posted October 25, 2015 Share Posted October 25, 2015 What is the size of your road sprite? It looks as if your road sprite is smaller in height than your game height. And since you are using a tile sprite, wouldn't it end up tiling and appearing more than once? Link to comment Share on other sites More sharing options...
ekeimaja Posted October 25, 2015 Author Share Posted October 25, 2015 Now I shrinked that sprite a bit. Now it makes this if window is inactive. http://www.youtube.com/watch?v=iADCYEiMBxY Link to comment Share on other sites More sharing options...
chongdashu Posted October 25, 2015 Share Posted October 25, 2015 I think you're going to need to provide more specific information (e.g., your code that's doing the creation, update, etc.) before we can really suggest things to take a look at. Link to comment Share on other sites More sharing options...
ekeimaja Posted October 26, 2015 Author Share Posted October 26, 2015 main.jsnew Phaser.Game(707,442, Phaser.AUTO, '');boot.js create: function() { this.scale.scaleMode = Phaser.ScaleManager.NO_SCALE; this.physics.startSystem(Phaser.Physics.ARCADE); this.state.start('preload'); }preload.js is just load files andthis.scale.pageAlignHorizontally = true;game1.jscreate: function(){ this.katu = this.game.add.tileSprite(0, 0, 707, 442, 'katu'); },update: function(){ this.katu.tilePosition.y += 1; } Link to comment Share on other sites More sharing options...
chongdashu Posted October 26, 2015 Share Posted October 26, 2015 Can you upload or specify the dimensions of your "katu" image, please? Link to comment Share on other sites More sharing options...
ekeimaja Posted October 26, 2015 Author Share Posted October 26, 2015 Here: http://s3.postimg.org/o5u2t9moz/katu.png dimensions are 707 x 442 px Link to comment Share on other sites More sharing options...
ekeimaja Posted October 27, 2015 Author Share Posted October 27, 2015 Still wondering why this is not working, when my other game made like this works normally. Link to comment Share on other sites More sharing options...
jmp909 Posted October 28, 2015 Share Posted October 28, 2015 if your game canvas is only 707x442 why is there the other image below it? on the video the top half looks like it is your game, the bottom half with the static image... i don't know what that is http://phaser.io/sandbox/SkuqprQw/play Link to comment Share on other sites More sharing options...
ekeimaja Posted October 30, 2015 Author Share Posted October 30, 2015 Problem solved. I had put main.js twice in index.html. Link to comment Share on other sites More sharing options...
Recommended Posts