Jump to content

Black lines with Tilemaps


Mefteg
 Share

Recommended Posts

Hello,

 

I'm trying to make a simple game based on tilemaps and I have a problem.

When I move my character (to the right for example), I can see black lines on the border of the game ( link here ). Same thing happens on the Sci Fly example ( link here ).

 

My tilemap has a size of 100x100 tiles and a tile size is 16x16px.

 

You can move the "player" with arrows.

 

post-5541-0-04063200-1389190710.png

 

Here is my code that create the level :

Level.prototype.preload = function() {    console.log("Level - preload");    this.game.load.tilemap('zelda_tilemap', 'images/game/zelda_tilemap.json', null, Phaser.Tilemap.TILED_JSON);    this.game.load.tileset('zelda_tileset', 'images/game/zelda_tileset.png', 16, 16);    this.background.preload();    this.player.preload();}Level.prototype.create = function() {    console.log("Level - create");    this.map = this.game.add.tilemap('zelda_tilemap');    this.tileset = this.game.add.tileset('zelda_tileset');    var layerBackground = this.game.add.tilemapLayer(0, 0,        this.game.camera.width, this.game.camera.height,        this.tileset, this.map, 0);    this.background.create(layerBackground);    this.player.create();    this.game.camera.follow(this.player.sprite);    this.game.camera.deadzone = new Phaser.Rectangle(120, 80, 400, 200);    this.game.camera.focusOnXY(0, 0);}Level.prototype.update = function() {    this.player.update();}

Thank you.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...