/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); space = new Space(); space.ForceUpdater.Gravity = new Vector3(0, -9.8f, 0); LineDrawer = new BasicEffect(GraphicsDevice); //groundBox = new Box(Vector3.Zero, ground.width, 0.1f, ground.height); //space.Add(groundBox); cameraCylindar = new Cylinder(Camera.Position, 5, 2); space.Add(cameraCylindar); SkySphere skySphere = new SkySphere(); children.Add(skySphere); terrain = new Terrain(); children.Add(terrain); //createTower(); //createWall(); //jointDemo(); Font = Content.Load<SpriteFont>("Verdana"); brTexture = Content.Load<Texture2D>("saveMyBabies5"); crosshairs = Content.Load<Texture2D>("sprites_crosshairs"); foreach (GameEntity child in children) { child.LoadContent(); } }
protected override void Initialize() { // TODO: Add your initialization logic here camera = new Camera(); SkySphere skySphere = new SkySphere(); children.Add(skySphere); camera.pos = new Vector3(2, 20, 50); int midX = GraphicsDeviceManager.DefaultBackBufferHeight / 2; int midY = GraphicsDeviceManager.DefaultBackBufferWidth / 2; Mouse.SetPosition(midX, midY); children.Add(camera); Scenario.setUpPursuit(); //Scenario.setUpWander(); base.Initialize(); }