Revision 1733,
1.4 KB
checked in by tekrjant, 12 years ago
(diff) |
Lots of changes:
- Added camera
- Separate map and hud areas
- Saving happens on binary data instead of XML to save space. (And it gives more rep!.. maybe)
- And a 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 enum TileType |
---|
11 | { |
---|
12 | Grass = 1, |
---|
13 | Water = 2, |
---|
14 | Sand = 3, |
---|
15 | DarkGrass = 4, |
---|
16 | } |
---|
17 | public class Tile |
---|
18 | { |
---|
19 | public Vector2 Position { get { return new Vector2(Boundaries.X, Boundaries.Y); } set{} } |
---|
20 | public Rectangle Boundaries { get; set; } |
---|
21 | public int Width { get { return Boundaries.Width; } private set {} } |
---|
22 | public int Height { get { return Boundaries.Height; } private set { } } |
---|
23 | public Texture2D Image { get; set; } |
---|
24 | public bool Selected { get; set; } |
---|
25 | public TileType TileType { get; set; } |
---|
26 | |
---|
27 | public Tile(TileType tileType, Rectangle boundaries) |
---|
28 | { |
---|
29 | this.TileType = tileType; |
---|
30 | this.Boundaries = boundaries; |
---|
31 | } |
---|
32 | |
---|
33 | public Tile(Texture2D image, Vector2 position, int width, int height) |
---|
34 | { |
---|
35 | this.Image = image; |
---|
36 | this.Boundaries = new Rectangle((int)position.X, (int)position.Y, width, height); |
---|
37 | } |
---|
38 | |
---|
39 | //public void Draw(SpriteBatch sb) |
---|
40 | //{ |
---|
41 | // sb.Draw(this.Image, this.Boundaries, Color.White); |
---|
42 | // if (this.Selected) |
---|
43 | // sb.Draw(AdventureGame.selectionBox, this.Boundaries, Color.White); |
---|
44 | //} |
---|
45 | |
---|
46 | } |
---|
47 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.