How to make something face a certain direction depending on where they are on one other sprite?

I'm making a game similar to the game Portal.
Left click to place blue portals.
Shift + left click to place orange portals.

Though portals don't work at the moment.
So, the problem is: sometimes the portal faces the wrong direction.
How do I make the portal face a certain direction depending on where they are on another sprite?

Instead of using the direction of the orb - maybe check to see what its touching

So check for touching any sprite or the edge

If its touching the edge - do a sub check on whether its on the left or right of the stage (so it should be vertical) and the same for the top/bottom but make it horizontal

split the box and floor into two sprites and then do similar checks for them - floor = horizontal - box =vertical

thats a ton of effort and messing around with the paint editor. is there an easier way?

Well its a bit of extra coding (not too much I don't think)

And don't think its a lot of work to duplicate your box sprite and them remove the floor from one and the box from the other

If you make some custom touching reporters for each of the edges (or one custom one with a menu would be better) - they could come in handy for future projects (or for someone else to use in their projects) :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.