Stencyl 3.4.0 is now out. Get it now!

Find distance from specific tile,

squeeb

  • Posts: 898
How do you find the distance between an actor and a specific tile? 
Also are there any performance issues dynamically generating tiles and removing them as the game is played?  Or is there a way to change animations for tiles?

JeffreyDriver

  • Posts: 898
Might the Easy Math extension help you? There's a block that will find the distance between two XY values.  If you can get the XY value of a tile, that should work?

decafpanda

  • *
  • Posts: 119
Could you not make an invisible doodad actor and place it on the tile you want to reference?  At that point you could gain an easy reference to the actor and thus gain a reference to the tile.

Or maybe I am not fully grasping exactly what you are trying to do


squeeb

  • Posts: 898
Hmm.. I want to change the tile animation or replace a tile when the player is close to it..  thinking something of this sort.. but just replacing tiles or their animations

squeeb

  • Posts: 898
Might the Easy Math extension help you? There's a block that will find the distance between two XY values.  If you can get the XY value of a tile, that should work?
Good thinking... that may work.. I'll dig in and see what I can find.

JeffreyDriver

  • Posts: 898
You can also get the XY value of your actor and use it to check for tiles around it. I did something similar when creating a snap-to-grid movement system. See the screenshot here: http://community.stencyl.com/index.php/topic,50772.msg280695.html#msg280695

squeeb

  • Posts: 898
Ok.. I can try that way also... is there any way to change the animation of a tile with a block?. like we would an actor.. or would it be best to swap to another tile to create the 3d transition

LIBERADO

  • *
  • Posts: 2137
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

squeeb

  • Posts: 898
is there any way to change the animation of a tile with a block?
http://community.stencyl.com/index.php?issue=521.0
Yes! That's exactly what I want!  Hmm... looks like the way to do that is to create an extension with custom blocks?  Or use actor as the ground.  :/  would that be taxing on performance?

LIBERADO

  • *
  • Posts: 2137
For better performance, you could replace tiles at runtime instead of using actors as the ground.

« Last Edit: April 19, 2017, 04:18:41 pm by LIBERADO »
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.