Hello Stencyl Forums,
Lately, I've been working on some ideas I've had about AI and Pathfinding, since I really don't understand how to do smooth A* pathfinding in Stencyl. During my thoughts I've come to the conclusion that before doing pathfinding, I need to have a way to detect any collisions between two objects. For that I've made a 2x100 line and have already "coded" (It's more drag-and-drop, don't know how to call it) the position between the two objects and the size so that the two objects are connected through the line at all times. One problem that I've encountered, though, is that I do not know how to make the line face an actor that is moving all the time, while even the line itself is moving. That means I need a few blocks that do that and keep the line facing the actor. In the attachments you can find the blocks I've used and a video of what I already have.
Thanks in advance, Remade.
Blocks:
-Line Behavior
--Size:
http://puu.sh/iWlEI/13dba7c174.png--Position between the actors (+50 and +1 to get the exact middle):
http://puu.sh/iWlF2/5a57e52094.png-Positions of the blue actor
--Blocks to send position (+10 each because the actor is 20x20 big, thus it's the middle):
http://puu.sh/iWlKr/ac2a7f63a8.png--X and Y counters under the actor:
http://puu.sh/iWlPG/f2861dec6b.pngThe green actor has the exact same blocks.
In the actual game I will probably use lists where I save all the X and Y data, instead of using a seperate variable for all of them. I will also make a custom block for each of those chunks of blocks to make it easier for me to "code".