public EnemyEntity(EnemyEntity ee)
        {
            this.TextureInfo = ee.TextureInfo;
            this.Quad.S = ee.Quad.S;
            this.Position = ee.Position;
            this.vec = ee.vec;
            this.textureInfoArray = ee.textureInfoArray;

            pos = 0;
        }
Beispiel #2
0
        // Update
        public void spawnEnemy()
        {
            //GameLog.DebugLog.Log("as" + enemyList.Count);
            int rand = (new System.Random()).Next(0, 4);

            EnemyEntity e = new EnemyEntity(enemyEnt);
            //Console.WriteLine (rand);
            e.setType(rand);

            //if(max < enemyList.Count) {
            enemyList.Reverse();
            enemyList.Add(e);
            enemyList.Reverse();
            //}

            if (max < enemyList.Count) {
                    enemyList.Remove(enemyList[enemyList.Count - 1]);
            }

            int i = enemyList.Count;
            foreach (EnemyEntity v in enemyList){
                if (!v.Next()){
                    v.Visible = false;
                    //enemyList.RemoveAt( i );
                }
            }
            //Console.WriteLine("Yahoo " + i);

            /*if (0 < i){

                for(int j = i; j > 0 ; j--){

                    EnemyEntity tmp = enemyList[j - 1];
                    Console.WriteLine("i:"+i + " j:" + j + " " + tmp.pos);
                    tmp.Next();
                    if(tmp.pos > max){
                        tmp.Visible = false;
                        tmp = null;
                    }
                    /*if(i == j){
                        if(max > i){
                            enemyList.Add(e);
                            enemyList[j] = tmp;
                        } else {
                            tmp.Visible = false;
                            tmp = null;
                        }
                    }/
                    //if (max > i )
                    //if(j == 0 ) enemyList[0] = e;
                }

            } else {
                enemyList.Add(e);
            }*/
            //enemyList[0] = e;
            scene.AddChild(e);

            /**/
            /*
            int i = 0;
            for(i = 0; i < enemyArray.Length; i++)
            {
                EnemyEntity e = enemyArray[i] = new EnemyEntity();
                int j = (new System.Random()).Next(0, 3);
                e.setPos(i);

                //type set
                e.setTexture(j);
                scene.AddChild(e);
            }
            enemyArray[0].Visible = false;
            */
        }
Beispiel #3
0
        public void spawnEnemy(object source, ElapsedEventArgs tEvent)
        {
            int rand = (new System.Random()).Next(0, 3);
            EnemyEntity e = new EnemyEntity();
            Console.WriteLine(rand);

            //this.scene.AddChild();
        }