Ejemplo n.º 1
0
        public Player(string name,int id)
            : base()
        {
            this.s_name = name;
            this.id = id;
            this.weapon = new MD2("Models/sniper.md2","Textures/sniper.jpg");

            Camera.Position = World.Map.SpawnPoints[this.id].position;
            this.f_phi = World.Map.SpawnPoints[this.id].phi;
            this.f_teta = World.Map.SpawnPoints[this.id].teta;

            Camera.Update();
            tir = new Son("Sons/tir.wav");
            shootfreq = 0;

            nb_munit = munitMax;
            nb_rech = 10;
        }
Ejemplo n.º 2
0
        public Map(string name)
        {
            StreamReader sr = new StreamReader(new FileStream(name, FileMode.Open));

            q3level = new Q3BSP(sr.ReadLine());
            skybox = new Sky(sr.ReadLine(), ".bmp");
            Camera.DrivenCam = new Camera_D(sr.ReadLine());
            drivsound = new Son(sr.ReadLine());
            spawnpoints = new SpawnPoint[2];
            string[] buff = sr.ReadLine().Split(' ');
            spawnpoints[0] = new SpawnPoint();
            spawnpoints[0].position = new Vector3(Convert.ToSingle(buff[0]),
                                                  Convert.ToSingle(buff[1]),
                                                  Convert.ToSingle(buff[2]));
            spawnpoints[0].phi = Convert.ToSingle(buff[3]);
            spawnpoints[0].teta = Convert.ToSingle(buff[4]);

            buff = sr.ReadLine().Split(' ');
            spawnpoints[1] = new SpawnPoint();
            spawnpoints[1].position = new Vector3(Convert.ToSingle(buff[0]),
                                                  Convert.ToSingle(buff[1]),
                                                  Convert.ToSingle(buff[2]));
            spawnpoints[1].phi = Convert.ToSingle(buff[3]);
            spawnpoints[1].teta = Convert.ToSingle(buff[4]);

            World.g = Convert.ToSingle(sr.ReadLine());
            World.JumpAcc = Convert.ToSingle(sr.ReadLine());

            int nbmunitbox = Convert.ToInt32(sr.ReadLine());
            for (int i = 0; i < nbmunitbox; i++)
            {
                buff = sr.ReadLine().Split(' ');
                Vector3 pos = new Vector3(Convert.ToSingle(buff[0]),
                                          Convert.ToSingle(buff[1]),
                                          Convert.ToSingle(buff[2]));
                Dropbox b = new Dropbox(Dropbox.Type.Munition, pos);
                DropboxMgr.BoxList.Add(b);
                SceneMgr.Add(b);
            }
            int nbhealthbox = Convert.ToInt32(sr.ReadLine());
            for (int i = 0; i < nbhealthbox; i++)
            {
                buff = sr.ReadLine().Split(' ');
                Vector3 pos = new Vector3(Convert.ToSingle(buff[0]),
                                          Convert.ToSingle(buff[1]),
                                          Convert.ToSingle(buff[2]));
                Dropbox b = new Dropbox(Dropbox.Type.Health, pos);
                DropboxMgr.BoxList.Add(b);
                SceneMgr.Add(b);
            }

            int nbtarget = Convert.ToInt32(sr.ReadLine());
            for (int i = 0; i < nbtarget; i++)
            {
                buff = sr.ReadLine().Split(' ');
                Vector3 pos = new Vector3(Convert.ToSingle(buff[0]),
                                          Convert.ToSingle(buff[1]),
                                          Convert.ToSingle(buff[2]));
                TargetMgr.Targets.Add(new Target(pos));
            }

            sr.Close();
        }
Ejemplo n.º 3
0
 public static void Init()
 {
     healthsound = new Son("Sons/health_box.wav");
     munitsound = new Son("Sons/munit_box.wav");
 }