0

I use assetmanager to load tmx, Some collectable object such as coin, need to be removed when hero touch it. So I destroy like this

object.setCell(x, y, null);

But when I restart the level game, those collectable coin doesn't appear because the cell was null. How can I reset those null cell object? Please help me

Nino Frenn
  • 61
  • 1
  • 9
  • 1
    By reloading the map. You should may have a "regular" one and one where you remove the tiles. Just deep copy the map before deleting tiles and whenever you create a new game you copy it again. A faster way would be to memorize what tiles you deleted and add them back after the game is done – bemeyer Feb 27 '16 at 17:29
  • @BennX Why not post it as answer? – Thorbjørn Lindeijer Feb 28 '16 at 10:55
  • @ThorbjørnLindeijer i dont think it is a real answer. It's just a kind of hint how it could possibly work. There are several ways and the programmer need to decide itself which way he want to go. There is no confirmation that it works as i said. Haven't tested it or anything. It's just a general idea. – bemeyer Feb 28 '16 at 10:57

0 Answers0