mirror of
https://github.com/TheRavenwoodArts/LunaLightXMG.git
synced 2026-07-30 22:55:03 -07:00
Moved number of enemies/platforms init into Game1 constructor.
This commit is contained in:
@@ -14,6 +14,7 @@ namespace LunaLightXMG
|
||||
private Player player;
|
||||
private PlayerInput playerInput;
|
||||
private List<Enemy> 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<Enemy>();
|
||||
|
||||
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);
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user