-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelpPage2.cs
More file actions
93 lines (85 loc) · 4.07 KB
/
HelpPage2.cs
File metadata and controls
93 lines (85 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace ShogiClient
{
/// <summary>
/// Help Page 2
/// </summary>
public class HelpPage2 : HelpPage
{
private UIMiniBoard lanceBoard;
private UIMiniBoard knightBoard;
private UIMiniBoard silverBoard;
public HelpPage2(GameResources resources, Game1 game) : base(resources, game)
{
lanceBoard = new UIMiniBoard(resources, 5, 5)
{
Position = new Vector2(Game.WindowSize.X / 4, 350),
DrawMovesPiece = new Point(2, 2),
Scale = new Vector2(2f, 2f)
};
lanceBoard.Data.SetAt(2, 2, new PieceData()
{
Type = PieceType.Lance,
IsPlayerOne = true,
});
knightBoard = new UIMiniBoard(resources, 5, 5)
{
Position = new Vector2(Game.WindowSize.X * 2 / 4, 350),
DrawMovesPiece = new Point(2, 2),
Scale = new Vector2(2f, 2f)
};
knightBoard.Data.SetAt(2, 2, new PieceData()
{
Type = PieceType.Knight,
IsPlayerOne = true,
});
knightBoard.Data.SetAt(1, 1, new PieceData()
{
Type = PieceType.Pawn,
IsPlayerOne = false,
});
knightBoard.Data.SetAt(2, 1, new PieceData()
{
Type = PieceType.Pawn,
IsPlayerOne = false,
});
knightBoard.Data.SetAt(3, 1, new PieceData()
{
Type = PieceType.Pawn,
IsPlayerOne = false,
});
silverBoard = new UIMiniBoard(resources, 5, 5)
{
Position = new Vector2(Game.WindowSize.X * 3 / 4, 350),
DrawMovesPiece = new Point(2, 2),
Scale = new Vector2(2f, 2f)
};
silverBoard.Data.SetAt(2, 2, new PieceData()
{
Type = PieceType.Silver,
IsPlayerOne = true,
});
}
public override void Draw(SpriteBatch spriteBatch)
{
var title = "The Pieces Part 2";
spriteBatch.DrawString(Resources.PieceFont, title, new Vector2(Game.WindowSize.X / 2, 150) - Resources.PieceFont.MeasureString(title) / 2, Color.White);
var lanceTitle = "Lance";
spriteBatch.DrawString(Resources.PieceFont, lanceTitle, new Vector2(Game.WindowSize.X / 4, 200) - Resources.PieceFont.MeasureString(lanceTitle) / 2, Color.White);
lanceBoard.Draw(spriteBatch);
var lanceDescription = "Similar to rook\nbut it can only move forward";
spriteBatch.DrawString(Resources.PieceFont, lanceDescription, new Vector2(Game.WindowSize.X / 4, 515) - Resources.PieceFont.MeasureString(lanceDescription) / 2, Color.White);
var knightTitle = "Knight";
spriteBatch.DrawString(Resources.PieceFont, knightTitle, new Vector2(Game.WindowSize.X * 2 / 4, 200) - Resources.PieceFont.MeasureString(knightTitle) / 2, Color.White);
knightBoard.Draw(spriteBatch);
var knightDescription = "Knights move in an L-shape\nand they can jump\nover other pieces";
spriteBatch.DrawString(Resources.PieceFont, knightDescription, new Vector2(Game.WindowSize.X * 2 / 4, 515) - Resources.PieceFont.MeasureString(knightDescription) / 2, Color.White);
var silverTitle = "Silver General";
spriteBatch.DrawString(Resources.PieceFont, silverTitle, new Vector2(Game.WindowSize.X * 3 / 4, 200) - Resources.PieceFont.MeasureString(silverTitle) / 2, Color.White);
silverBoard.Draw(spriteBatch);
var silverDescription = "Silvers can move in\nany diagonal direction and\nit can't move in any cardinal direction\nother than forward";
spriteBatch.DrawString(Resources.PieceFont, silverDescription, new Vector2(Game.WindowSize.X * 3 / 4, 535) - Resources.PieceFont.MeasureString(silverDescription) / 2, Color.White);
}
}
}