示例#1
0
 /// <summary>
 /// creates empty NPC with placeholder attributes
 /// </summary>
 /// <param name="Content"></param>
 /// <param name="graphicsDevice"></param>
 /// <param name="world"></param>
 /// <param name="bilbo"></param>
 public NPC(ContentManager Content, GraphicsDevice graphicsDevice, World world, BillboardEngine bilbo, AudioManager audio)
 {
     model               = null;
     position            = Vector3.Zero;
     direction           = Vector3.Zero;
     this.world          = world;
     speed               = 0;
     level               = 0;
     maxHealth           = 0;
     health              = 0;
     active              = false;
     newTarget           = false;
     XP                  = 0;
     cooldown            = 0;
     maxCooldn           = 0;
     element             = 0;
     kind                = 0;
     strength            = 0;
     pathFinder          = null;
     target              = Vector3.Zero;
     isHit               = false;
     hitTimer            = 0;
     isDead              = false;
     billboardEngine     = bilbo;
     this.graphicsDevice = graphicsDevice;
     this.audio          = audio;
     explosion           = new Explosion(Position, graphicsDevice, Content);
     dmgNumbers          = new List <DmgNumber>();
 }
示例#2
0
文件: NPC.cs 项目: kayorga/3DSP
 /// <summary>
 /// creates empty NPC with placeholder attributes
 /// </summary>
 /// <param name="Content"></param>
 /// <param name="graphicsDevice"></param>
 /// <param name="world"></param>
 /// <param name="bilbo"></param>
 public NPC(ContentManager Content, GraphicsDevice graphicsDevice, World world, BillboardEngine bilbo, AudioManager audio)
 {
     model = null;
     position = Vector3.Zero;
     direction = Vector3.Zero;
     this.world = world;
     speed = 0;
     level = 0;
     maxHealth = 0;
     health = 0;
     active = false;
     newTarget = false;
     XP = 0;
     cooldown = 0;
     maxCooldn = 0;
     element = 0;
     kind = 0;
     strength = 0;
     pathFinder = null;
     target = Vector3.Zero;
     isHit = false;
     hitTimer = 0;
     isDead = false;
     billboardEngine = bilbo;
     this.graphicsDevice = graphicsDevice;
     this.audio = audio;
     explosion = new Explosion(Position, graphicsDevice, Content);
     dmgNumbers = new List<DmgNumber>();
 }
示例#3
0
文件: Charge.cs 项目: kayorga/3DSP
 public Charge(Vector3 position, GraphicsDevice gDevice, ContentManager Content)
 {
     graphicsDevice = gDevice;
     Position = position;
     Texture2D texture = Content.Load<Texture2D>("Particles/particle");
     billboardEngine = new BillboardEngine(5, graphicsDevice);
     billboardEngine.Effect.Texture = texture;
     particleEffect = new ChargeParticleEffect(10000, graphicsDevice, texture, Color.Blue, Color.Green, 0.4f);
     particleEffect.VelocityScaling = 7.0f;
 }
示例#4
0
文件: Explosion.cs 项目: kayorga/3DSP
 public Explosion(Vector3 position, GraphicsDevice gDevice, ContentManager Content)
 {
     graphicsDevice = gDevice;
     Position = position;
     Texture2D texture = Content.Load<Texture2D>("Particles/fire");
     billboardEngine = new BillboardEngine(5, graphicsDevice);
     billboardEngine.Effect.Texture = texture;
     particleEffect = new ParticleEffect(10000, graphicsDevice, texture, Color.Goldenrod, Color.DarkMagenta, 1.0f);
     particleEffect.VelocityScaling = 7.0f;
 }
示例#5
0
文件: Explosion.cs 项目: kayorga/3DSP
        public Explosion(Vector3 position, GraphicsDevice gDevice, ContentManager Content)
        {
            graphicsDevice = gDevice;
            Position       = position;
            Texture2D texture = Content.Load <Texture2D>("Particles/fire");

            billboardEngine = new BillboardEngine(5, graphicsDevice);
            billboardEngine.Effect.Texture = texture;
            particleEffect = new ParticleEffect(10000, graphicsDevice, texture, Color.Goldenrod, Color.DarkMagenta, 1.0f);
            particleEffect.VelocityScaling = 7.0f;
        }
示例#6
0
        public Charge(Vector3 position, GraphicsDevice gDevice, ContentManager Content)
        {
            graphicsDevice = gDevice;
            Position       = position;
            Texture2D texture = Content.Load <Texture2D>("Particles/particle");

            billboardEngine = new BillboardEngine(5, graphicsDevice);
            billboardEngine.Effect.Texture = texture;
            particleEffect = new ChargeParticleEffect(10000, graphicsDevice, texture, Color.Blue, Color.Green, 0.4f);
            particleEffect.VelocityScaling = 7.0f;
        }
示例#7
0
 public ParticleEffect(int maxNumParticles, GraphicsDevice gd, Texture2D texture, Color startCol, Color endCol, float lifetime)
 {
     graphicsDevice = gd;
     random = new Random();
     billboardEngine = new BillboardEngine(maxNumParticles, graphicsDevice);
     particles = new Particle[maxNumParticles];
     Effect.Texture = texture;
     startColor = startCol;
     endColor = endCol;
     particleLifetime = lifetime;
     this.VelocityScaling = 1.0f;
     this.SizeScaling = 0.8f;
 }
示例#8
0
 public ChargeParticleEffect(int maxNumParticles, GraphicsDevice gd, Texture2D texture, Color startCol, Color endCol, float lifetime)
 {
     graphicsDevice       = gd;
     random               = new Random();
     billboardEngine      = new BillboardEngine(maxNumParticles, graphicsDevice);
     particles            = new Particle[maxNumParticles];
     Effect.Texture       = texture;
     startColor           = startCol;
     endColor             = endCol;
     particleLifetime     = lifetime;
     this.VelocityScaling = 1.5f;
     this.SizeScaling     = 0.8f;
 }
示例#9
0
        public NPCCollection(World w, ContentManager Content, Player pl, GraphicsDevice graphicsDevice, AudioManager audio)
            : base(Constants.CAP_NPCS)
        {
            //TODO
            world = w;

            Texture2D hitTexture = Content.Load <Texture2D>("bam");

            billboardEngine = new BillboardEngine(5, graphicsDevice);
            billboardEngine.Effect.Texture = hitTexture;

            this.graphicsDevice = graphicsDevice;
            for (int i = 0; i < Constants.CAP_NPCS; i++)
            {
                _content.Add(new NPC(Content, graphicsDevice, world, billboardEngine, audio));
            }

            player   = pl;
            moveData = new byte[world.size * 2][];
            for (int i = 0; i < world.size * 2; ++i)
            {
                moveData[i] = new byte[world.size * 2];
            }

            models = new Model[5];
            #region load models
            models[0] = Content.Load <Model>("Models/enemy4");
            models[1] = Content.Load <Model>("Models/enemy3");
            models[2] = Content.Load <Model>("Models/enemy1");
            models[3] = Content.Load <Model>("Models/enemy2");
            models[4] = Content.Load <Model>("Models/boss");
            #endregion

            queue = new Queue <DmgNumber>();

            //model0 = new ModelObject("cube");
            pathFinder = new AStar(world, pl, new Point(1, 1), this);
        }