>
> > in this small tutorial game that I made, all the solids is one tilemap (just one object), then I "cover" it with another tilemap. so, with 2 objects, I get all the static solids of the game. you can download the source code of the game and see how I made it. <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">
> >
> > https://www.scirra.com/arcade/tutorial- ... game-10855
> >
>
> Not bad! I like the music and visual style. What happens if you want to remove a brick? Can you edit the tilemap during runtime? When the brick shows cracks are you just spawning a sprite on top of the tilemap?
>
Yes, you can destroy it. You need to do a few things before anything:
1- Solid tilemap and the respective Tilemap with all the graphics must have the same size.
2- The same for the array. (e.g an array with 50 width and 20 height correspond to a tilemap of 1600 by 640 if tiles measure 32px (50*32 = 1600 and 32*20 = 640)
3- once done it all your map will be manageable because you now can use your array since every cell of the array correspond to a tile on the screen.
4-If you want to destroy some foliage on the map with your bullet... on destroy get the bullet's position, convert the x and y coordinate into tiles and now you know which tile to destroy.
Let me know if an example in capx is needed.
Good advice! I think I will use this technique in my game <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">