Game Development Reference
In-Depth Information
class Invader
{
...
int _health
¼
10;
bool _dead
¼
false;
void OnShot()
{
_health--;
if (_health <= 0)
{
_dead
¼
true;
}
}
...
}
class FlyingSaucer
{
...
int _health
¼
10;
void OnShot()
{
_health--;
if (_health <= 0)
{
_dead
¼
true;
}
} ...
}
class Player
{
...
int _health
¼
10;
void OnShot()
{
_health--;
if (_health <= 0)
{
_dead
¼
true;
}
}
...
}
Search WWH ::
Custom Search