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

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...
 Share

  • Recently Browsing   0 members

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