Exemplo n.º 1
0
 internal void move(FlyingObject fo, WpfProject.Game.DIRECTION direction)
 {
     removeFromBoard(fo.shape);
     switch (direction)
     {
         case Game.DIRECTION.UP:
             fo.position = new Point(fo.position.X, fo.position.Y - fo.speed);
             break;
         case Game.DIRECTION.RIGHT:
             fo.position = new Point(fo.position.X + fo.speed, fo.position.Y);
             break;
         case Game.DIRECTION.DOWN:
             fo.position = new Point(fo.position.X, fo.position.Y + fo.speed);
             break;
         case Game.DIRECTION.LEFT:
             fo.position = new Point(fo.position.X - fo.speed, fo.position.Y);
             break;
     }
     setOnBoard(fo.shape, fo.position);
 }