Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Objects Loops and Final Touches Using Static Fields

archie p
PLUS
archie p
Courses Plus Student 1,129 Points

Invaders loop not working

My code is very similar to the code explained but I still get the output only once!! which suggests that the invader and tower loops are not working..

Any help??

1 Answer

Steven Parker
Steven Parker
231,271 Points

It also suggests that the parts of your code that are different from the code explained are causing it to operate differently.

If you believe this should not be the case, or if you need help in identifying the parts causing the issue, you can make a snapshot of your workspace and post the link to it here for analysis.

archie p
archie p
Courses Plus Student 1,129 Points

Thanks Steven. I finally got it working. I forgot to increment the remaining invader variable when the invader is active which is initialised to zero and so the code was only running once. All sorted.