Jump to content

Black lines with Tilemaps


Go to solution Solved by rich,

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...