コード例 #1
0
ファイル: World.cs プロジェクト: tubitos/1
 void CreateNewArea()
 {
     for (int x = 0; x < areas.GetLength (0); x++)
     {
         for (int y = 0; y < areas.GetLength (1); y++)
         {
             areas[x, y] = new Area (new Vector2 (10.0F), new Vector2 (x, y));
         }
     }
 }
コード例 #2
0
ファイル: Level.cs プロジェクト: tubitos/1
        //
        //load content for the screen
        //
        protected override void LoadContent(PloobsEngine.Engine.GraphicInfo GraphicInfo, PloobsEngine.Engine.GraphicFactory factory, IContentManager contentManager)
        {
            //
            //Setup Statics
            //
            EngineSettings.factory = factory;
            EngineSettings.graphicInfo = GraphicInfo;
            EngineSettings.freeMouse = false;

            Controls.forward = Keys.W;
            Controls.backward = Keys.S;
            Controls.strafeLeft = Keys.A;
            Controls.strafeRight = Keys.D;
            Controls.jump = Keys.Space;
            Controls.crouch = Keys.LeftControl;

            InputStates.omstate = Mouse.GetState ();
            InputStates.okstate = Keyboard.GetState ();

            base.LoadContent (GraphicInfo, factory, contentManager);

            //
            //Create player and player camera
            //
            Player player = new Player (this, new Vector3 (675, 100, 1566), Matrix.Identity,
                new SimpleModel (factory, "Models//objects//people//baseMan", "Models//objects//people//baseManT"), 1.0F, 5.0F, true);
            World.AddObject (player.GetObject ());
            World.CameraManager.AddCamera (player.GetCamera (), "player cam");
            World.CameraManager.SetActiveCamera ("player cam");

            //
            //Setup other graphics
            //
            mouseCursor = factory.GetTexture2D ("Images//mouse//defualt");

            //
            //Create world
            //
            localWorld = new Area (new Vector2 (5));
            //localWorld.SetUpChunkArray (factory, new Vector2 (5, 5));
            //temp = localWorld.GetLoadedChunks ();//localWorld.localWorld;

            //
            //Setup Lights
            //
            #region lights
            DirectionalLightPE ld1 = new DirectionalLightPE (Vector3.Left, Color.White);
            DirectionalLightPE ld2 = new DirectionalLightPE (Vector3.Right, Color.White);
            DirectionalLightPE ld3 = new DirectionalLightPE (Vector3.Backward, Color.White);
            DirectionalLightPE ld4 = new DirectionalLightPE (Vector3.Forward, Color.White);
            DirectionalLightPE ld5 = new DirectionalLightPE (Vector3.Down, Color.White);

            float li = 1F;
            ld1.LightIntensity = li;
            ld2.LightIntensity = li;
            ld3.LightIntensity = li;
            ld4.LightIntensity = li;
            ld5.LightIntensity = li;

            this.World.AddLight (ld1);
            this.World.AddLight (ld2);
            this.World.AddLight (ld3);
            this.World.AddLight (ld4);
            this.World.AddLight (ld5);
            #endregion
        }