The world is initially a rectangle. The player can move on the world border and then "cut" the world via orthogonal paths (not oblique). When the player reaches the border again I have a list of path segments they just made.
I'm trying to calculate and compare the two areas created by the path cut and select the smaller one to remove it from world.
After the first iteration, the world is no longer a rectangle and player must move on border of this new shape.
How can I do this? Is it possible to have a non rectangular path? How can I move the player character only on path?
EDIT
Here you see an example of what I'm trying to achieve:
Initial screen layout.
Character moves inside the world and than reaches the border again.
Segment of the border present in the smaller area is deleted and last path becomes part of the world border.
Character moves again inside the world.
Segments of border present in the smaller area are deleted etc.
No comments:
Post a Comment