![Title card for Spawning Random Enemies in a Roguelike [C#]](/en/og/articles/cards/roguelike-random-enemy-select.png)
Spawning Random Enemies in a Roguelike [C#]
The 'improved level generation algorithm' update for Treasure Rogue is now complete, so this article walks through the implementation in detail with code.
Home / Articles / Tag
3 articles
![Title card for Spawning Random Enemies in a Roguelike [C#]](/en/og/articles/cards/roguelike-random-enemy-select.png)
The 'improved level generation algorithm' update for Treasure Rogue is now complete, so this article walks through the implementation in detail with code.
![Title card for How to Implement a Turn-Based Game Loop [C#]](/en/og/articles/cards/turnbased-gameloop.png)
This article introduces the code used to implement a turn-based game loop. Treasure Rogue, the turn-based roguelike I made, basically runs on the code shown here. I leave out anything that is not strictly necessary so the code is easier to read.

Sometimes you want random selection where each item has a different chance of being chosen based on its weight, such as gacha or item drop rates. This article shows one way to implement WeightedRandom in C#.