Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added new graphics. Added round changing on win.

  • Loading branch information...
commit 644817fbabd4d59b3b9d550831e336a91e789f04 1 parent 58185f8
Robin Debreuil authored
24 WordGrid.xcodeproj/project.pbxproj
@@ -23,8 +23,6 @@
23 23 84827BBA149E663C0098E408 /* WordGridTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 84827BB9149E663C0098E408 /* WordGridTests.m */; };
24 24 84827BCD149E67050098E408 /* Tile.m in Sources */ = {isa = PBXBuildFile; fileRef = 84827BCA149E67050098E408 /* Tile.m */; };
25 25 84827BCE149E67050098E408 /* TileGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = 84827BCC149E67050098E408 /* TileGrid.m */; };
26   - 84827BD5149E67170098E408 /* bkgGameH.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 84827BCF149E67170098E408 /* bkgGameH.jpg */; };
27   - 84827BD6149E67170098E408 /* bkgGameV.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 84827BD0149E67170098E408 /* bkgGameV.jpg */; };
28 26 84827BD7149E67170098E408 /* let_norm.png in Resources */ = {isa = PBXBuildFile; fileRef = 84827BD1149E67170098E408 /* let_norm.png */; };
29 27 84827BD8149E67170098E408 /* let_sel0.png in Resources */ = {isa = PBXBuildFile; fileRef = 84827BD2149E67170098E408 /* let_sel0.png */; };
30 28 84827BD9149E67170098E408 /* let_sel1.png in Resources */ = {isa = PBXBuildFile; fileRef = 84827BD3149E67170098E408 /* let_sel1.png */; };
@@ -36,6 +34,10 @@
36 34 84C9D8E5149E8D6E00486E32 /* VTC_letterer_pro.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 84C9D8E4149E8D6E00486E32 /* VTC_letterer_pro.ttf */; };
37 35 84D674DD149FBA6900782018 /* AnswerGrid.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D674DC149FBA6900782018 /* AnswerGrid.m */; };
38 36 84F9CD0014A7CD6000891234 /* errorTile.png in Resources */ = {isa = PBXBuildFile; fileRef = 84F9CCFF14A7CD6000891234 /* errorTile.png */; };
  37 + 84F9CD0614A90BD200891234 /* main_horz.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 84F9CD0214A90BD200891234 /* main_horz.jpg */; };
  38 + 84F9CD0714A90BD200891234 /* main_vert.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 84F9CD0314A90BD200891234 /* main_vert.jpg */; };
  39 + 84F9CD0814A90BD200891234 /* victory_horz.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 84F9CD0414A90BD200891234 /* victory_horz.jpg */; };
  40 + 84F9CD0914A90BD200891234 /* victory_vert.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 84F9CD0514A90BD200891234 /* victory_vert.jpg */; };
39 41 /* End PBXBuildFile section */
40 42
41 43 /* Begin PBXContainerItemProxy section */
@@ -73,8 +75,6 @@
73 75 84827BCA149E67050098E408 /* Tile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Tile.m; sourceTree = "<group>"; };
74 76 84827BCB149E67050098E408 /* TileGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TileGrid.h; sourceTree = "<group>"; };
75 77 84827BCC149E67050098E408 /* TileGrid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TileGrid.m; sourceTree = "<group>"; };
76   - 84827BCF149E67170098E408 /* bkgGameH.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = bkgGameH.jpg; sourceTree = "<group>"; };
77   - 84827BD0149E67170098E408 /* bkgGameV.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = bkgGameV.jpg; sourceTree = "<group>"; };
78 78 84827BD1149E67170098E408 /* let_norm.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = let_norm.png; sourceTree = "<group>"; };
79 79 84827BD2149E67170098E408 /* let_sel0.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = let_sel0.png; sourceTree = "<group>"; };
80 80 84827BD3149E67170098E408 /* let_sel1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = let_sel1.png; sourceTree = "<group>"; };
@@ -91,6 +91,10 @@
91 91 84D674DC149FBA6900782018 /* AnswerGrid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AnswerGrid.m; sourceTree = "<group>"; };
92 92 84D674DE149FBDF500782018 /* GridProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GridProtocol.h; sourceTree = "<group>"; };
93 93 84F9CCFF14A7CD6000891234 /* errorTile.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = errorTile.png; sourceTree = "<group>"; };
  94 + 84F9CD0214A90BD200891234 /* main_horz.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = main_horz.jpg; sourceTree = "<group>"; };
  95 + 84F9CD0314A90BD200891234 /* main_vert.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = main_vert.jpg; sourceTree = "<group>"; };
  96 + 84F9CD0414A90BD200891234 /* victory_horz.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = victory_horz.jpg; sourceTree = "<group>"; };
  97 + 84F9CD0514A90BD200891234 /* victory_vert.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = victory_vert.jpg; sourceTree = "<group>"; };
94 98 /* End PBXFileReference section */
95 99
96 100 /* Begin PBXFrameworksBuildPhase section */
@@ -199,9 +203,11 @@
199 203 84827BC3149E66AE0098E408 /* Images */ = {
200 204 isa = PBXGroup;
201 205 children = (
  206 + 84F9CD0214A90BD200891234 /* main_horz.jpg */,
  207 + 84F9CD0314A90BD200891234 /* main_vert.jpg */,
  208 + 84F9CD0414A90BD200891234 /* victory_horz.jpg */,
  209 + 84F9CD0514A90BD200891234 /* victory_vert.jpg */,
202 210 84F9CCFF14A7CD6000891234 /* errorTile.png */,
203   - 84827BCF149E67170098E408 /* bkgGameH.jpg */,
204   - 84827BD0149E67170098E408 /* bkgGameV.jpg */,
205 211 84827BD1149E67170098E408 /* let_norm.png */,
206 212 84827BD2149E67170098E408 /* let_sel0.png */,
207 213 84827BD3149E67170098E408 /* let_sel1.png */,
@@ -318,8 +324,6 @@
318 324 84827B96149E663B0098E408 /* InfoPlist.strings in Resources */,
319 325 84827BA2149E663C0098E408 /* DDWViewController_iPhone.xib in Resources */,
320 326 84827BA5149E663C0098E408 /* DDWViewController_iPad.xib in Resources */,
321   - 84827BD5149E67170098E408 /* bkgGameH.jpg in Resources */,
322   - 84827BD6149E67170098E408 /* bkgGameV.jpg in Resources */,
323 327 84827BD7149E67170098E408 /* let_norm.png in Resources */,
324 328 84827BD8149E67170098E408 /* let_sel0.png in Resources */,
325 329 84827BD9149E67170098E408 /* let_sel1.png in Resources */,
@@ -327,6 +331,10 @@
327 331 84C9D8E2149E822700486E32 /* GameView.xib in Resources */,
328 332 84C9D8E5149E8D6E00486E32 /* VTC_letterer_pro.ttf in Resources */,
329 333 84F9CD0014A7CD6000891234 /* errorTile.png in Resources */,
  334 + 84F9CD0614A90BD200891234 /* main_horz.jpg in Resources */,
  335 + 84F9CD0714A90BD200891234 /* main_vert.jpg in Resources */,
  336 + 84F9CD0814A90BD200891234 /* victory_horz.jpg in Resources */,
  337 + 84F9CD0914A90BD200891234 /* victory_vert.jpg in Resources */,
330 338 );
331 339 runOnlyForDeploymentPostprocessing = 0;
332 340 };
BIN  WordGrid.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
10 WordGrid.xcodeproj/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
@@ -8,13 +8,13 @@
8 8 ignoreCount = "0"
9 9 continueAfterRunningActions = "No"
10 10 isPathRelative = "1"
11   - filePath = "WordGrid/TileGrid.m"
12   - timestampString = "346560650.704567"
  11 + filePath = "WordGrid/GameVC.m"
  12 + timestampString = "346567894.367455"
13 13 startingColumnNumber = "9223372036854775807"
14 14 endingColumnNumber = "9223372036854775807"
15   - startingLineNumber = "338"
16   - endingLineNumber = "338"
17   - landmarkName = "-insertTile:At:"
  15 + startingLineNumber = "145"
  16 + endingLineNumber = "145"
  17 + landmarkName = "-nextRound"
18 18 landmarkType = "5">
19 19 </FileBreakpoint>
20 20 </FileBreakpoints>
1  WordGrid/AnswerData.h
@@ -9,5 +9,6 @@
9 9 + (int) getCurrentIndex;
10 10 + (NSString *) getCurrentQuote;
11 11 + (NSString *) getCurrentGrid;
  12 ++ (int) incrementIndex;
12 13
13 14 @end
36 WordGrid/AnswerData.m
@@ -2,15 +2,29 @@
2 2
3 3 @implementation AnswerData
4 4
  5 +static int currentIndex;
5 6 static NSArray *quotes;
6 7
7 8 + (void) initialize
8 9 {
  10 + currentIndex = 0;
9 11 quotes = [NSArray arrayWithObjects:
10 12 [NSArray arrayWithObjects:
  13 + @"FIND ALL THE WORDS",
  14 + @" TW ALHO FINDLERDS", nil
  15 + ],
  16 + [NSArray arrayWithObjects:
  17 + @"PRESS ON THE ANSWER AREA TO UNDO SOME WORDS",
  18 + @" SW UNDOOO PRESSMRDSANSAREETOTHEWERAON", nil
  19 + ],
  20 + [NSArray arrayWithObjects:
11 21 @"THE BIGGER THEY COME THE HARDER THEY FALL",
12   - @" AH I OETL GGBMRCHHEEHEEHTYFLTRYTDEREA", nil
13   - ],
  22 + @" H F TTARA BIGHHEDERTHEGERYLLCOMEETHEY", nil
  23 + ],
  24 + [NSArray arrayWithObjects:
  25 + @"ON A RAINY NIGHT IN SOHO THE WIND WAS WHISTLING ALL ITS CHARMS",
  26 + @"R A S A OIWITDIRMNNWANINTSAYHESLSNGSTHICHIOHOWNIGHTALL", nil
  27 + ],
14 28 [NSArray arrayWithObjects:
15 29 @"A LEADER LEADS BY EXAMPLE NOT BY FORCE",
16 30 @" E M TO PE CN ELAELYF EASAYAXO DRDLBBRE", nil
@@ -34,23 +48,29 @@ + (void) initialize
34 48 [NSArray arrayWithObjects:
35 49 @"ALL WARFARE IS BASED ON DECEPTION",
36 50 @" E TCI ESIPS ANAOD FREBEALLDORAWN", nil
37   - ],
  51 + ],
38 52 [NSArray arrayWithObjects:
39 53 @"TO A SURROUNDED ENEMY YOU MUST LEAVE A WAY OF ESCAPE",
40 54 @" E U LSUND TSUMODEEOAERRCAYFYMNSUEAVEYOETAWAPO", nil
41 55 ],
42   - [NSArray arrayWithObjects:
43   - @"ON A RAINY NIGHT IN SOHO THE WIND WAS WHISTLING ALL ITS CHARMS",
44   - @"R A S A OIWITDIRMNNWANINTSAYHESLSNGSTHICHIOHOWNIGHTALL", nil
45   - ],
46 56 nil
47 57 ];
48 58 }
49 59
50 60 + (int) getCurrentIndex
51 61 {
52   - return 8;
  62 + return currentIndex;
53 63 }
  64 +
  65 ++ (int) incrementIndex
  66 +{
  67 + currentIndex++;
  68 + if(currentIndex >= quotes.count)
  69 + {
  70 + currentIndex = 0;
  71 + }
  72 +}
  73 +
54 74 + (NSString *) getCurrentQuote
55 75 {
56 76 return [[quotes objectAtIndex:[AnswerData getCurrentIndex]] objectAtIndex:0];
1  WordGrid/AnswerGrid.h
@@ -20,5 +20,6 @@
20 20 - (void) showFirstLetterHints;
21 21 - (void) showVowelHints;
22 22 - (Boolean) testCurrentWordCorrect;
  23 +- (Boolean) didWin;
23 24
24 25 @end
30 WordGrid/AnswerGrid.m
@@ -10,29 +10,33 @@ @implementation AnswerGrid
10 10
11 11 - (void) setup
12 12 {
13   - answer = [AnswerData getCurrentQuote];
14   - answerWords = [answer componentsSeparatedByString: @" "];
15 13 gw = 15;
16 14 gh = 4;
17   - margin = 2;
18   - answerIndex = 0;
  15 + margin = 2;
19 16
20 17 [self createGrid];
21 18 }
22 19
23 20 - (void) createLetters
24 21 {
  22 + answer = [AnswerData getCurrentQuote];
  23 + answerWords = [answer componentsSeparatedByString: @" "];
25 24 wordBoundries = [[NSMutableArray alloc] init];
  25 + answerIndex = 0;
  26 + answerLength = 0;
  27 +
26 28 int wordIndex = 0;
27 29 int charIndex = 0;
28 30 NSString *curWord = [answerWords objectAtIndex:wordIndex];
29 31 NSString *curLetter;
30 32 BOOL complete = NO;
31   - answerLength = 0;
32 33
33 34 for (Tile* t in tiles)
34 35 {
35   - [t setIsSelectable:NO];
  36 + [t setIsSelectable:NO];
  37 + [t setSelected:NO];
  38 + [t setErrorMarkVisible:NO];
  39 + [t setLetterShowing:NO];
36 40
37 41 if(complete)
38 42 {
@@ -327,6 +331,20 @@ - (Boolean) testCurrentWordCorrect
327 331 return result;
328 332 }
329 333
  334 +- (Boolean) didWin
  335 +{
  336 + Boolean result = YES;
  337 + for (int i = 0; i < answerLength; i++)
  338 + {
  339 + if(![[tiles objectAtIndex:i] isCorrectLetter])
  340 + {
  341 + result = NO;
  342 + break;
  343 + }
  344 + }
  345 + return result;
  346 +}
  347 +
330 348 @end
331 349
332 350
1  WordGrid/GameVC.h
@@ -23,6 +23,7 @@
23 23 int lastSelectedTileIndex;
24 24 }
25 25
  26 +- (void) nextRound;
26 27 - (void) tileSelected:(Tile *) t;
27 28 - (void) answerSelected:(NSNotification *)notification;
28 29 - (void) setOrientation;
43 WordGrid/GameVC.m
... ... @@ -1,6 +1,7 @@
1 1 #import "GameVC.h"
2 2 #import "TileGrid.h"
3 3 #import "Tile.h"
  4 +#import "AnswerData.h"
4 5
5 6 @implementation GameVC
6 7
@@ -49,8 +50,8 @@ - (void) tileSelected:(NSNotification *)notification
49 50 {
50 51 if(finished)
51 52 {
52   - [self testWordComplete];
53 53 [at setIsSelectable:YES];
  54 + [self testWordComplete];
54 55 }
55 56 }
56 57 ];
@@ -120,17 +121,33 @@ - (void) testWordComplete
120 121 {
121 122 [tileGrid resetGrid];
122 123 [tileGrid removeTilesAndDrop:answerRefs];
  124 + [answerRefs removeAllObjects];
123 125
124   - if([[answerGrid getNextTile] letterShowing])
  126 + Tile *nextTile = [answerGrid getNextTile];
  127 + if(nextTile == nil)
  128 + {
  129 + // all letters complete
  130 + if([answerGrid didWin])
  131 + {
  132 + [self nextRound];
  133 + }
  134 + }
  135 + else if([nextTile letterShowing])
125 136 {
126 137 NSString *let = [answerGrid getCurrentCorrectLetter];
127 138 [tileGrid setSelectableByLetter:let];
128   - }
129   -
130   - [answerRefs removeAllObjects];
  139 + }
131 140 }
132 141 }
133 142
  143 +- (void) nextRound
  144 +{
  145 + [AnswerData incrementIndex];
  146 + [tileGrid createRound];
  147 + [answerGrid createRound];
  148 + NSString *let = [answerGrid getCurrentCorrectLetter];
  149 + [tileGrid setSelectableByLetter:let];
  150 +}
134 151
135 152 - (void)didReceiveMemoryWarning
136 153 {
@@ -145,7 +162,7 @@ - (void)viewDidLoad
145 162 [super viewDidLoad];
146 163
147 164 answerRefs = [[NSMutableArray alloc] initWithCapacity:20];
148   -
  165 +
149 166 [[NSNotificationCenter defaultCenter]
150 167 addObserver:self
151 168 selector:@selector(tileSelected:)
@@ -161,7 +178,10 @@ - (void)viewDidLoad
161 178 [self setOrientation];
162 179
163 180 NSString *let = [answerGrid getCurrentCorrectLetter];
164   - [tileGrid setSelectableByLetter:let];
  181 + if(let != nil)
  182 + {
  183 + [tileGrid setSelectableByLetter:let];
  184 + }
165 185 }
166 186
167 187 - (void)viewDidUnload
@@ -181,21 +201,24 @@ - (void) setOrientation
181 201 {
182 202 UIInterfaceOrientation io = [self interfaceOrientation];
183 203 CGRect df = btDone.frame;
184   - CGRect tf = tileGrid.frame;
  204 + CGRect tf = tileGrid.frame;
  205 + CGRect af = answerGrid.frame;
185 206
186 207 if (io == UIInterfaceOrientationPortrait ||
187 208 io == UIInterfaceOrientationPortraitUpsideDown)
188 209 {
189 210 bkgV.hidden = NO;
190 211 bkgH.hidden = YES;
191   - tileGrid.frame = CGRectMake(50, 180, tf.size.width, tf.size.height);
  212 + tileGrid.frame = CGRectMake(45, 180, tf.size.width, tf.size.height);
  213 + answerGrid.frame = CGRectMake(70, 766, af.size.width, af.size.height);
192 214 }
193 215 else if (io == UIInterfaceOrientationLandscapeLeft ||
194 216 io == UIInterfaceOrientationLandscapeRight)
195 217 {
196 218 bkgV.hidden = YES;
197 219 bkgH.hidden = NO;
198   - tileGrid.frame = CGRectMake(300, 170, tf.size.width, tf.size.height);
  220 + tileGrid.frame = CGRectMake(278, 14, tf.size.width, tf.size.height);
  221 + answerGrid.frame = CGRectMake(300, 574, af.size.width, af.size.height);
199 222 }
200 223
201 224 btDone.frame = CGRectMake( tileGrid.frame.origin.x + tileGrid.frame.size.width - df.size.width,
31 WordGrid/GameView.xib
@@ -44,12 +44,16 @@
44 44 <reference key="NSSuperview" ref="191373211"/>
45 45 <reference key="NSWindow"/>
46 46 <reference key="NSNextKeyView" ref="312021246"/>
  47 + <object class="NSColor" key="IBUIBackgroundColor" id="787399798">
  48 + <int key="NSColorSpace">3</int>
  49 + <bytes key="NSWhite">MAA</bytes>
  50 + </object>
47 51 <int key="IBUIContentMode">2</int>
48 52 <bool key="IBUIUserInteractionEnabled">NO</bool>
49 53 <string key="targetRuntimeIdentifier">IBIPadFramework</string>
50 54 <object class="NSCustomResource" key="IBUIImage">
51 55 <string key="NSClassName">NSImage</string>
52   - <string key="NSResourceName">bkgGameV.jpg</string>
  56 + <string key="NSResourceName">main_vert.jpg</string>
53 57 </object>
54 58 </object>
55 59 <object class="IBUIImageView" id="312021246">
@@ -60,11 +64,12 @@
60 64 <reference key="NSSuperview" ref="191373211"/>
61 65 <reference key="NSWindow"/>
62 66 <reference key="NSNextKeyView" ref="1016526659"/>
  67 + <reference key="IBUIBackgroundColor" ref="787399798"/>
63 68 <bool key="IBUIUserInteractionEnabled">NO</bool>
64 69 <string key="targetRuntimeIdentifier">IBIPadFramework</string>
65 70 <object class="NSCustomResource" key="IBUIImage">
66 71 <string key="NSClassName">NSImage</string>
67   - <string key="NSResourceName">bkgGameH.jpg</string>
  72 + <string key="NSResourceName">main_horz.jpg</string>
68 73 </object>
69 74 </object>
70 75 <object class="IBUIButton" id="1029336070">
@@ -106,7 +111,7 @@
106 111 <object class="IBUIView" id="248888508">
107 112 <reference key="NSNextResponder" ref="191373211"/>
108 113 <int key="NSvFlags">292</int>
109   - <string key="NSFrame">{{129, 726}, {630, 168}}</string>
  114 + <string key="NSFrame">{{300, 572}, {630, 168}}</string>
110 115 <reference key="NSSuperview" ref="191373211"/>
111 116 <reference key="NSWindow"/>
112 117 <reference key="NSNextKeyView" ref="1029336070"/>
@@ -121,7 +126,7 @@
121 126 <reference key="NSNextResponder" ref="191373211"/>
122 127 <int key="NSvFlags">1316</int>
123 128 <object class="NSPSMatrix" key="NSFrameMatrix"/>
124   - <string key="NSFrame">{{47, 180}, {675, 525}}</string>
  129 + <string key="NSFrame">{{278, 14}, {675, 525}}</string>
125 130 <reference key="NSSuperview" ref="191373211"/>
126 131 <reference key="NSWindow"/>
127 132 <reference key="NSNextKeyView" ref="248888508"/>
@@ -137,13 +142,7 @@
137 142 <reference key="NSSuperview"/>
138 143 <reference key="NSWindow"/>
139 144 <reference key="NSNextKeyView" ref="158756890"/>
140   - <object class="NSColor" key="IBUIBackgroundColor">
141   - <int key="NSColorSpace">3</int>
142   - <bytes key="NSWhite">MQA</bytes>
143   - <object class="NSColorSpace" key="NSCustomColorSpace">
144   - <int key="NSID">2</int>
145   - </object>
146   - </object>
  145 + <reference key="IBUIBackgroundColor" ref="787399798"/>
147 146 <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
148 147 <int key="IBUIStatusBarStyle">2</int>
149 148 </object>
@@ -213,11 +212,11 @@
213 212 <int key="objectID">1</int>
214 213 <reference key="object" ref="191373211"/>
215 214 <array class="NSMutableArray" key="children">
216   - <reference ref="158756890"/>
217   - <reference ref="312021246"/>
218 215 <reference ref="1029336070"/>
219   - <reference ref="248888508"/>
  216 + <reference ref="312021246"/>
  217 + <reference ref="158756890"/>
220 218 <reference ref="1016526659"/>
  219 + <reference ref="248888508"/>
221 220 </array>
222 221 <reference key="parent" ref="0"/>
223 222 </object>
@@ -363,8 +362,8 @@
363 362 <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
364 363 <int key="IBDocument.defaultPropertyAccessControl">3</int>
365 364 <dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
366   - <string key="bkgGameH.jpg">{640, 480}</string>
367   - <string key="bkgGameV.jpg">{480, 640}</string>
  365 + <string key="main_horz.jpg">{640, 480}</string>
  366 + <string key="main_vert.jpg">{480, 640}</string>
368 367 </dictionary>
369 368 <string key="IBCocoaTouchPluginVersion">933</string>
370 369 </data>
1  WordGrid/GridProtocol.h
@@ -5,6 +5,7 @@
5 5
6 6 - (void) setup;
7 7 - (void) createGrid;
  8 +- (void) createRound;
8 9 - (void) resetGrid;
9 10 - (void) layoutGrid:(Boolean) useAnimation;
10 11 - (int) getTileIndexFromMousePoint:(CGPoint) point;
1  WordGrid/Tile.m
@@ -83,6 +83,7 @@ - (void) setup
83 83
84 84 - (Boolean) isCorrectLetter
85 85 {
  86 + NSLog(@"%@ %@", letter, correctLetter);
86 87 return [letter isEqualToString:correctLetter];
87 88 }
88 89
13 WordGrid/TileGrid.m
@@ -72,8 +72,13 @@ -(void) createGrid
72 72 [self addSubview:tile];
73 73 }
74 74 }
  75 + [self createRound];
  76 +}
  77 +
  78 +- (void) createRound
  79 +{
75 80 [self createLetters];
76   - [self layoutGrid:NO];
  81 + [self layoutGrid:NO];
77 82 }
78 83
79 84 - (void) layoutGrid:(Boolean) useAnimation
@@ -131,13 +136,9 @@ - (void) createLetters
131 136 int index = 0;
132 137 for (Tile* t in tiles)
133 138 {
134   - //NSString *s = [LETTERS substringWithRange:[LETTERS rangeOfComposedCharacterSequenceAtIndex:arc4random()%[LETTERS length]]];
135 139 NSString *s = [testString substringWithRange:NSMakeRange(index++, 1)];
136 140 [t setLetter:s];
137   - if(![s compare:@" "])
138   - {
139   - t.hidden = YES;
140   - }
  141 + t.hidden = ([s isEqualToString:@" "]);
141 142 }
142 143 NSLog(@"%@",[self serializeGridLetters]);
143 144 }
8 WordGrid/main.m
... ... @@ -1,11 +1,3 @@
1   -//
2   -// main.m
3   -// WordGrid
4   -//
5   -// Created by admin on 11-12-18.
6   -// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
7   -//
8   -
9 1 #import <UIKit/UIKit.h>
10 2
11 3 #import "DDWAppDelegate.h"
BIN  WordGrid/main_horz.jpg
BIN  WordGrid/main_vert.jpg
BIN  WordGrid/victory_horz.jpg
BIN  WordGrid/victory_vert.jpg

0 comments on commit 644817f

Please sign in to comment.
Something went wrong with that request. Please try again.