0 Favourites

Physics door

This forum is currently in read-only mode.
  • Hey chaps.

    I am working on a top down game using physics.

    I am trying to make a 'Door', and am hoping someone has a good idea on how to control the physics objects.

    I have it set up as a hinge sprite and a door sprite currently(hinged), which works well for a free swinging door, but I do not know how to make specific control states, like a close/locked door.

    toggling the 'immovable' option breaks hinges.

    <img src="http://dl.dropbox.com/u/1487524/Scirra/PhysicsDoor.png" border="0" />

    This is the current set up, the red base is the hinge sprite, the green sprite is the door and the orange sprites are walls. I have created a small orange sprite as a sort of door stop to limit the angle range.

    Anyone have any ideas on how to make something like this?

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Put a Spring on the other side of the door, connected to the wall and increase the spring constant (k) whenever you need the door to "lock".

    For checking if the door is locked , you can simply check the value of the constant. A nice side effect is that, at lower values, you'll get an auto-close door.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
1,941 263,192
FlyingRam's avatar
FlyingRam
Unread hot topic
0 Favourites
[BEHAVIOR] Chipmunk Physics
673 82,470
nelostic's avatar
nelostic
Unread hot topic
0 Favourites
[BEHAVIOR] Sonic Physics
126 31,152
Ostrich10164's avatar
Ostrich10164