Beispiel #1
0
        public GamePage(string launchArguments)
        {
            this.InitializeComponent();

            // Create the game.
            _game = XamlGame <VaporTrailGame> .Create(launchArguments, Window.Current.CoreWindow, this);
        }
        //-------------------------------------------------------------------------------------
        // Class constructors

        public GroundObject(VaporTrailGame game, Texture2D texture)
            : base(game)
        {
            // Have we already built the ground vertex array in a previous instance?
            if (_vertices == null)
            {
                // No, so build it now
                BuildVertices();
            }

            // Set other object properties
            ObjectTexture = texture;
        }
        //-------------------------------------------------------------------------------------
        // Class constructors

        public SmokeParticleObject(VaporTrailGame game, Texture2D texture, Vector3 position, Vector3 scale)
            : base(game)
        {
            _game = game;

            // Have we already built the ground vertex array in a previous instance?
            if (_vertices == null)
            {
                // No, so build it now
                BuildVertices();
                // Create a vertex buffer
                _vertexBuffer = new VertexBuffer(game.GraphicsDevice, typeof(VertexPositionNormalTexture), _vertices.Length, BufferUsage.WriteOnly);
                _vertexBuffer.SetData(_vertices);
            }

            // Set object properties
            ObjectTexture = texture;

            // Reset the particle to an initial state
            ResetParticle(position);
        }
        //-------------------------------------------------------------------------------------
        // Class constructors

        public PaperPlaneObject(VaporTrailGame game, Vector3 position, Model model)
            : base(game, position, model)
        {
        }
        //-------------------------------------------------------------------------------------
        // Class constructors

        public CameraObject(VaporTrailGame game)
            : base(game)
        {
        }