Een object in XNA afschieten

Status
Niet open voor verdere reacties.

helghast001

Gebruiker
Lid geworden
2 mrt 2009
Berichten
47
Hallo,

Ik heb me suf gezocht naar tutorials om een object (tank) te laten schieten in 3D. Maar ik kan nergens een tutorial vinden. Kan iemand er hier 1 vinden? Of weet iemand hoe je dat doet?
 
Ik heb al een hele class geschreven maar ik weet echt niet hoe ik hem vanaf mijn mesh tank moet schieten.

Mijn class:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;

namespace _3Dobject
{
    class Bullet
    {

        private Vector3 world;

        public Vector3 Worldfunc
        {
            get { return world; }
        }

        float  velocity;

        public Matrix position;

        public Vector3 shotspeed;

        float mass;

        public void Update(GameTime gameTime)
        {
            GamePadState gamePadstate = GamePad.GetState(PlayerIndex.One);
            KeyboardState keyboardState = Keyboard.GetState();
            position = Matrix.Identity;
            position.Forward = world;
            shotspeed.Z += 20.0f;

            if (gamePadstate.IsConnected)
            {
                if (gamePadstate.Buttons.X == ButtonState.Pressed)
                {
                    position.Forward = world;
                    shotspeed.Z += 20.0f;

                }
            }



        }
    }
}
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan