rnzr Posted February 27, 2014 Share Posted February 27, 2014 hello, i'm kinda learning making games with phaser. till now i could resolve most of the problems i came across, but i dont get this one:the game consists of 32x32px tiles, which take the full space of the current game resolution (800x608px = 25x19 tiles).i wanted to scale the whole game up by the factor of 2. when i do, it looks (blurry but) fine, only the collision is out of place. it appears that the original (unscaled)tilemap/collision distribution is still active and just the graphics have scaled up but not their 'bodies'.would someone be so kind and give ma hint on how to fix this? thanks a lot!BasicGame.Game.prototype = { cursors:'', create: function() { console.log(this.currentLevel); this.cursors = this.game.input.keyboard.createCursorKeys(); this.map = this.game.add.tilemap('map_level0'+this.currentLevel); this.map.addTilesetImage('lametiles5','tiles'); /* tile layer stacking removed */ this.layer[2] = this.map.createLayer('ground'); this.layer[2].resizeWorld(); this.map.setCollision([2,3],true,'ground'); this.player = this.game.add.sprite(100,1,'player'); this.player.body.gravity.y = 250; this.player.body.collideWorldBounds = true; this.player.animations.add('left',[0,1,2,3],10,true); this.player.animations.add('right',[5,6,7,8],10,true); }, update: function() { this.world.scale.x = 2; this.world.scale.y = 2; this.game.physics.collide(this.player,this.layer[2]); this.checkInputs(); }, Link to comment Share on other sites More sharing options...
rich Posted February 27, 2014 Share Posted February 27, 2014 1.1.6 doesn't support scaled tilemaps, sorry - and this is effectively what you're creating when you scale the world object directly. rnzr 1 Link to comment Share on other sites More sharing options...
Recommended Posts