/// <summary> /// Код дизайнера всех базовых окон /// </summary> private void WindowsDesigner() { Manager = new Manager(this, graphics, "Default"); Manager.Initialize(); #region mainmenu mainmenu = new Window(Manager) {BackColor = Color.Black}; mainmenu.Init(); mainmenu.Text = ""; mainmenu.SetPosition(resx/3, resy/4); mainmenu.Width = resx/3; mainmenu.Height = resy/2; mainmenu.Visible = true; mainmenu.BorderVisible = false; mainmenu.Movable = false; mainmenu.Resizable = false; mainmenucloseB = new Button(Manager); mainmenucloseB.Init(); mainmenucloseB.Text = "Quit"; mainmenucloseB.Width = resx/5; mainmenucloseB.Height = 25; mainmenucloseB.Left = (resx/3 - resx/5)/2; mainmenucloseB.Top = mainmenu.ClientHeight - mainmenucloseB.Height - 8; mainmenucloseB.Anchor = Anchors.Bottom; mainmenucloseB.Parent = mainmenu; mainmenucloseB.Click += button_Click; mainmenugeneratenewB = new Button(Manager); mainmenugeneratenewB.Init(); mainmenugeneratenewB.Text = "Создать новый мир и начать игру"; mainmenugeneratenewB.Width = resx/5; mainmenugeneratenewB.Height = 25; mainmenugeneratenewB.Left = (resx/3 - resx/5)/2; mainmenugeneratenewB.Top = 50; mainmenugeneratenewB.Anchor = Anchors.Bottom; mainmenugeneratenewB.Parent = mainmenu; mainmenugeneratenewB.Click += mainmenugeneratenewB_Click; mainmenuloadmapB = new Button(Manager) {Text = "Начать игру в созданном мире", Width = resx/5}; mainmenuloadmapB.Init(); mainmenuloadmapB.Height = 25; mainmenuloadmapB.Left = (resx/3 - resx/5)/2; mainmenuloadmapB.Top = 100; mainmenuloadmapB.Anchor = Anchors.Bottom; mainmenuloadmapB.Parent = mainmenu; mainmenuloadmapB.Click += mainmenuloadmapB_Click; mainmenuloadgameB = new Button(Manager); mainmenuloadgameB.Init(); mainmenuloadgameB.Text = "Загрузить игру"; mainmenuloadgameB.Width = resx/5; mainmenuloadgameB.Height = 25; mainmenuloadgameB.Left = (resx/3 - resx/5)/2; mainmenuloadgameB.Top = 150; mainmenuloadgameB.Anchor = Anchors.Bottom; mainmenuloadgameB.Parent = mainmenu; mainmenuloadgameB.Click += mainmenuloadgameB_Click; mainmenuoptionsB = new Button(Manager); mainmenuoptionsB.Init(); mainmenuoptionsB.Text = "Опции"; mainmenuoptionsB.Width = resx/5; mainmenuoptionsB.Height = 25; mainmenuoptionsB.Left = (resx/3 - resx/5)/2; mainmenuoptionsB.Top = 200; mainmenuoptionsB.Anchor = Anchors.Bottom; mainmenuoptionsB.Parent = mainmenu; mainmenuoptionsB.Click += mainmenuoptionsB_Click; Manager.Add(mainmenu); #endregion #region generateoptionsmenu generateoptionsmenu = new Window(Manager) {BackColor = Color.Black}; generateoptionsmenu.Init(); generateoptionsmenu.Text = ""; generateoptionsmenu.SetPosition(resx/3, resy/4); generateoptionsmenu.Width = resx/3; generateoptionsmenu.Height = resy/2; generateoptionsmenu.Visible = false; generateoptionsmenu.BorderVisible = false; generateoptionsmenu.Movable = false; generateoptionsmenu.Resizable = false; generateoptionnextB = new Button(Manager); generateoptionnextB.Init(); generateoptionnextB.Text = "Продолжить"; generateoptionnextB.Width = resx/5; generateoptionnextB.Height = 25; generateoptionnextB.Left = (resx/3 - resx/5)/2; generateoptionnextB.Top = 50; generateoptionnextB.Anchor = Anchors.Bottom; generateoptionnextB.Parent = generateoptionsmenu; generateoptionnextB.Click += generateoptionnextB_Click; generateoptionbackB = new Button(Manager); generateoptionbackB.Init(); generateoptionbackB.Text = "Назад"; generateoptionbackB.Width = resx/5; generateoptionbackB.Height = 25; generateoptionbackB.Left = (resx/3 - resx/5)/2; generateoptionbackB.Top = generateoptionsmenu.ClientHeight - generateoptionbackB.Height - 8; generateoptionbackB.Anchor = Anchors.Bottom; generateoptionbackB.Parent = generateoptionsmenu; generateoptionbackB.Click += generateoptionbackB_Click; Manager.Add(generateoptionsmenu); #endregion #region generationMenu generationMenu = new Window(Manager) {BackColor = Color.Black}; generationMenu.Init(); generationMenu.Text = ""; generationMenu.SetPosition(20, 20); generationMenu.Width = resx/6; generationMenu.Height = 300; generationMenu.Visible = false; generationMenu.BorderVisible = false; generationMenu.Movable = false; generationMenu.Resizable = false; generationbegingameB = new Button(Manager); generationbegingameB.Init(); generationbegingameB.Text = "Начать игру"; generationbegingameB.Width = resx/8; generationbegingameB.Height = 25; generationbegingameB.Left = (resx/6 - resx/8)/2; generationbegingameB.Top = 50; generationbegingameB.Anchor = Anchors.Bottom; generationbegingameB.Parent = generationMenu; generationbegingameB.Click += generationbegingameB_Click; generationgenerateB = new Button(Manager); generationgenerateB.Init(); generationgenerateB.Text = "Генерировать"; generationgenerateB.Width = resx/8; generationgenerateB.Height = 25; generationgenerateB.Left = (resx/6 - resx/8)/2; generationgenerateB.Top = 80; generationgenerateB.Anchor = Anchors.Bottom; generationgenerateB.Parent = generationMenu; generationgenerateB.Click += generationgenerateB_Click; generationNormalMapB = new Button(Manager); generationNormalMapB.Init(); generationNormalMapB.Text = "Обычная карта"; generationNormalMapB.Width = resx/8; generationNormalMapB.Height = 25; generationNormalMapB.Left = (resx/6 - resx/8)/2; generationNormalMapB.Top = 110; generationNormalMapB.Anchor = Anchors.Bottom; generationNormalMapB.Parent = generationMenu; generationNormalMapB.Click += generationnormalmapB_Click; generationheightmapB = new Button(Manager); generationheightmapB.Init(); generationheightmapB.Text = "Карта высот"; generationheightmapB.Width = resx/8; generationheightmapB.Height = 25; generationheightmapB.Left = (resx/6 - resx/8)/2; generationheightmapB.Top = 140; generationheightmapB.Anchor = Anchors.Bottom; generationheightmapB.Parent = generationMenu; generationheightmapB.Click += generationheightmapB_Click; generationtempmapB = new Button(Manager); generationtempmapB.Init(); generationtempmapB.Text = "Карта температур"; generationtempmapB.Width = resx/8; generationtempmapB.Height = 25; generationtempmapB.Left = (resx/6 - resx/8)/2; generationtempmapB.Top = 170; generationtempmapB.Anchor = Anchors.Bottom; generationtempmapB.Parent = generationMenu; generationtempmapB.Click += generationtempmapB_Click; generationbackB = new Button(Manager); generationbackB.Init(); generationbackB.Text = "Назад"; generationbackB.Width = resx/8; generationbackB.Height = 25; generationbackB.Left = (resx/6 - resx/8)/2; generationbackB.Top = 200; generationbackB.Anchor = Anchors.Bottom; generationbackB.Parent = generationMenu; generationbackB.Click += generationbackB_Click; generateoption = new TrackBar(Manager); generateoption.Init(); generateoption.Top = 230; generateoption.Left = (resx/6 - resx/8)/2; generateoption.Width = resx/8; generateoption.Height = 25; generateoption.Parent = generationMenu; generateoption.ValueChanged += generateoption_ValueChanged; generateoptionlabel = new Label(Manager); generateoptionlabel.Init(); generateoptionlabel.Top = 250; generateoptionlabel.Left = (resx/6 - resx/8)/2; generateoptionlabel.Width = resx/8; generateoptionlabel.Height = 25; generateoptionlabel.Parent = generationMenu; Manager.Add(generationMenu); #endregion #region mapload maploadmenu = new Window(Manager) {Color = Color.Black}; maploadmenu.Init(); maploadmenu.Text = ""; maploadmenu.SetPosition(resx/3, resy/4); maploadmenu.Width = resx/3; maploadmenu.Height = resy/2; maploadmenu.Visible = false; maploadmenu.BorderVisible = false; maploadmenu.Movable = false; maploadmenu.Resizable = false; maploadmenuLoad = new Button(Manager); maploadmenuLoad.Init(); maploadmenuLoad.Text = "Назад"; maploadmenuLoad.Width = resx/5; maploadmenuLoad.Height = 25; maploadmenuLoad.Left = (resx/3 - resx/5)/2; maploadmenuLoad.Top = maploadmenu.ClientHeight - maploadmenuLoad.Height - 8; maploadmenuLoad.Anchor = Anchors.Bottom; maploadmenuLoad.Parent = maploadmenu; maploadmenuLoad.Click += maploadmenuLoad_Click; maploadmenuLoadNext = new Button(Manager); maploadmenuLoadNext.Init(); maploadmenuLoadNext.Text = "Далее"; maploadmenuLoadNext.Width = resx/5; maploadmenuLoadNext.Height = 25; maploadmenuLoadNext.Left = (resx/3 - resx/5)/2; maploadmenuLoadNext.Top = maploadmenu.ClientHeight - maploadmenuLoad.Height - 8 - 30; maploadmenuLoadNext.Anchor = Anchors.Bottom; maploadmenuLoadNext.Parent = maploadmenu; maploadmenuLoadNext.Click += maploadmenuLoadNext_Click; maploadmenulistbox = new ListBox(Manager); maploadmenulistbox.Init(); maploadmenulistbox.Text = ""; maploadmenulistbox.Width = resx/5; maploadmenulistbox.Height = resy/3; maploadmenulistbox.Left = (resx/3 - resx/5)/2; maploadmenulistbox.Top = 50; maploadmenulistbox.Anchor = Anchors.Bottom; maploadmenulistbox.Parent = maploadmenu; maploadmenulistbox.DoubleClick += maploadmenulistbox_DoubleClick; Manager.Add(maploadmenu); #endregion #region Summary Window SummaryWindow = new Window(Manager) {Color = Color.Black}; SummaryWindow.Init(); SummaryWindow.Text = ""; SummaryWindow.SetPosition(100, 100); SummaryWindow.Width = resx/4; SummaryWindow.Height = resy/4; SummaryWindow.Visible = false; SummaryWindow.BorderVisible = true; SummaryWindow.Movable = true; SummaryWindow.Resizable = false; summarytb = new TextBox(Manager); summarytb.Init(); summarytb.Text = ""; summarytb.Width = resx/4 - 30; summarytb.Height = resy/4 - 60; summarytb.Left = (20)/2; summarytb.CaretVisible = false; summarytb.Passive = true; summarytb.Mode = TextBoxMode.Multiline; summarytb.Top = (20)/2; summarytb.Anchor = Anchors.Bottom; summarytb.Parent = SummaryWindow; Manager.Add(SummaryWindow); #endregion #region ingameUIpartLeft ingameUIpartLeft = new Window(Manager) {Color = Color.Black}; ingameUIpartLeft.Init(); ingameUIpartLeft.Text = ""; ingameUIpartLeft.SetPosition(resx/5*4, 0); ingameUIpartLeft.Width = resx/5; ingameUIpartLeft.Height = resy; ingameUIpartLeft.Visible = false; ingameUIpartLeft.BorderVisible = false; ingameUIpartLeft.Movable = false; ingameUIpartLeft.Resizable = false; ingameshowOrdersB = new Button(Manager); ingameshowOrdersB.Init(); ingameshowOrdersB.Text = "Приказы (O)"; ingameshowOrdersB.Width = resx/5 - 20; ingameshowOrdersB.Height = 25; ingameshowOrdersB.Left = (20)/2; ingameshowOrdersB.Top = 10; ingameshowOrdersB.Anchor = Anchors.Bottom; ingameshowOrdersB.Parent = ingameUIpartLeft; ingameshowOrdersB.Click += ingameshowOrdersB_Click; ingameshowZonesB = new Button(Manager); ingameshowZonesB.Init(); ingameshowZonesB.Text = "Зоны (Z)"; ingameshowZonesB.Width = resx/5 - 20; ingameshowZonesB.Height = 25; ingameshowZonesB.Left = (20)/2; ingameshowZonesB.Top = 40; ingameshowZonesB.Anchor = Anchors.Bottom; ingameshowZonesB.Parent = ingameUIpartLeft; ingameshowZonesB.Click += ingameshowZonesB_Click; ingameshowBuildingsB = new Button(Manager); ingameshowBuildingsB.Init(); ingameshowBuildingsB.Text = "Постройки (Z)"; ingameshowBuildingsB.Width = resx/5 - 20; ingameshowBuildingsB.Height = 25; ingameshowBuildingsB.Left = (20)/2; ingameshowBuildingsB.Top = 70; ingameshowBuildingsB.Anchor = Anchors.Bottom; ingameshowBuildingsB.Parent = ingameUIpartLeft; ingameshowBuildingsB.Click += ingameshowBuildingsB_Click; ingameshowallinfo = new Button(Manager); ingameshowallinfo.Init(); ingameshowallinfo.Text = "Подробная информация"; ingameshowallinfo.Width = resx/5 - 20; ingameshowallinfo.Height = 25; ingameshowallinfo.Left = (20)/2; ingameshowallinfo.Top = 100; ingameshowallinfo.Anchor = Anchors.Bottom; ingameshowallinfo.Parent = ingameUIpartLeft; ingameshowallinfo.Click += ingameshowallinfo_Click; ingameUIpartLeftlistbox = new ListBox(Manager); ingameUIpartLeftlistbox.Init(); ingameUIpartLeftlistbox.Text = ""; ingameUIpartLeftlistbox.Width = resx/5 - 20; ingameUIpartLeftlistbox.Height = 90; ingameUIpartLeftlistbox.Left = 10; ingameUIpartLeftlistbox.Top = 200; ingameUIpartLeftlistbox.Anchor = Anchors.Bottom; ingameUIpartLeftlistbox.Parent = ingameUIpartLeft; ingameUIpartLeftlistbox.DoubleClick += maploadmenulistbox_DoubleClick; ingameUIpartLeftlistbox2 = new ListBox(Manager); ingameUIpartLeftlistbox2.Init(); ingameUIpartLeftlistbox2.Text = ""; ingameUIpartLeftlistbox2.Width = resx/5 - 20; ingameUIpartLeftlistbox2.Height = 200; ingameUIpartLeftlistbox2.Left = 10; ingameUIpartLeftlistbox2.Top = 300; ingameUIpartLeftlistbox2.Anchor = Anchors.Bottom; ingameUIpartLeftlistbox2.Parent = ingameUIpartLeft; Manager.Add(ingameUIpartLeft); #endregion #region orderssubmenu orderssubmenu = new Window(Manager); orderssubmenu.Init(); orderssubmenu.Text = ""; orderssubmenu.Width = 150; orderssubmenu.Height = 200; orderssubmenu.Center(); orderssubmenu.Visible = false; orderssubmenu.Resizable = false; digorder = new Button(Manager); digorder.Init(); digorder.Text = "Выкопать"; digorder.Width = orderssubmenu.Width - 40; digorder.Height = 24; digorder.Left = 20; digorder.Top = 20; digorder.Anchor = Anchors.Bottom; digorder.Parent = orderssubmenu; digorder.Click += digorder_Click; supplyorder = new Button(Manager); supplyorder.Init(); supplyorder.Text = "Обеспечить ресурсами"; supplyorder.Width = orderssubmenu.Width - 40; supplyorder.Height = 24; supplyorder.Left = 20; supplyorder.Top = 50; supplyorder.Anchor = Anchors.Bottom; supplyorder.Parent = orderssubmenu; supplyorder.Click += supplyorder_Click; cancelorder = new Button(Manager); cancelorder.Init(); cancelorder.Text = "Отменить все приказы"; cancelorder.Width = orderssubmenu.Width - 40; cancelorder.Height = 24; cancelorder.Left = 20; cancelorder.Top = 80; cancelorder.Anchor = Anchors.Bottom; cancelorder.Parent = orderssubmenu; cancelorder.Click += cancelorder_Click; collectorder = new Button(Manager); collectorder.Init(); collectorder.Text = "Cобрать"; collectorder.Width = orderssubmenu.Width - 40; collectorder.Height = 24; collectorder.Left = 20; collectorder.Top = 110; collectorder.Anchor = Anchors.Bottom; collectorder.Parent = orderssubmenu; collectorder.Click += collectorder_Click; orderslabel = new Label(Manager); orderslabel.Left = 5; orderslabel.Top = 5; orderslabel.Text = "Приказы"; orderslabel.Parent = orderssubmenu; Manager.Add(orderssubmenu); #endregion #region Buildings window buildinsgwindow = new Window(Manager) {BackColor = Color.Black}; buildinsgwindow.Init(); buildinsgwindow.Text = ""; buildinsgwindow.SetPosition(20, 20); buildinsgwindow.Width = 42*6 + 20; buildinsgwindow.Height = 300; buildinsgwindow.Visible = false; buildinsgwindow.Resizable = false; buildingssb = new ScrollBar(Manager, Orientation.Vertical); buildingssb.Init(); buildingssb.Top = 0; buildingssb.Width = 20; buildingssb.Left = buildinsgwindow.Width - buildingssb.Width - 20; buildingssb.Height = buildinsgwindow.Height - 40; buildingssb.Parent = buildinsgwindow; buildingssb.ValueChanged += buildingssb_ValueChanged; buildingsbuttons = new Button[dbobject.Data.Count]; buildingsbuttonslabel = new Label[dbobject.Data.Count]; int i = 0; foreach (var dbo in dbobject.Data) { buildingsbuttons[i] = new Button(Manager); buildingsbuttons[i].Init(); buildingsbuttons[i].Text = dbo.Value.Name; buildingsbuttons[i].Width = 40; buildingsbuttons[i].Height = 40; buildingsbuttons[i].Left = i%5*42; buildingsbuttons[i].Top = i/5*42; int[] tg = {buildingsbuttons[i].Top, dbo.Key}; buildingsbuttons[i].Tag = tg; buildingsbuttons[i].Anchor = Anchors.Bottom; buildingsbuttons[i].Parent = buildinsgwindow; buildingsbuttons[i].Glyph = new Glyph(object_tex, GetTexRectFromN(dbo.Value.MetatexN)); buildingsbuttons[i].ToolTip = new ToolTip(Manager); buildingsbuttons[i].ToolTip.Text = dbo.Value.Name + " id " + dbo.Key; buildingsbuttons[i].Click += Buildingsbutton_Click; iss.n.Add(dbo.Key, new LocalItem {id = dbo.Key, count = 0}); buildingsbuttonslabel[i] = new Label(Manager); buildingsbuttonslabel[i].Init(); buildingsbuttonslabel[i].Text = "0"; buildingsbuttonslabel[i].Width = 40; buildingsbuttonslabel[i].Height = 40; buildingsbuttonslabel[i].Left = i%5*42; buildingsbuttonslabel[i].Top = i/5*42; buildingsbuttonslabel[i].Parent = buildinsgwindow; i++; } Manager.Add(buildinsgwindow); #endregion #region Ingamemesages Ingamemesages = new Window(Manager); Ingamemesages.Init(); Ingamemesages.Text = ""; Ingamemesages.Width = 480; Ingamemesages.Height = 200; Ingamemesages.Center(); Ingamemesages.Visible = false; Ingamemesages.Resizable = false; IngamemesagesOk = new Button(Manager); IngamemesagesOk.Init(); IngamemesagesOk.Text = "OK"; IngamemesagesOk.Width = 72; IngamemesagesOk.Height = 24; IngamemesagesOk.Left = (Ingamemesages.ClientWidth/2) - (IngamemesagesOk.Width/2); IngamemesagesOk.Top = Ingamemesages.ClientHeight - IngamemesagesOk.Height - 8; IngamemesagesOk.Anchor = Anchors.Bottom; IngamemesagesOk.Parent = Ingamemesages; IngamemesagesOk.Click += IngamemesagesOk_Click; Ingamemesageslabel = new Label(Manager); Ingamemesageslabel.Left = 5; Ingamemesageslabel.Top = 5; Ingamemesageslabel.Text = "Text"; Ingamemesageslabel.Parent = Ingamemesages; Manager.Add(Ingamemesages); #endregion }
/// <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); #region models boxmodel = Content.Load<Model>("primitives/box"); lppbox = Content.Load<Model>("primitives/lit/box"); lppsphere = Content.Load<Model>("primitives/lit/sphere"); lppcapsule = Content.Load<Model>("primitives/lit/capsule"); lppcylinder = Content.Load<Model>("primitives/lit/cylinder"); cylindermodel = Content.Load<Model>("primitives/cylinder"); spheremodel = Content.Load<Model>("primitives/sphere"); capsulemodel = Content.Load<Model>("primitives/capsule"); floormodel = Content.Load<Model>("floor/floor"); boxdata = Content.Load<PhysicsInfo>("walls/roomphys"); circleimg = Content.Load<Texture2D>("textures/circle"); Model blockman = Content.Load<Model>("floor/floor"); //Model skullmodel = Content.Load<Model>("skull/skull"); Model wallmodel = Content.Load<Model>("room/room"); PhysicsInfo skullphys = Content.Load<PhysicsInfo>("skull/skullphys"); ShadowEffect = Content.Load<Effect>("shaders/Shadow"); Model sceneModel = Content.Load<Model>("scene/scenetest"); PhysicsInfo scenePhys = Content.Load<PhysicsInfo>("scene/scenetestphys"); #endregion #region Effects NormalEffect = Content.Load<Effect>("shaders/LPPNormalEffect"); BasicEffect = Content.Load<Effect>("shaders/LPPBasicEffect"); TexturedEffect = Content.Load<Effect>("shaders/LPPTexturedEffect"); MainEffect = Content.Load<Effect>("shaders/LPPMainEffect"); #endregion Vector3 lowerButton = new Vector3(134.988f, 61.178f, 126.411f) * (2.54f / 64.0f); Vector3 upperButton = new Vector3(134.988f, 64.803f, 126.411f) * (2.54f / 64.0f); float convFactor = 2.54f / 64.0f; Console.Parse("physdebug false"); Console.Parse("drawconstraints false"); Console.Parse("drawedgemask false"); Console.Parse("drawdepth false"); Console.Parse("drawnormal false"); Console.Parse("drawall false"); Console.Parse("drawspheres false"); Console.Parse("blur true"); Console.Parse("drawshadowmap false"); Console.Parse("drawlightbuffer false"); Console.Parse("showPosition true"); Console.LoadContent(Content); /*boxdata = new PhysicsInfo(); boxdata.CreateBox(new Vector3(-1, -1, -1), Matrix.Identity, Vector3.One); boxdata.CreateBox(new Vector3(1, 1, 1), Matrix.Identity, Vector3.One); boxdata.CreateSphere(new Vector3(1, 3, 1), 1);*/ // TODO: use this.Content to load your game content here projmatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45), (float)graphics.PreferredBackBufferWidth / (float)graphics.PreferredBackBufferHeight, 0.01f, 2500.0f); /* fallingBox = new Component(new Vector3(3.6f, 7.5f, -2.4f), Quaternion.Identity, Vector3.One / 2.0f); fallingBox.SetCollision(skullphys, false); fallingBox.Mesh = new LPPMesh(skullmodel); fallingBox.Mesh.Occlude = true; Actors.Add(new Actor(fallingBox));*/ /*immovableBox = new TriangleMeshActor(floormodel, Vector3.Zero, Vector3.One / 8.0f); immovableBox.Mesh = new LPPMesh(floormodel); immovableBox.Mesh.Occlude = true; Entities.Add(new Entity(immovableBox));*/ immovableBox = new TriangleMeshComponent(wallmodel, Vector3.Zero, Vector3.One / (64.0f / 2.54f)); var lppmesh = new LPPMesh(wallmodel); var scene = new Component(new LPPMesh(sceneModel), new Vector3(3.8f, 7.5f, -3.0f), Quaternion.Identity, Vector3.One / 64.0f); scene.SetCollision(scenePhys, true); Actors.Add(new Actor(scene)); Actors.Add(new LiftButton(upperButton, Vector3.One / 64.0f, "lift up")); Actors.Add(new LiftButton(lowerButton, Vector3.One / 64.0f, "lift down")); lppmesh.SpecularPower = 1.0f; lppmesh.Shininess = 1.0f; immovableBox.Mesh = lppmesh; Actors.Add(new Actor(immovableBox)); Actors.Add(new CeilingLamp(new Vector3(-1.5f, 11.9f, 1.68f), 0.75f)); Actors.Add(new Ladder(new Vector3(13.735f, 5.0f, -2.32f), 1.0f, 3.5f, 0.5f)); lift = new Lift(Vector3.Zero, 1 / 64.0f); Actors.Add(lift); Actors.Add(new PulsingLight(new Vector3(12.86f, 3.43f, 5.84f), Color.Red, 7.5f, 1.0f, 0.2f, 3.0d)); Actors.Add(new BareBulb(new Vector3(-14.5f, 11.4f, 3f), Vector3.One / 64.0f, Color.Wheat, 10.0f, 0.6f)); font = Content.Load<SpriteFont>("font"); RasterizerState rs = RasterizerState.CullCounterClockwise; GraphicsDevice.RasterizerState = rs; bs = GraphicsDevice.BlendState; cam = new Camera(); cam.Aspect = (float)scrwidth / (float)scrheight; cam.Viewport = new Viewport(0, 0, scrwidth, scrheight); cam.NearClip = 0.01f; cam.FarClip = 100.0f; cam.Transform = Matrix.Identity; characterController = new CharacterController(new Vector3(-1.0f, 2.0f, 7.311f), 3.0f, 0.75f, 0.1f, 0.2f); characterInput = new CharacterControllerInput(space, cam); characterInput.CharacterController = characterController; characterInput.Activate(); camcontrol = new CameraController(cam, Vector3.Zero, Vector2.Zero); Actors.Add(new Actor(new FollowLight(12.5f, 1.0f, Color.White, cam))); lppRenderer = new LPPRenderer(GraphicsDevice, Content, scrwidth, scrheight); for (int i = /*200*/0; i > 0; --i) { space.Update(0.0166f); } window = new Dialog(Manager); window.SetPosition(0, 0); window.SetSize(512, 512); window.Text = "Console"; textBox = new TextBox(Manager); textBox.SetPosition(32, 32); window.Add(textBox, false); Manager.Add(window); }