Skip to content

Commit

Permalink
New centered icons. Split backgrounds and sprites into iphone, iphone…
Browse files Browse the repository at this point in the history
… hd, ipad, and ipad hd directories. Start using a FormFactor class to begin isolating iPhone vs. iPad layout dimensions.
  • Loading branch information
mcglincy committed Apr 12, 2012
1 parent a1a7aa3 commit b188e52
Show file tree
Hide file tree
Showing 185 changed files with 828 additions and 354 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added Assets/Graphics/sprites/iphone/devil_0.png
Binary file added Assets/Graphics/sprites/iphone/devil_1.png
Binary file added Assets/Graphics/sprites/iphone/devil_2.png
Binary file added Assets/Graphics/sprites/iphone/floor.png
Binary file added Assets/Graphics/sprites/iphone/maestro_0.png
Binary file added Assets/Graphics/sprites/iphone/maestro_1.png
Binary file added Assets/Graphics/sprites/iphone/maestro_2.png
Binary file added Assets/Graphics/sprites/iphone/maestro_3.png
Binary file added Assets/Graphics/sprites/iphone/person_0.png
Binary file added Assets/Graphics/sprites/iphone/person_1.png
Binary file added Assets/Graphics/sprites/iphone/shop_sign_0.png
Binary file added Assets/Graphics/sprites/iphone/shop_sign_1.png
Binary file added Assets/Graphics/sprites/iphone/shop_sign_2.png
Binary file added Assets/Graphics/sprites/iphone/tear_0.png
Binary file added Assets/Graphics/sprites/iphone/tear_1.png
Binary file added Assets/Graphics/sprites/iphone/tear_2.png
Binary file added Assets/Graphics/sprites/iphone/tear_3.png
Binary file added Assets/Graphics/sprites/iphone/tear_4.png
Binary file added Assets/Graphics/sprites/iphone/tear_5.png
Binary file added Assets/Graphics/sprites/iphone/tear_6.png
Binary file added Assets/Graphics/sprites/iphone/tear_7.png
Binary file added Assets/Graphics/sprites/iphone/tear_8.png
Binary file added Assets/Graphics/sprites/iphone/violin_case.png
Binary file added Assets/Graphics/sprites/iphonehd/devil_0-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/devil_1-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/devil_2-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/floor-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/maestro_0-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/maestro_1-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/maestro_2-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/maestro_3-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/person_0-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/person_1-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/tear_0-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/tear_1-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/tear_2-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/tear_3-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/tear_4-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/tear_5-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/tear_6-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/tear_7-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/tear_8-hd.png
Binary file added Assets/Graphics/sprites/iphonehd/violin_case-hd.png
1,068 changes: 732 additions & 336 deletions Maestro.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file not shown.
2 changes: 1 addition & 1 deletion Maestro/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// When in iPhone RetinaDisplay, iPad, iPad RetinaDisplay mode, CCFileUtils will append the "-hd", "-ipad", "-ipadhd" to all loaded files
// If the -hd, -ipad, -ipadhd files are not found, it will load the non-suffixed version
[CCFileUtils setiPhoneRetinaDisplaySuffix:@"-hd"]; // Default on iPhone RetinaDisplay is "-hd"
[CCFileUtils setiPadSuffix:@""]; // Default on iPad is "" (empty string)
[CCFileUtils setiPadSuffix:@"-ipad"]; // Default on iPad is "" (empty string)
[CCFileUtils setiPadRetinaDisplaySuffix:@"-ipadhd"]; // Default on iPad RetinaDisplay is "-ipadhd"

// Assume that PVR images have premultiplied alpha
Expand Down
1 change: 0 additions & 1 deletion Maestro/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@

#import <Foundation/Foundation.h>

#define FLOOR_HEIGHT 40.0
#define SCENE_TRANSITION_TIME 0.5
#define FONT_NAME @"Courier"
2 changes: 1 addition & 1 deletion Maestro/Devil.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ @implementation Devil

- (id)init
{
self = [super initWithFile:@"devil_1.png" rect:CGRectMake(0, 0, 384, 384)];
self = [super initWithFile:@"devil_1.png"];
if (self) {
CCAnimation *anim = [CCAnimation animation];
[anim addFrameWithFilename:@"devil_2.png"];
Expand Down
2 changes: 1 addition & 1 deletion Maestro/Floor.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@implementation Floor
- (id)init
{
self = [super initWithFile:@"floor.png" rect:CGRectMake(0, 0, 1024, 40)];
self = [super initWithFile:@"floor.png"];
if (self) {
}
return self;
Expand Down
19 changes: 19 additions & 0 deletions Maestro/FormFactor.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// FormFactor.h
// Maestro
//
// Created by Matthew McGlincy on 4/11/12.
// Copyright (c) 2012 n/a. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface FormFactor : NSObject

+ (BOOL)isIPhone;
+ (BOOL)isIPad;
+ (CGFloat)floorHeight;
+ (CGFloat)tearPhysicsBodyDiameter;
+ (CGFloat)violinCasePositionX;

@end
53 changes: 53 additions & 0 deletions Maestro/FormFactor.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//
// FormFactor.m
// Maestro
//
// Created by Matthew McGlincy on 4/11/12.
// Copyright (c) 2012 n/a. All rights reserved.
//

#import "FormFactor.h"
#import "cocos2d.h"

@implementation FormFactor

+ (BOOL)isIPhone
{
return ![self isIPad];
}

+ (BOOL)isIPad
{
CGSize winSize = [[CCDirector sharedDirector] winSize];
return winSize.width == 1024 || winSize.width == 768;
}

+ (CGFloat)floorHeight
{
// 40 on iPad, 20 on iPhone
if ([self isIPad]) {
return 40.0;
} else {
return 20.0;
}
}

+ (CGFloat)tearPhysicsBodyDiameter
{
if ([self isIPad]) {
return 100.0;
} else {
return 50.0;
}
}

+ (CGFloat)violinCasePositionX
{
if ([self isIPad]) {
return 284.0;
} else {
return 100.0;
}
}

@end
10 changes: 6 additions & 4 deletions Maestro/GameLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#import "GameScene.h"
#import "GameSoundManager.h"
#import "Floor.h"
#import "FormFactor.h"
#import "Maestro.h"
#import "Person.h"
#import "Physics.h"
Expand Down Expand Up @@ -80,21 +81,22 @@ - (id)initWithLevelNum:(NSInteger)levelNum
CGSize winSize = [[CCDirector sharedDirector] winSize];
Maestro *maestro = [Maestro node];
maestro.position = ccp(maestro.contentSize.width / 2,
FLOOR_HEIGHT + maestro.contentSize.height / 2);
[FormFactor floorHeight] + maestro.contentSize.height / 2);
[self addChild:maestro z:1];

Person *p1 = [Person node];
p1.position = ccp(winSize.width - p1.contentSize.width / 2,
FLOOR_HEIGHT + p1.contentSize.height / 2);
[FormFactor floorHeight] + p1.contentSize.height / 2);
[self addChild:p1 z:1];

Person *p2 = [Person node];
p2.position = ccp(winSize.width - p2.contentSize.width / 2 - 100,
FLOOR_HEIGHT + p2.contentSize.height / 2);
[FormFactor floorHeight] + p2.contentSize.height / 2);
[self addChild:p2 z:1];

ViolinCase *violinCase = [ViolinCase node];
violinCase.position = ccp(284, FLOOR_HEIGHT + violinCase.contentSize.height / 2);
violinCase.position = ccp([FormFactor violinCasePositionX],
[FormFactor floorHeight] + violinCase.contentSize.height / 2);
[self addChild:violinCase z:1];
[violinCase addToPhysics];

Expand Down
2 changes: 1 addition & 1 deletion Maestro/Maestro.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ @implementation Maestro

- (id)init
{
self = [super initWithFile:@"maestro_0.png" rect:CGRectMake(0, 0, 384, 384)];
self = [super initWithFile:@"maestro_0.png"];
if (self) {
CCAnimation *anim = [CCAnimation animation];
[anim addFrameWithFilename:@"maestro_1.png"];
Expand Down
2 changes: 1 addition & 1 deletion Maestro/Note.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ @implementation Note

- (id)init
{
self = [super initWithFile:@"gray_note.png" rect:CGRectMake(0, 0, 68, 84)];
self = [super initWithFile:@"gray_note.png"];
if (self) {
}
return self;
Expand Down
2 changes: 1 addition & 1 deletion Maestro/Person.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ @implementation Person

- (id)init
{
self = [super initWithFile:@"person_0.png" rect:CGRectMake(0, 0, 384, 384)];
self = [super initWithFile:@"person_0.png"];
if (self) {
CCAnimation *anim = [CCAnimation animation];
[anim addFrameWithFilename:@"person_1.png"];
Expand Down
4 changes: 3 additions & 1 deletion Maestro/Physics.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "Constants.h"
#import "FormFactor.h"
#import "Physics.h"
#import "PhysicsSprite.h"
#import "Tear.h"
Expand Down Expand Up @@ -55,6 +56,7 @@ - (cpSpace *)space
- (void)initPhysics
{
CGSize s = [[CCDirector sharedDirector] winSize];
NSLog(@"size %@", NSStringFromCGSize(s));

// init chipmunk
cpInitChipmunk();
Expand All @@ -67,7 +69,7 @@ - (void)initPhysics
// We have to free them manually
//
// bottom
walls_[0] = cpSegmentShapeNew( space_->staticBody, ccp(0,FLOOR_HEIGHT), ccp(s.width,0), 0.0f);
walls_[0] = cpSegmentShapeNew( space_->staticBody, ccp(0, [FormFactor floorHeight]), ccp(s.width,0), 0.0f);

// top
walls_[1] = cpSegmentShapeNew( space_->staticBody, ccp(0,s.height), ccp(s.width,s.height), 0.0f);
Expand Down
Binary file modified Maestro/Resources/Icon-72.png
Binary file modified Maestro/Resources/Icon-72@2x.png
Binary file modified Maestro/Resources/Icon-Small-50.png
Binary file modified Maestro/Resources/Icon-Small.png
Binary file modified Maestro/Resources/Icon-Small@2x.png
Binary file modified Maestro/Resources/Icon.png
Binary file modified Maestro/Resources/Icon@2x.png
4 changes: 3 additions & 1 deletion Maestro/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,15 @@
</dict>
</dict>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
<string>com.molyjam.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Maestro/ShopSign.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ @implementation ShopSign

- (id)init
{
self = [super initWithFile:@"shop_sign_0.png" rect:CGRectMake(0, 0, 256, 256)];
self = [super initWithFile:@"shop_sign_0.png"];
if (self) {
CCAnimation *anim = [CCAnimation animation];
[anim addFrameWithFilename:@"shop_sign_1.png"];
Expand Down
5 changes: 3 additions & 2 deletions Maestro/Tear.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright (c) 2012 n/a. All rights reserved.
//

#import "FormFactor.h"
#import "GameClock.h"
#import "GameManager.h"
#import "GameUtils.h"
Expand All @@ -30,7 +31,7 @@ @implementation Tear

- (id)init
{
self = [super initWithFile:@"tear_0.png" rect:CGRectMake(0, 0, 32, 32)];
self = [super initWithFile:@"tear_0.png"];
if (self) {
self.timeToDie = [[GameClock sharedInstance] currentTime] + [GameUtils randomTimeBetweenMin:MIN_LIFE max:MAX_LIFE];

Expand Down Expand Up @@ -60,7 +61,7 @@ - (id)init

- (void)addToPhysics
{
cpBody *body = cpBodyNew(1.0f, cpMomentForCircle(1.0f, 0, 100.0f, cpvzero)); //Tear diameter = 100. Using defines was causing compiler errors here :(
cpBody *body = cpBodyNew(1.0f, cpMomentForCircle(1.0f, 0, [FormFactor tearPhysicsBodyDiameter], cpvzero)); //Tear diameter = 100. Using defines was causing compiler errors here :(

body->p = self.position;
Physics *physics = [Physics sharedInstance];
Expand Down
2 changes: 1 addition & 1 deletion Maestro/VictoryMaestro.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ @implementation VictoryMaestro

- (id)init
{
self = [super initWithFile:@"victory_maestro_0.png" rect:CGRectMake(0, 0, 512, 384)];
self = [super initWithFile:@"victory_maestro_0.png"];
if (self) {
CCAnimation *anim = [CCAnimation animation];
[anim addFrameWithFilename:@"victory_maestro_1.png"];
Expand Down
2 changes: 1 addition & 1 deletion Maestro/ViolinCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ @implementation ViolinCase

- (id)init
{
self = [super initWithFile:@"violin_case.png" rect:CGRectMake(0, 0, 128, 128)];
self = [super initWithFile:@"violin_case.png"];
if (self) {
}
return self;
Expand Down

0 comments on commit b188e52

Please sign in to comment.