Ejemplo n.º 1
0
 /// <summary>
 /// Used to moove the object. It makes it moove in the actual direction, with the actual speed.
 /// </summary>
 public void MooveObject(Collision c)
 {
     if (!c.SideCaseIsNotWall(this.direction, this))
     {
         this.direction = DIRECTION.NONE;
     }
     switch(this.direction)
     {
         case DIRECTION.DOWN:     
             this.position.Y += this.speed;
             break;
         case DIRECTION.UP:
             this.position.Y -= this.speed;
             break;
         case DIRECTION.LEFT:
             this.position.X -= this.speed;
             break;
         case DIRECTION.RIGHT:
             this.position.X += this.speed;
             break;
     }
 }