Esempio n. 1
0
        private bool updateCycle(GameTime gameTime, Camera camera, World world, NPCCollection npcs, Player p, Mission m, int factor, float spd, float dx, float dz)
        {
            position += spd * direction;
            if (type == Constants.TYP_WAV)
            {
                Vector3 cross = Vector3.Cross(direction, Vector3.Up);
                if (mirror)
                {
                    position -= 0.5f * cross * (float)Math.Sin(waveTime.Milliseconds * 200);
                }
                else
                {
                    position += 0.5f * cross * (float)Math.Sin(waveTime.Milliseconds * 200);
                }
                //position += 0.5f * Vector3.Up * (float)Math.Cos(waveTime.Milliseconds);
                //position.X += dx / factor;
                //position.Z += dz / factor;
            }

            distance += spd;

            bulletOb.Position = position;

            particleEffect.Update((float)gameTime.ElapsedGameTime.TotalSeconds, camera.ViewMatrix, position, direction);

            xTile = (byte)Math.Round(-1 * (position.X) + (Constants.MAP_SIZE - 1));
            zTile = (byte)Math.Round(-1 * (position.Z) + (Constants.MAP_SIZE - 1));

            if (collision(world) || collision(npcs, m) || collision(p, m) || distance > maxDist)
            {
                active = false;
                particleEffect.Clear();
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
 public void Clear()
 {
     particleEffect.Clear();
 }