Huww Posted March 23, 2014 Share Posted March 23, 2014 Hey, so I was testing out some stuff for a possible game Idea I have which involves having a 'wall' of randomly jumbled blocks in it. I've only been learning javascript for a very short amount of time and only used Phaser as of today.I managed to create this 'wall' using the below code (feel free to point out any mistakes or improvements I could make):for (i=0;i<gridX.length;i++){ for (j=0;j<gridY.length;j++){ this.game.add.sprite(gridX[i], gridY[j],blocks[Math.floor((Math.random()*blocks.length))]); } } This wasn't the problem, the problem occurs when the blocks 'spawn'. Each block should have a black 1 pixel thick border, however some only have partial borders or nothing at all, more noticeably the pink and orange blocks.Any help would be greatly appreciated. Thanks! EDIT: I spread them out more and can now see black on all sides, however the bottom and left sides all seem darker/more visible still? Link to comment Share on other sites More sharing options...
rich Posted March 23, 2014 Share Posted March 23, 2014 It's possible the black is being aliased out. You could try adding this in your code: game.stage.smoothed = false; Link to comment Share on other sites More sharing options...
Huww Posted March 23, 2014 Author Share Posted March 23, 2014 Still the same Is this a valid place to put it though? Link to comment Share on other sites More sharing options...
rich Posted March 23, 2014 Share Posted March 23, 2014 Yeah that's fine. It only really makes a difference in WebGL mode anyway. Is your canvas being displayed at the right size? I mean are you passing in a fixed value to the game constructor? (like in the way all the examples use 800x600). Is your game being stretched / expanded at all? Also which browser? Maybe try uploading it somewhere and post here, could iron out if this is local to a bigger issue. Link to comment Share on other sites More sharing options...
Huww Posted March 23, 2014 Author Share Posted March 23, 2014 (edited) I've changed nothing and it's seemed to randomly improve.... However the left/bottom sides still look bolder.I'll upload it to dropbox in a minute. EDIT: I can't figure out how to do a direct link so it goes to the game, but: https://www.dropbox.com/sh/excvhfbejx7cwqz/pYPc-Yv97S Edited March 23, 2014 by Huww Link to comment Share on other sites More sharing options...
Recommended Posts