Skip to content

Instantly share code, notes, and snippets.

@MidnytRaccoon
Created September 18, 2025 09:49
Show Gist options
  • Select an option

  • Save MidnytRaccoon/dfc8114087fc85deaffe49c67771e1bf to your computer and use it in GitHub Desktop.

Select an option

Save MidnytRaccoon/dfc8114087fc85deaffe49c67771e1bf to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
List<Vector2> enemyPositions = new List<Vector2>();
// Add enemies
enemyPositions.Add(new Vector2(100, 200));
enemyPositions.Add(new Vector2(300, 400));
// Move enemies
for (int i = 0; i < enemyPositions.Count; i++)
{
enemyPositions[i] = new Vector2(enemyPositions[i].X - 2, enemyPositions[i].Y);
}
// Remove an enemy (e.g., defeated)
enemyPositions.RemoveAt(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment