本文整理汇总了C#中Piece.moveRight方法的典型用法代码示例。如果您正苦于以下问题:C# Piece.moveRight方法的具体用法?C# Piece.moveRight怎么用?C# Piece.moveRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piece
的用法示例。
在下文中一共展示了Piece.moveRight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: key
public void key(Windows.System.VirtualKey e)
{
switch (e)
{
case Windows.System.VirtualKey.Space:
actions++;
Piece proj = this.board.projection(p);
this.points += 2*(proj.getRow()-p.getRow());
((TextBlock)tsp.FindName("pointsText")).Text = "Points :" + points.ToString();
this.p = proj;
this.moveDown();
ticks = 0;
//this.moveDown();
break;
case Windows.System.VirtualKey.Up:
actions++;
p.rotate_right();
if (this.board.intersectsAndOutOfBounds(p, 0, 0))//choca despues de intersectar
{
if (!this.board.intersectsAndOutOfBounds(p, -1, 0))
{
p.moveLeft();
break;
}
else if (!this.board.intersectsAndOutOfBounds(p, 1, 0))
{
p.moveRight();
break;
}
else if (!this.board.intersectsAndOutOfBounds(p, 2, 0))
{
p.moveRight();
p.moveRight();
break;
}
p.rotate_left();
}
break;
case Windows.System.VirtualKey.Down:
actions++;
this.points += 1;
((TextBlock)tsp.FindName("pointsText")).Text = "Points :" + this.points.ToString();
this.moveDown();
this.ticks = 0;
break;
case Windows.System.VirtualKey.Left:
actions++;
if (!this.board.intersectsAndOutOfBounds(p, -1, 0))
p.moveLeft();
break;
case Windows.System.VirtualKey.Right:
actions++;
if (!this.board.intersectsAndOutOfBounds(p, 1, 0))
p.moveRight();
break;
case Windows.System.VirtualKey.Shift:
break;
}
this.draw();
}