public ColumnNewStyle(int XPos, int size) { X = XPos; fullSize = size; chars = new char[size]; worms = new List <Worm> { WormGenerator.Create(fullSize) }; for (int i = 0; i < size; i++) { chars[i] = ' '; } }
//int counter = 0; public void Scroll() { foreach (var worm in worms) { worm.Move(); } var lastWorm = worms.Last(); if (lastWorm.Y >= lastWorm.Size) { worms.Add(WormGenerator.Create(fullSize)); } var firstWorm = worms.First(); if (firstWorm.Y >= firstWorm.Size + fullSize) { worms.Remove(firstWorm); } RefreshChars(); }