nak3ddogs Posted September 28, 2014 Share Posted September 28, 2014 how to update tiles graphic. i wanna make a platform what is blinking.the collison work wellbut the alpha properties only work when the player overlapping the tile var mapArray = layer1.getTiles(0, 0, game.world.width, game.world.height);var segedTimer = 0;layer1.dirty= true;this.time.events.loop(1000, function(place){segedTimer++;if ((segedTimer % 2) > 0) { for (var i = 0; i < mapArray.length; i++) { if ( (mapArray[i].index >= 2) && (mapArray[i].index <= 6 ) ) { mapArray[i].alpha = 1; mapArray[i].setCollision(false, false, true, false); layer1.update(); layer1.dirty= true; }; }; } else { for (var i = 0; i < mapArray.length; i++) { if ( (mapArray[i].index >= 2) && (mapArray[i].index <= 6 ) ) { mapArray[i].alpha = 0.3; mapArray[i].setCollision(false, false, false, false); layer1.update(); layer1.dirty= true; }; }; }}, this); Link to comment Share on other sites More sharing options...
Recommended Posts