Game Development Reference
In-Depth Information
#import "StandardMoveComponent.h"
#import "StandardShootComponent.h"
. . .
@synthesize initialHitPoints, hitPoints;
-(id) initWithType:(EnemyTypes)enemyType
{
type = enemyType;
NSString* enemyFrameName;
NSString* bulletFrameName;
float shootFrequency = 6.0f;
initialHitPoints = 1;
switch (type)
{
case EnemyTypeUFO:
enemyFrameName = @"monster-a.png";
bulletFrameName = @"shot-a.png";
break;
case EnemyTypeCruiser:
enemyFrameName = @"monster-b.png";
bulletFrameName = @"shot-b.png";
shootFrequency = 1.0f;
initialHitPoints = 3;
break;
case EnemyTypeBoss:
enemyFrameName = @"monster-c.png";
bulletFrameName = @"shot-c.png";
shootFrequency = 2.0f;
initialHitPoints = 15;
break;
default:
[NSException exceptionWithName:@"Enemy Exception"
Search Nedrilad ::




Custom Search