Ok, hopefully this will have a quick easy answer.
In my game I have doors, that slide up and down.
When the player presses A on a door, it opens, he automatically walks through, then the door closes.
I want to know what I should use for the collision with the door, as nothing will actually ever touch the door in between it's open and close states.
I just need some sort of object I can make, appear and then disappear quickly and efficiently.
Doors
Re: Doors
A kinematic box entity would do the trick.
To open/close the door, you could do any of the following:
-Remove/add the entity from the space.
-Set the entity.CollisionInformation.CollisionRules.Personal = CollisionRule.NoBroadPhase and then back to Defer or Normal to close.
-Actually slide the entity out of the way. This could be done with an EntityMover or direct velocity control. When acting on kinematic entities, an EntityMover will compute the exact velocity needed to reach the supplied goal state. If the 'slid up' position is given as the next frame's goal, the door will shoot up extremely fast. Any objects in collision with sufficient friction may get launched too. It would probably be best to define a gradual motion to avoid this.
-Teleport the entity out of the way by setting its Position directly. Teleport it back to close.
To open/close the door, you could do any of the following:
-Remove/add the entity from the space.
-Set the entity.CollisionInformation.CollisionRules.Personal = CollisionRule.NoBroadPhase and then back to Defer or Normal to close.
-Actually slide the entity out of the way. This could be done with an EntityMover or direct velocity control. When acting on kinematic entities, an EntityMover will compute the exact velocity needed to reach the supplied goal state. If the 'slid up' position is given as the next frame's goal, the door will shoot up extremely fast. Any objects in collision with sufficient friction may get launched too. It would probably be best to define a gradual motion to avoid this.
-Teleport the entity out of the way by setting its Position directly. Teleport it back to close.