8bitshoot is an open source project powered by Assembla

Assembla offers free public and private SVN/Git repositories and project hosting with bug/issue tracking and collaboration tools.

8bitshoot

Commit 33

User picture
  • Author: munhra
  • 2012-03-22 00:53 (about 2 years ago)

Store implementation backend started.

Files Affected

 
3233
28
        B20EC20C14FD4306001EA5AD /* RobotBlaster.m in Sources */ = {isa = PBXBuildFile; fileRef = B20EC20B14FD4306001EA5AD /* RobotBlaster.m */; };
28
        B20EC20C14FD4306001EA5AD /* RobotBlaster.m in Sources */ = {isa = PBXBuildFile; fileRef = B20EC20B14FD4306001EA5AD /* RobotBlaster.m */; };
29
        B20EC20F14FD4319001EA5AD /* LevelController.m in Sources */ = {isa = PBXBuildFile; fileRef = B20EC20E14FD4319001EA5AD /* LevelController.m */; };
29
        B20EC20F14FD4319001EA5AD /* LevelController.m in Sources */ = {isa = PBXBuildFile; fileRef = B20EC20E14FD4319001EA5AD /* LevelController.m */; };
30
        B20EC21114FD43E8001EA5AD /* level1.json in Resources */ = {isa = PBXBuildFile; fileRef = B20EC21014FD43E8001EA5AD /* level1.json */; };
30
        B20EC21114FD43E8001EA5AD /* level1.json in Resources */ = {isa = PBXBuildFile; fileRef = B20EC21014FD43E8001EA5AD /* level1.json */; };
 
 
31
        B212873E151A3129009CD1BB /* storeStripe2.png in Resources */ = {isa = PBXBuildFile; fileRef = B212873D151A3129009CD1BB /* storeStripe2.png */; };
 
 
32
        B2128743151A3665009CD1BB /* StoreItem.m in Sources */ = {isa = PBXBuildFile; fileRef = B2128742151A3665009CD1BB /* StoreItem.m */; };
31
        B219D4351519F21100AABCC7 /* storeBG.png in Resources */ = {isa = PBXBuildFile; fileRef = B219D4341519F21100AABCC7 /* storeBG.png */; };
33
        B219D4351519F21100AABCC7 /* storeBG.png in Resources */ = {isa = PBXBuildFile; fileRef = B219D4341519F21100AABCC7 /* storeBG.png */; };
32
        B219D4381519F49000AABCC7 /* StoreButtonClk.png in Resources */ = {isa = PBXBuildFile; fileRef = B219D4371519F49000AABCC7 /* StoreButtonClk.png */; };
34
        B219D4381519F49000AABCC7 /* StoreButtonClk.png in Resources */ = {isa = PBXBuildFile; fileRef = B219D4371519F49000AABCC7 /* StoreButtonClk.png */; };
33
        B219D43A1519F95F00AABCC7 /* showCase1.png in Resources */ = {isa = PBXBuildFile; fileRef = B219D4391519F95F00AABCC7 /* showCase1.png */; };
35
        B219D43A1519F95F00AABCC7 /* showCase1.png in Resources */ = {isa = PBXBuildFile; fileRef = B219D4391519F95F00AABCC7 /* showCase1.png */; };
...
 
...
 
241
        B20EC20D14FD4319001EA5AD /* LevelController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
LevelController.h; sourceTree = "<group>"; };
243
        B20EC20D14FD4319001EA5AD /* LevelController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
LevelController.h; sourceTree = "<group>"; };
242
        B20EC20E14FD4319001EA5AD /* LevelController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path =
LevelController.m; sourceTree = "<group>"; };
244
        B20EC20E14FD4319001EA5AD /* LevelController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path =
LevelController.m; sourceTree = "<group>"; };
243
        B20EC21014FD43E8001EA5AD /* level1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = level1.json; sourceTree =
"<group>"; };
245
        B20EC21014FD43E8001EA5AD /* level1.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = level1.json; sourceTree =
"<group>"; };
 
 
246
        B212873D151A3129009CD1BB /* storeStripe2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = storeStripe2.png; sourceTree =
"<group>"; };
 
 
247
        B2128741151A3665009CD1BB /* StoreItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StoreItem.h;
sourceTree = "<group>"; };
 
 
248
        B2128742151A3665009CD1BB /* StoreItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoreItem.m;
sourceTree = "<group>"; };
244
        B219D4341519F21100AABCC7 /* storeBG.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = storeBG.png; sourceTree =
"<group>"; };
249
        B219D4341519F21100AABCC7 /* storeBG.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = storeBG.png; sourceTree =
"<group>"; };
245
        B219D4371519F49000AABCC7 /* StoreButtonClk.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = StoreButtonClk.png; sourceTree =
"<group>"; };
250
        B219D4371519F49000AABCC7 /* StoreButtonClk.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = StoreButtonClk.png; sourceTree =
"<group>"; };
246
        B219D4391519F95F00AABCC7 /* showCase1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = showCase1.png; sourceTree =
"<group>"; };
251
        B219D4391519F95F00AABCC7 /* showCase1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = showCase1.png; sourceTree =
"<group>"; };
...
 
...
 
629
            name = enemies;
634
            name = enemies;
630
            sourceTree = "<group>";
635
            sourceTree = "<group>";
631
        };
636
        };
 
 
637
        B2128740151A3641009CD1BB /* Store */ = {
 
 
638
            isa = PBXGroup;
 
 
639
            children = (
 
 
640
                B2128741151A3665009CD1BB /* StoreItem.h */,
 
 
641
                B2128742151A3665009CD1BB /* StoreItem.m */,
 
 
642
            );
 
 
643
            name = Store;
 
 
644
            sourceTree = "<group>";
 
 
645
        };
632
        B2E0967414F7D98300ADBC2F = {
646
        B2E0967414F7D98300ADBC2F = {
633
            isa = PBXGroup;
647
            isa = PBXGroup;
634
            children = (
648
            children = (
...
 
...
 
664
        B2E0969314F7D98300ADBC2F /* EightbitShooter */ = {
678
        B2E0969314F7D98300ADBC2F /* EightbitShooter */ = {
665
            isa = PBXGroup;
679
            isa = PBXGroup;
666
            children = (
680
            children = (
 
 
681
                B2128740151A3641009CD1BB /* Store */,
667
                A9E89D6414FDA426005B8FB5 /* JSON */,
682
                A9E89D6414FDA426005B8FB5 /* JSON */,
668
                B20EC20614FD42D1001EA5AD /* enemies */,
683
                B20EC20614FD42D1001EA5AD /* enemies */,
669
                B20EC20314FD4270001EA5AD /* scenes */,
684
                B20EC20314FD4270001EA5AD /* scenes */,
...
 
...
 
690
        B2E0969414F7D98300ADBC2F /* Resources */ = {
705
        B2E0969414F7D98300ADBC2F /* Resources */ = {
691
            isa = PBXGroup;
706
            isa = PBXGroup;
692
            children = (
707
            children = (
 
 
708
                B212873D151A3129009CD1BB /* storeStripe2.png */,
693
                B219D43F1519FC6600AABCC7 /* scrollBnt1Clk.png */,
709
                B219D43F1519FC6600AABCC7 /* scrollBnt1Clk.png */,
694
                B219D4401519FC6600AABCC7 /* scrollBnt2Clk.png */,
710
                B219D4401519FC6600AABCC7 /* scrollBnt2Clk.png */,
695
                B219D43D1519F9AE00AABCC7 /* scrollBnt2.png */,
711
                B219D43D1519F9AE00AABCC7 /* scrollBnt2.png */,
...
 
...
 
1208
                B219D43E1519F9AE00AABCC7 /* scrollBnt2.png in Resources */,
1224
                B219D43E1519F9AE00AABCC7 /* scrollBnt2.png in Resources */,
1209
                B219D4411519FC6600AABCC7 /* scrollBnt1Clk.png in Resources */,
1225
                B219D4411519FC6600AABCC7 /* scrollBnt1Clk.png in Resources */,
1210
                B219D4421519FC6600AABCC7 /* scrollBnt2Clk.png in Resources */,
1226
                B219D4421519FC6600AABCC7 /* scrollBnt2Clk.png in Resources */,
 
 
1227
                B212873E151A3129009CD1BB /* storeStripe2.png in Resources */,
1211
            );
1228
            );
1212
            runOnlyForDeploymentPostprocessing = 0;
1229
            runOnlyForDeploymentPostprocessing = 0;
1213
        };
1230
        };
...
 
...
 
1337
                B2EA47AA1513853D00884112 /* EndGame.m in Sources */,
1354
                B2EA47AA1513853D00884112 /* EndGame.m in Sources */,
1338
                A9F7175A1516A52E00C56096 /* HeroData.m in Sources */,
1355
                A9F7175A1516A52E00C56096 /* HeroData.m in Sources */,
1339
                A9FEE7301519572D00B04449 /* Store.m in Sources */,
1356
                A9FEE7301519572D00B04449 /* Store.m in Sources */,
 
 
1357
                B2128743151A3665009CD1BB /* StoreItem.m in Sources */,
1340
            );
1358
            );
1341
            runOnlyForDeploymentPostprocessing = 0;
1359
            runOnlyForDeploymentPostprocessing = 0;
1342
        };
1360
        };
3233
9
#import <Foundation/Foundation.h>
9
#import <Foundation/Foundation.h>
10
#import "cocos2d.h"
10
#import "cocos2d.h"
11
#import "MainMenu.h"
11
#import "MainMenu.h"
 
 
12
#import "StoreItem.h"
12
 
13
 
13
@interface Store : CCLayer
14
@interface Store : CCLayer
14
 
15
 
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];
Show contents
Show contents