Revision 1749,
1.3 KB
checked in by tekrjant, 10 years ago
(diff) |
Phew..
Changes:
- We now have a minimap
- Camera has been modified
- Lot of minor stuff
|
Line | |
---|
1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using System.Text; |
---|
5 | using Microsoft.Xna.Framework; |
---|
6 | using Microsoft.Xna.Framework.Graphics; |
---|
7 | |
---|
8 | namespace AdventureGame |
---|
9 | { |
---|
10 | public class MiniMap |
---|
11 | { |
---|
12 | private Map Map; |
---|
13 | private Dictionary<TileType, Color> tileColor; |
---|
14 | public Rectangle Boundaries { get; set; } |
---|
15 | public Texture2D Borders { get; set; } |
---|
16 | |
---|
17 | public MiniMap(Map fromMap, Viewport viewPort, Texture2D borders) |
---|
18 | { |
---|
19 | Map = fromMap; |
---|
20 | this.Boundaries = viewPort.Bounds; |
---|
21 | this.Borders = borders; |
---|
22 | } |
---|
23 | |
---|
24 | private void LoadColors() |
---|
25 | { |
---|
26 | tileColor = new Dictionary<TileType, Color>(); |
---|
27 | tileColor.Add(TileType.Grass, Color.Green); |
---|
28 | tileColor.Add(TileType.DarkGrass, Color.DarkGreen); |
---|
29 | tileColor.Add(TileType.Sand, Color.Yellow); |
---|
30 | tileColor.Add(TileType.Water, Color.Blue); |
---|
31 | } |
---|
32 | |
---|
33 | public void Draw(SpriteBatch sb) |
---|
34 | { |
---|
35 | foreach (Tile tile in Map.Tiles) |
---|
36 | { |
---|
37 | sb.Draw(Map.textureType[tile.TileType], tile.Boundaries, Color.White); |
---|
38 | } |
---|
39 | //sb.Draw(this.Borders, new Rectangle(0,0,200,200), Color.White); |
---|
40 | } |
---|
41 | |
---|
42 | } |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.