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

iOS Object-Oriented Swift Class Inheritance Overriding Methods

Why does `LaserTower` continue to `fire` `while enemy.life >= 0` instead of `> 0`?

As of now, enemy.life will be -1 after calling laserTower.fire(at: enemy)

Jhoan Arango
Jhoan Arango
14,575 Points

Hello,

Would you be able to explain your question a bit better ? Perhaps giving an example, or pointing out in the video what it is that is confusing you.

Thank you

1 Answer

Could be just speculation, but I've played tabletop games that count "0" as still having life. Might be personal preference in what he considers to be dead vs. alive