public PlayingStateClass(GraphicsDeviceManager graphics, GraphicsDevice device, ContentManager Content) { UsedKeys.Add("i", new Key(Keys.I, Key.type.always)); UsedKeys.Add("o", new Key(Keys.O, Key.type.always)); UsedKeys.Add("u", new Key(Keys.U, Key.type.always)); UsedKeys.Add("y", new Key(Keys.Y, Key.type.always)); UsedKeys.Add("w", new Key(Keys.W, Key.type.never)); UsedKeys.Add("a", new Key(Keys.A, Key.type.never)); UsedKeys.Add("s", new Key(Keys.S, Key.type.never)); UsedKeys.Add("d", new Key(Keys.D, Key.type.never)); UsedKeys.Add("space", new Key(Keys.Space, Key.type.never)); UsedKeys.Add("escape", new Key(Keys.Escape, Key.type.always)); UsedKeys.Add("mouse", new Key(true)); UsedKeys.Add("lmouse", new Key(false)); BlackTexture = new Texture2D(graphics.GraphicsDevice, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); Color[] colorArray = new Color[BlackTexture.Width * BlackTexture.Height]; for (int i = 0; i < colorArray.Length; i++) colorArray[i] = new Color(0, 0, 0, 0); BlackTexture.SetData(colorArray); screenCenter = new Vector2(graphics.GraphicsDevice.Viewport.Width, graphics.GraphicsDevice.Viewport.Height) / 2; rt = new RenderTarget2D(device, (int)(graphics.PreferredBackBufferWidth), (int)(graphics.PreferredBackBufferHeight * 1.5), false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8); camera = new Camera(graphics.GraphicsDevice, Content.Load<Model>("Models/PenguinFBX"), Content.Load<Effect>("RoomEffect"), false, false, true); room = new Room(Content.Load<Model>("Models/MainRoom"), Content.Load<Effect>("RoomEffect"), device); teleporter = new Teleporter(Content.Load<Model>("Models/teleporter"), new BasicEffect(device), room.bBoxManager.boundingBoxes, camera.characterOffset.Y); this.graphics = graphics; this.device = device; this.Content = Content; Vector3 mirrorPos_RightBottom = new Vector3(Math.Min(room.bBoxManager.boundingBoxes[8].Min.X, room.bBoxManager.boundingBoxes[8].Max.X), Math.Min(room.bBoxManager.boundingBoxes[8].Min.Y, room.bBoxManager.boundingBoxes[8].Max.Y), Math.Min(room.bBoxManager.boundingBoxes[8].Min.Z, room.bBoxManager.boundingBoxes[8].Max.Z)); Vector3 mirrorPos_LeftTop = new Vector3(Math.Max(room.bBoxManager.boundingBoxes[8].Min.X, room.bBoxManager.boundingBoxes[8].Max.X), Math.Max(room.bBoxManager.boundingBoxes[8].Min.Y, room.bBoxManager.boundingBoxes[8].Max.Y), Math.Min(room.bBoxManager.boundingBoxes[8].Min.Z, room.bBoxManager.boundingBoxes[8].Max.Z)); b = new BoundingBox(mirrorPos_RightBottom, mirrorPos_LeftTop); mirrorPos_Middle = new Vector3((room.bBoxManager.boundingBoxes[8].Min.X + room.bBoxManager.boundingBoxes[8].Max.X) / 2, (room.bBoxManager.boundingBoxes[8].Min.Y + room.bBoxManager.boundingBoxes[8].Max.Y) / 2, (room.bBoxManager.boundingBoxes[8].Min.Z + room.bBoxManager.boundingBoxes[8].Max.Z) / 2); camera.YrotationSpeed = (float)graphics.PreferredBackBufferWidth / 12000.0f; camera.XrotatiobSpeed = (float)graphics.PreferredBackBufferHeight / 13000.0f; }