Added texture cache and sprite origins.

This commit is contained in:
2026-01-14 23:09:13 -05:00
parent fcb4f1cf05
commit 61d51f5188
36 changed files with 319 additions and 83 deletions

View File

@@ -1,4 +1,5 @@
using AlienAttack.MonoGame.Things;
using AlienAttack.MonoGame.Things.Asteroids;
using AlienAttack.MonoGame.Things.Enemies;
using AlienAttack.MonoGame.Things.Enemies.Mines;
using AlienAttack.MonoGame.Things.Enemies.Turrets;
@@ -263,7 +264,8 @@ internal class GameLoop : GameLoopBase
Random = _random,
GameTime = gameTime,
Content = Content,
SpawnSprite = _spritesToAdd.Add
SpawnSprite = _spritesToAdd.Add,
Player = _player
};
foreach (Sprite sprite in Sprites)
@@ -406,6 +408,12 @@ internal class GameLoop : GameLoopBase
Sprites.Add(enemy);
_spawnNewEnemyThreshold = 100 + _random.Next(0, 100);
}
else if (randomNumber == 13)
{
Asteroid enemy = new(_random.Next(0, ViewTransform.ScreenWidth - Asteroid.Width), -Asteroid.Height);
Sprites.Add(enemy);
_spawnNewEnemyThreshold = 100 + _random.Next(0, 100);
}
}
}
}