mirror of
https://github.com/TheRavenwoodArts/LunaLightXMG.git
synced 2026-07-30 22:55:03 -07:00
Quik update
This commit is contained in:
@@ -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,6 +162,18 @@ namespace LunaLightXMG
|
||||
}
|
||||
|
||||
// Method Implementation -------------------------------------------------------------------------------
|
||||
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)
|
||||
|
||||
+7
-1
@@ -126,8 +126,14 @@ namespace LunaLightXMG
|
||||
}
|
||||
}
|
||||
platforms.Add(new Platform(new Vector2(x, y + 4), 16, 16));
|
||||
if (x + 16 < 288)
|
||||
{
|
||||
for (int j = 1; j < 3; j++)
|
||||
{
|
||||
platforms.Add(new Platform(new Vector2(x + (j*16), y + 4), 16, 16));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return platforms;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user