Quik update

This commit is contained in:
J. M. Ellis
2024-06-02 17:59:24 -07:00
parent 339f512e5d
commit d7f84ce34a
2 changed files with 22 additions and 10 deletions
+15 -9
View File
@@ -77,7 +77,7 @@ namespace LunaLightXMG
PlayBackgroundMusic(sinkBeats);
// Generate random platforms - test this idea out...
platforms = PlatformGenerator.CreatePlatforms(14);
platforms = PlatformGenerator.CreatePlatforms(6);
}
@@ -93,13 +93,7 @@ namespace LunaLightXMG
player.LoadContent(Content); // player sprite is now handled in player.cs
// Spawn 10 enemies at the start of the level
for (int i = 0; i < 10; i++)
{
Vector2 spawnPosition = new Vector2(16 + i*3,-16);
Enemy enemy = new Enemy(spawnPosition, GetRandomValueBetween1And3());
enemy.LoadContent(Content);
enemies.Add(enemy);
}
enemies = SpawnEnemies(10);
// Test Render Target
renderTarget = new RenderTarget2D(GraphicsDevice, retroWidth, retroHeight);
@@ -168,7 +162,19 @@ namespace LunaLightXMG
}
// Method Implementation -------------------------------------------------------------------------------
private void PlayBackgroundMusic(SoundEffect backgroundMusic)
private List<Enemy> SpawnEnemies(int numberOfEnemies) {
List<Enemy> enemies = new List<Enemy>();
for (int i = 0; i < numberOfEnemies; i++)
{
Vector2 spawnPosition = new Vector2(16 + i * 3, -16);
Enemy enemy = new Enemy(spawnPosition, GetRandomValueBetween1And3());
enemy.LoadContent(Content);
enemies.Add(enemy);
}
return enemies;
}
private void PlayBackgroundMusic(SoundEffect backgroundMusic)
{
if (backgroundMusicInstance == null || backgroundMusicInstance.State != SoundState.Playing)
{