Jump to content

how to update tiled map graphic


nak3ddogs
 Share

Recommended Posts

how to update tiles graphic. 
i wanna make a platform what is blinking.
the collison work well
but 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

 Share

  • Recently Browsing   0 members

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