コード例 #1
0
ファイル: TerrainTest.cs プロジェクト: jwvdiermen/LD28
        public void LoadContent()
        {
            _spriteBatch = new SpriteBatch(_graphics);

            _world = new StaticEntityWorld(_game.Services);

            var pp = _graphics.PresentationParameters;

            _camera              = new DefaultCamera(null, new Viewport(0, 0, pp.BackBufferWidth, pp.BackBufferHeight));
            _cameraNode          = _world.Scene.Root.CreateChild("Camera");
            _cameraNode.Position = new Vector3(_camera.ScreenSize / 2.0f, 0.0f);
            _cameraNode.Scale    = new Vector3(.5f);
            _cameraNode.Attach(_camera);

            // Create the tile map.
            _terrain = new Terrain(new Vector2(102.4f, 102.4f), 51.2f, 9);
            _terrain.DebugEnabled = true;
            _world.Add(_terrain);

            // Create the circle brush.
            _circleBrush = new CircleBrush(2.5f);

            _circleBrushNode = _world.Scene.CreateSceneNode();
            _circleBrushNode.Attach(new CircleRenderable(2.5f, 64)
            {
                Color = Vector3.One
            });
        }
コード例 #2
0
ファイル: Entity.cs プロジェクト: tipfom/quasi_
        public Entity(ComponentList Components, Transform Transform, IEntityWorld World, int Species)
        {
            this.World     = World;
            this.Transform = Transform;
            this.Species   = Species;
            this.ID        = ++currentInstance;

            for (int i = 0; i < pendingComponentInfos.Length; i++)
            {
                pendingComponentInfos[i] = new Queue <object[]>( );
            }

            this.Components = new Component[Components.Count];
            for (int i = 0; i < this.Components.Length; i++)
            {
                this.Components[i] = Components[i].Create(this);
            }

            World.Add(this);
        }
コード例 #3
0
ファイル: TerrainTest.cs プロジェクト: jwvdiermen/LD28
        public void LoadContent()
        {
            _spriteBatch = new SpriteBatch(_graphics);

            _world = new StaticEntityWorld(_game.Services);

            var pp = _graphics.PresentationParameters;
            _camera = new DefaultCamera(null, new Viewport(0, 0, pp.BackBufferWidth, pp.BackBufferHeight));
            _cameraNode = _world.Scene.Root.CreateChild("Camera");
            _cameraNode.Position = new Vector3(_camera.ScreenSize / 2.0f, 0.0f);
            _cameraNode.Scale = new Vector3(.5f);
            _cameraNode.Attach(_camera);

            // Create the tile map.
            _terrain = new Terrain(new Vector2(102.4f, 102.4f), 51.2f, 9);
            _terrain.DebugEnabled = true;
            _world.Add(_terrain);

            // Create the circle brush.
            _circleBrush = new CircleBrush(2.5f);

            _circleBrushNode = _world.Scene.CreateSceneNode();
            _circleBrushNode.Attach(new CircleRenderable(2.5f, 64)
            {
                Color = Vector3.One
            });
        }