public WorldComponent(DemoGame game) : base(game) { _game = game; _game.World = new World { Boxes = new List<Box>(), }; _game.World.Units = new List<Unit> { new Player(_game) { Position = new Vector3(50f,10f,50f) }, new Warrior(_game) { Position = new Vector3(60f,0f,60f) }, new Warrior(_game) { Position = new Vector3(70f,0f,70f) }, new Warrior(_game) { Position = new Vector3(80f,0f,80f) } }; _game.World.Terrain = new Terrain(_game, 100, 100) { LandTexture = _game.Content.Load<Texture2D>("land") }; }
public DebugInfoComponent(DagonGame game, Unit player) : base(game) { _spriteBatch = new SpriteBatch(game.GraphicsDevice); _font = game.Content.Load<SpriteFont>("arial"); _unit = player; _fps = 0; _frameCounter = 0; }
public FreeCamera(DagonGame game) { _projection = Matrix.CreatePerspectiveFieldOfView( game.Settings.FieldOfView, game.GraphicsDevice.Viewport.AspectRatio, 0.1f, game.Settings.RangeOfVisibility); _view = Matrix.CreateLookAt(new Vector3(8, 3, 8), new Vector3(5, 3, 5), Vector3.Up); }
public FirstPersonCamera(DagonGame game, Unit unit) { _unit = unit; _projection = Matrix.CreatePerspectiveFieldOfView( game.Settings.FieldOfView, game.GraphicsDevice.Viewport.AspectRatio, 0.1f, game.Settings.RangeOfVisibility); }
public AxiesComponent(DagonGame game) : base(game) { _game = game; _basicEffect = new BasicEffect(game.GraphicsDevice) { VertexColorEnabled = true }; vertexData = new VertexPositionColor[6]; vertexData[0] = new VertexPositionColor(new Vector3(0f, 0f, 0f), Color.Red); vertexData[1] = new VertexPositionColor(new Vector3(Length, 0f, 0f), Color.Red); vertexData[2] = new VertexPositionColor(new Vector3(0f, 0f, 0f), Color.Green); vertexData[3] = new VertexPositionColor(new Vector3(0f, Length, 0f), Color.Green); vertexData[4] = new VertexPositionColor(new Vector3(0f, 0f, 0f), Color.Blue); vertexData[5] = new VertexPositionColor(new Vector3(0f, 0f, Length), Color.Blue); }
public SpriteUnit(DagonGame game, Texture2D texture) : base(game) { _texture = texture; _spriteBatch = new SpriteBatch(_game.GraphicsDevice); _basicEffect = new BasicEffect(_game.GraphicsDevice) { TextureEnabled = true, VertexColorEnabled = true, FogEnabled = true, FogStart = game.Settings.RangeOfVisibility / 3f, FogEnd = game.Settings.RangeOfVisibility, FogColor = game.World.SkyColor.ToVector3() }; }
public Player(DagonGame game) : base(game) { }
public Warrior(DagonGame game) : base(game, game.Content.Load<Texture2D>("warrior")) { Speed = 0.001f; }