Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Update the Tilemap

hello,
i?ve a little problem by changing Tiles during Game.

That?s the code for changin a Tile on the players X and Y coordinates, to the empty tile ( on Top Left )
$game_map.data[$game_player.x,$game_player.y, 1] = 1

The first Layer ( 0 ) is filled with Magma. The Second layer ( 1 ) is filled with a roof autotile. Everytime the player presses ENTER or SPACE, the tile in his coordinates will be set to the empty one, so he can see the Magma below.

The Problem is on the following Screens:
That?s a screen how it should look like:
http://img291.imageshack.us/img291/1079/bsp1kz5.jpg[/IMG]

And that?s a screen, how it looks now:
http://img175.imageshack.us/img175/9885/bsp2xp0.jpg[/IMG]

Hav you seen the Problem?
Right.. The Autotile will not be updated, so it will not have the wall parts around the empty tile...


Question:
Is there a way to update the autotiles or the complete tilemap. So the autotiles will look like on the first screen?

thx for coming help.
 
Answer : not easily. You'll have to recalculate every tile around the modified one. Check sephirothspawn's multiple autotiles to have some clues on how to do that.

I think it won?t helpm me, because the maps in his scripts are starting with teh new autotiles.. In my Question, the palyer delets parts of the layer, so he delets parts of the autotile field in realtime... not at the Map startup.
 
That's what Rataime is saying. One of my last post is me showing a little secret behind how the autotile id is configured, depending on the surround autotiles. It isn't a simple task. You have to get the correct autotileid.

Now if you were using my Tilemap rewrite, then yes, you can use the Tilemap#refresh method from there, but we can't really see what would be required in EB's version to refresh the tilemap exact the update method.

But my best guesses it isn't updating because you are setting the right autotile id. If you set that right, it should work just fine.
 
But my best guesses it isn't updating because you are setting the right autotile id. If you set that right, it should work just fine.

Ok.. is it me ( german ) or do i really not understand him???

KK.. I use the rewrtitten Tilemap ( Basic and Flash ) in my Game.. but how can i update the Tilemap with it???
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top