Greetings, game creators,
I have a question about creating a “breadcrumb” trail, and specifically with regard to setting up a direction for the player to follow.
Here’s the situation: it’s essentially an open world game. The player needs to follow markers to a dungeon entrance, as the markers point the way.
What I want to know is the mechanics for spawning a marker in relation to the 0 angle of the other marker, regardless of where that marker is pointing.
In other words, if the first marker is rotated to 90 degrees, I want the next marker to spawn at the 90 angle at which the previous marker is pointing, thus the “breadcrumb” trail designation.
Everything else I’m good with. If you know the formula for this, the assistance would be greatly appreciated.
Thank you
I’m not totally sure that I understand the question. It sounds like you just want to calculate the next marker position, based on the current marker’s angle?
If so, you could use the built in expressions XFromAngleAndDistance() and YFromAngleAndDistance(). These give a coordinate relative to 0,0. So if you wanted to get the new X position at 90 degrees with a distance of 64 pixels:
object X position = object.X() + XFromAngleAndDistance(90, 64)
I’ll try this out as soon as possible. Thank you!
I just realized there’s an even easier way to do it, look for the action “Put object around another”. It doesn’t make a huge difference but it will be more readable in the events, and you don’t have to write out any expressions
I’ll try this one as well. I’m still fooling with the “FromAngleAndDistance” to experiment how to get the second object to appear at the point of the first object (it’s basically an arrow pointing in a random direction, which should lead to the second object)
I have an alternate plan. Thank you for the suggestions!