I have a couple ideas for some games but I'm not sure how to implement it. I was wondering if anyone had any suggestions.
Here is the basic idea.
I want the player to move around the edge of multiple rectangles. The rectangles can be any size and there can be multiple ones but the player sprite has to stay on the side. If the rectangles share a side the player can move to either rectangle
| | |
Would you set up each rectangle as an object then just check its bounds versus the players attempt at movement? For example if the player attempts to move Right, the code checks to see if the player coordinates are only the top or bottom plane of a rectangle? If the player is not on that plane, right is not allowed?
Is there a better way to set up a player path?