private void CharacterUpdate(float elapsedTime)
        {
            this.GameState.character.Update(this.Camera);
            this.GameState.character.Attack(this.World, Input);

            propulsion(elapsedTime);

            this.GameState.character.UpdateStats(this.Camera.Position.Y < 0
                ? new Stats(-elapsedTime, 0)
                : new Stats(elapsedTime * (this.GameState.character.MaxStats.Oxygen / 2.5f), 0));

            var item = manageSelectableElement(World.SelectableElement); // Imsportant: get this AFTER updating the world

            //TODO refactor
            if (item != null)
            {
                GameState.character.GiveItem(item);
                if (goldRate.HasToSpawn())
                {
                    GameState.character.GiveItem(new Gold());
                }
            }
        }
示例#2
0
 private List <Cube> ElementsToSpawn(int divisions, SpawnRate spawnRate)
 {
     return(GenerateXzCubes(this.Cube.PMin, this.Cube.PMax, divisions)
            .FindAll(scaleBox => spawnRate.HasToSpawn()));
 }