3233
10
 
10
 
11
@implementation Store
11
@implementation Store
12
 
12
 
 
 
13
NSArray *weapons;
 
 
14
NSArray *armors;
 
 
15
NSArray *skins;
 
 
16
NSArray *coinPacks;
 
 
17
 
13
+(CCScene *) scene
18
+(CCScene *) scene
14
{
19
{
15
    // 'scene' is an autorelease object.
20
    // 'scene' is an autorelease object.
...
 
...
 
25
    return scene;
30
    return scene;
26
}
31
}
27
 
32
 
 
 
33
-(void)populateItemsData
 
 
34
{
 
 
35
    StoreItem *item = [[[StoreItem alloc] init] autorelease];
 
 
36
    item.name = @"Power Gun 1";
 
 
37
    item.assetName = @"wep1.png";
 
 
38
    item.description = @"This gun will enhance our gunpower";
 
 
39
    item.credits = 20;
 
 
40
    item.value = 10;
 
 
41
    item.type = GUN;
 
 
42
    item.duration = 5;
 
 
43
 
 
 
44
}
 
 
45
 
28
-(id) init
46
-(id) init
29
{
47
{
30
    // always call "super" init
48
    // always call "super" init
...
 
...
 
115
        CCSprite *showCase = [CCSprite spriteWithFile:@"showCase1.png"];
133
        CCSprite *showCase = [CCSprite spriteWithFile:@"showCase1.png"];
116
        showCase.position = ccp(160,240);
134
        showCase.position = ccp(160,240);
117
 
135
 
 
 
136
 
 
 
137
        [self populateItemsData];
118
 
138
 
119
        [self addChild:myMenu];
139
        [self addChild:myMenu];
120
        [self addChild:label];
140
        [self addChild:label];
 
 
141
 
 
 
142
 
121
        [self addChild:showCase];
143
        [self addChild:showCase];
122
        [self addChild:storeMenu1];
144
        [self addChild:storeMenu1];
123
        [self addChild:storeMenuL];
145
        [self addChild:storeMenuL];