Esempio n. 1
0
 public UserDisplay(XnaBasics game, SpriteBatch spriteBatch) : base(game)
 {
     this.spriteBatch = spriteBatch;
     SummonKey        = spawnKey;
     MoveLeft         = moveLeft;
     MoveRight        = moveRight;
     MoveUp           = moveUp;
     MoveDown         = moveDown;
     TwistKey         = twistKey;
     TurnKey          = turnKey;
     OpenDoor         = openDoor;
 }
Esempio n. 2
0
 private void turnKey()
 {
     key.TurnKey();
     if ((Math.Abs((key.yrotation % MathHelper.TwoPi) - MathHelper.PiOver2) < 0.1f) && cloister.unlockDoor(key.position.X, key.position.Y))
     {
         errorMessage = "Door unlocked!";
     }
     else
     {
         errorMessage = "Door was is still locked";
     }
     errorTime     = 5;
     lastDelCalled = TurnKey;
 }
Esempio n. 3
0
 private void openDoor()
 {
     if (cloister.openDoor())
     {
         key.Hide();
         key.TwistKey(-MathHelper.PiOver2);
         lastDelCalled = OpenDoor;
     }
     else
     {
         errorMessage = "Door is locked- cannot open!";
     }
     errorTime = 5;
 }
Esempio n. 4
0
 public String getDelegateDescription(StateManipDel smd)
 {
     if (smd == SummonKey)
     {
         return("This summons the key in front of you, or resets it to its original position.");
     }
     else if (smd == MoveLeft)
     {
         return("This moves the key to the left.");
     }
     else if (smd == MoveRight)
     {
         return("This moves the key to the right.");
     }
     else if (smd == MoveUp)
     {
         return("This moves the key up.");
     }
     else if (smd == MoveDown)
     {
         return("This moves the key down.");
     }
     else if (smd == TurnKey)
     {
         return("This turns the key. If in a lock, this will open it.");
     }
     else if (smd == TwistKey)
     {
         return("This spins the key around, so you can face it towards a lock.");
     }
     else if (smd == OpenDoor)
     {
         return("This opens the door, once it has been unlocked.");
     }
     else
     {
         return("");
     }
 }
Esempio n. 5
0
 private void twistKey()
 {
     key.TwistKey(MathHelper.PiOver2);
     lastDelCalled = TwistKey;
 }
Esempio n. 6
0
 private void moveDown()
 {
     key.Move(Vector3.Down * 20);
     lastDelCalled = MoveDown;
 }
Esempio n. 7
0
 private void moveUp()
 {
     key.Move(Vector3.Up * 20);
     lastDelCalled = MoveUp;
 }
Esempio n. 8
0
 private void moveRight()
 {
     key.Move(Vector3.Right * 20);
     lastDelCalled = MoveRight;
 }
Esempio n. 9
0
 private void moveLeft()
 {
     key.Move(Vector3.Left * 20);
     lastDelCalled = MoveLeft;
 }