代码之家  ›  专栏  ›  技术社区  ›  John Tran

有人能告诉我为什么这样不行吗?C#XNA

  •  0
  • John Tran  · 技术社区  · 7 年前

    所以我用这个方法来繁殖怪物,在两者之间有一个时间延迟,问题是条件通过了,但它不想访问里面的东西。

        public void CreateMonsterWave(GameTime gameTime)
        {
            spawnDelay += (float)gameTime.ElapsedGameTime.TotalSeconds;
    
                if (spawnDelay >= 2f && creepAmountOut < monsterWave.Length) 
                {
                    spawnDelay = 0f;
                    monsterWave[creepAmountOut] = new WaveMonster(monsterHp, monsterDamage, monsterTex, waveStartPos, path1);
                    creepAmountOut++;
                } 
        }
    
          //In LoadContent
          monsterWave = new WaveMonster[8];
    

    1 回复  |  直到 7 年前
        1
  •  1
  •   Gary Sundquist    7 年前