Skip to content

Commit 126f711

Browse files
committed
Better match with -x version
1 parent d2cbb88 commit 126f711

File tree

7 files changed

+11
-7
lines changed

7 files changed

+11
-7
lines changed

templates/cocos2d iOS demo.xctemplate/Classes/GameTypes.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
//
1111
// -----------------------------------------------------------------
1212

13+
#define kGameLoadColor [CCColor colorWithRed:0.25 green:0.125 blue:0.0]
14+
#define kGameContrastColor [CCColor colorWithRed:0.5 green:0.25 blue:0.0]
15+
1316
#define kGrossiniJumpTime 1.0
1417
#define kGrossiniJumps 5
1518

templates/cocos2d iOS demo.xctemplate/Classes/Paddle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ typedef NS_ENUM(NSUInteger, PaddleSide)
3838

3939
+ (instancetype)paddleWithSide:(PaddleSide)side;
4040

41-
- (BOOL)validPosition:(CGPoint)position;
41+
- (BOOL)validTouchPosition:(CGPoint)position;
4242

4343
// -----------------------------------------------------------------
4444

templates/cocos2d iOS demo.xctemplate/Classes/Paddle.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ - (instancetype)initWithSide:(PaddleSide)side
4747

4848
// -----------------------------------------------------------------
4949

50-
- (BOOL)validPosition:(CGPoint)position
50+
- (BOOL)validTouchPosition:(CGPoint)position
5151
{
5252
if (_side == PaddleSideLeft) return (position.x < kGamePaddleTouchArea);
5353
return (position.x > (_gameSize.width - kGamePaddleTouchArea));

templates/cocos2d iOS demo.xctemplate/Classes/gameScene.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ - (void)touchBegan:(CCTouch *)touch withEvent:(CCTouchEvent *)event
106106
{
107107
// find out what paddle is being touched
108108
Paddle *paddle = nil;
109-
if ([_paddleA validPosition:touch.locationInWorld]) paddle = _paddleA;
110-
else if ([_paddleB validPosition:touch.locationInWorld]) paddle = _paddleB;
109+
if ([_paddleA validTouchPosition:touch.locationInWorld]) paddle = _paddleA;
110+
else if ([_paddleB validTouchPosition:touch.locationInWorld]) paddle = _paddleB;
111111

112112
// if the touch is not for a paddle, just pass the touch on, and exit
113113
if (paddle == nil)
@@ -144,7 +144,7 @@ - (void)touchMoved:(CCTouch *)touch withEvent:(CCTouchEvent *)event
144144
}
145145

146146
// check for valid position
147-
if ([paddle validPosition:touch.locationInWorld])
147+
if ([paddle validTouchPosition:touch.locationInWorld])
148148
{
149149
paddle.destination = touch.locationInWorld.y;
150150
}

templates/cocos2d iOS demo.xctemplate/Classes/loadScene.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#import "LoadScene.h"
1414
#import "MainScene.h"
15+
#import "GameTypes.h"
1516

1617
// -----------------------------------------------------------------------
1718

@@ -46,7 +47,7 @@ - (id)init
4647
background.anchorPoint = CGPointZero;
4748
background.position = CGPointZero;
4849
background.contentSize = size;
49-
background.color = [CCColor grayColor];
50+
background.color = kGameLoadColor;
5051
[self addChild:background];
5152

5253
// loading text

templates/cocos2d iOS demo.xctemplate/Classes/mainScene.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ - (id)init
5454
CCSprite9Slice *background = [CCSprite9Slice spriteWithImageNamed:@"white_square.png"];
5555
background.anchorPoint = CGPointZero;
5656
background.contentSize = size;
57-
background.color = [CCColor orangeColor];
57+
background.color = kGameContrastColor;
5858
[self addChild:background];
5959

6060
// add grossini (we have missed him)

0 commit comments

Comments
 (0)