Dynamically Edit Terrain

0 favourites
  • 8 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • So I have a terrain script from ROjOhound and sqiddster, that I am using for my game. I am having some difficulties though. I made a event when the user clicks on a tile of a certain animation frame, it changes the frame. It works well, until the user leaves the area, then the bock re-appears like it was never altered. So my question would be how would I successfully remove the block? I have tried just destroying it, but it randomly teleports the player around the map. Recently I tried changing the opacity to 0, and if it was 0, make it not a solid, but that also didn't work. So I am out of ideas. Any help or suggestions would be greatly appreciated. The .capx is attached. Thank you, and if you need any more information I would be glad to help.

    Capx: https://docs.google.com/file/d/0B6WnVNPRul4sVVdXcExacE1NdjQ/edit?usp=sharing

    I use Google Drive, I hope that is okay.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Can you re-export without the clay.io being required? Can't open the file. Or is it necessary to test this?

  • It isn't. I am sorry, I re-uploaded. Here it is: docs.google.com/file/d/0B6WnVNPRul4sS2p6WUozUUJaNWM/edit

    You move with WASD or arrows, and break blocks with your left mouse button.

  • If anyone needs anything else from me, I will be glad to give it.

  • Do you know how arrays work? Because that will be necessary to do something like this.

  • I am familiar with them when using java. But I have not used them much in Construct 2. Is it the same thing?

  • yogert96

    It looks like the script is set up to "recalc" the tiles after they go offscreen by a certain amount. I suspect this is because it's a looping infinite tile system. If this wasn't done the world would slowly get emptier and emptier as you move along breaking blocks, since those empty blocks would be repeated when the terrain loops.

    So, if you try to fix this by modifying the recalc section you'll just have a different issue to deal with.

  • OK

    Venivididormi yes, you are correct. The game array is not infinite, just very large. So eventually, the world will loop back on itself.

    yogert96 to be honest, going about dynamically editing terrain will depend on R0J0hound 's implementation of my algorithm. i forget exactly how it worked, but I think you may need to add another, larger array to store all the game tiles.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)