public static void Render( List <EnemyObject> enemyObjects, EnemyObjectType enemyObjectType, TranslatedDTDanmakuDisplay display, Dictionary <string, DTDanmakuImage> spriteNameToImageDictionary) { foreach (EnemyObject enemyObj in enemyObjects) { if (enemyObj.IsDestroyed) { continue; } if (enemyObj.ObjectType != enemyObjectType) { continue; } if (enemyObj.SpriteName == null) { continue; } DTDanmakuImage image = spriteNameToImageDictionary[enemyObj.SpriteName]; long width = display.GetWidth(image); long height = display.GetHeight(image); int x = (int)(enemyObj.XMillis / 1000 - width / 2); int y = (int)(700 - enemyObj.YMillis / 1000 - height / 2); display.DrawImageRotatedClockwise(image, x, y, (int)enemyObj.FacingDirectionInMillidegrees); } }
public static void RenderPlayerLifeIcons( int numberOfLivesRemaining, TranslatedDTDanmakuDisplay display) { int width = (int)display.GetWidth(DTDanmakuImage.PlayerLifeIcon); for (int i = 0; i < numberOfLivesRemaining; i++) { display.DrawImage(DTDanmakuImage.PlayerLifeIcon, x: 1000 - 1 - (i + 1) * (width + 1), y: 3); } }