diff --git a/Game1.cs b/Game1.cs index 355de23..5067ca3 100644 --- a/Game1.cs +++ b/Game1.cs @@ -14,6 +14,7 @@ namespace LunaLightXMG private Player player; private PlayerInput playerInput; private List enemies; + private int numOfEnemies; private GraphicsDeviceManager graphics; private SpriteBatch spriteBatch; @@ -32,6 +33,7 @@ namespace LunaLightXMG // Test platforms private Platform[] platforms; + private int numOfPlatforms; // Music private SoundEffect sinkBeats; @@ -61,6 +63,10 @@ namespace LunaLightXMG enemies = new List(); random = new Random(42); + + // Init number of platforms / enemies + numOfPlatforms = 3; + numOfEnemies = 20; } protected override void Initialize() @@ -78,7 +84,7 @@ namespace LunaLightXMG PlayBackgroundMusic(sinkBeats); // Generate random platforms - test this idea out... - platforms = PlatformGenerator.CreatePlatforms(6); + platforms = PlatformGenerator.CreatePlatforms(numOfPlatforms); } @@ -95,7 +101,7 @@ namespace LunaLightXMG player.LoadContent(Content); // player sprite is now handled in player.cs // Spawn 10 enemies at the start of the level - enemies = SpawnEnemies(10); + enemies = SpawnEnemies(numOfEnemies); // Test Render Target renderTarget = new RenderTarget2D(GraphicsDevice, retroWidth, retroHeight); @@ -180,7 +186,7 @@ namespace LunaLightXMG return enemies; } - private void PlayBackgroundMusic(SoundEffect backgroundMusic) + private void PlayBackgroundMusic(SoundEffect backgroundMusic) { if (backgroundMusicInstance == null || backgroundMusicInstance.State != SoundState.Playing) { @@ -249,10 +255,10 @@ namespace LunaLightXMG // Clear and respawn enemies enemies.Clear(); - enemies = SpawnEnemies(10); + enemies = SpawnEnemies(numOfEnemies); // Regenerate platforms - platforms = PlatformGenerator.CreatePlatforms(6); + platforms = PlatformGenerator.CreatePlatforms(numOfPlatforms); } } }