protected override void Initialize() { // TODO: Add your initialization logic here camera = new Camera(); int midX = GraphicsDeviceManager.DefaultBackBufferHeight / 2; int midY = GraphicsDeviceManager.DefaultBackBufferWidth / 2; Mouse.SetPosition(midX, midY); dalek = new Dalek(); dalek.pos = new Vector3(0, 0, 0); dalek.DrawAxis = true; children.Add(dalek); EnemyDalek enemy = new EnemyDalek(); enemy.pos = new Vector3(10, 0, -10); enemy.DrawAxis = true; children.Add(enemy); children.Add(camera); ground = new Ground(); children.Add(ground); base.Initialize(); }
public override void Update(GameTime gameTime) { Dalek player = XNAGame.Instance().Dalek; float timeDelta = (float)gameTime.ElapsedGameTime.TotalSeconds; // Calculate the look vector to make the AI Dalek point at the player dalek // if (look != basis) { float yawAngle = getYaw(); float pitchAngle = getPitch(); worldTransform = Matrix.CreateRotationX(pitchAngle) * Matrix.CreateRotationY(yawAngle) * Matrix.CreateTranslation(pos); } else { worldTransform = Matrix.CreateTranslation(pos); } }