Skip to content

Commit b580f49

Browse files
committed
Merge branch 'develop-v3' of github:cocos2d/cocos2d-iphone into develop-v3
Former-commit-id: b3fc902
2 parents 337fa5a + 7f5a958 commit b580f49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+676
-200
lines changed

AUTHORS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ People and companies, who have contributed, in alphabetical order.
2424
* Apportable (http://www.apportable.com)
2525
Making it all happen
2626

27+
* Christian Enevoldsen
28+
Improved scroll view class
29+
2730
* Dominik Hadl
2831
Templates, scripts and other ninja stuff
2932

@@ -50,9 +53,6 @@ People and companies, who have contributed, in alphabetical order.
5053
Coordination and planning
5154
Sprite Builder integration
5255
Countless other contributions
53-
54-
* Christian Enevoldsen
55-
Improved scroll view class
5656

5757
Thanks to Wangsheng, Shintaro Kaneko, frranck and Yannick Loriot, Magician, masanorythm, Jogn Vu for various minor contributions.
5858
Also thanks to all those who contributed on git, helped us testing, and took part in the discussions even if their suggestions didn't make it to release.

RELEASE TODO.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@ Update the file VERSION with latest version number.
55
Add no CR/LF or any other formatting to the file.
66

77
2)
8-
Update cocos2d.m, with the correct version number
8+
Update install.sh
9+
Edit the line
10+
COCOS2D_VER="Cocos2D-v3.x.x”
11+
with the correct version number
912

1013
3)
11-
Add any new authors to the AUTHORS file
14+
Update cocos2d.m, with the correct version number
1215

1316
4)
14-
Add major changes and additions to the file RELEASE_NOTES
17+
Add any new authors to the AUTHORS file
1518

1619
5)
17-
Tag the release, with the according version number
20+
Add major changes and additions to the file RELEASE_NOTES
1821

1922
6)
23+
Tag the release, with the according version number
24+
25+
7)
2026
Currently two set of files are made available to the users, upon release
2127
a) A DMG, automating the install process
2228
b) a ZIP, allowing for manual install

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Variables setup
1414
# ----------------------------------------------------
1515
SCRIPT_VER="v0.9.5"
16-
COCOS2D_VER="Cocos2D-v3.0.0.RC.2"
16+
COCOS2D_VER="Cocos2D-v3.0.0"
1717
COCOS2D_DST_DIR="cocos2d v3.x"
1818
SCRIPT_DIR="$(dirname $0)"
1919

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// AppDelegate.h
3+
// ___PROJECTNAME___
4+
//
5+
// Created by ___FULLUSERNAME___ on ___DATE___.
6+
// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
7+
//
8+
// -----------------------------------------------------------------------
9+
10+
#import "cocos2d.h"
11+
12+
@interface AppDelegate : CCAppDelegate
13+
@end
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
//
2+
// AppDelegate.m
3+
// ___PROJECTNAME___
4+
//
5+
// Created by ___FULLUSERNAME___ on ___DATE___.
6+
// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
7+
//
8+
// -----------------------------------------------------------------------
9+
10+
#import "AppDelegate.h"
11+
#import "IntroScene.h"
12+
#import "HelloWorldScene.h"
13+
14+
@implementation AppDelegate
15+
16+
//
17+
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
18+
{
19+
// This is the only app delegate method you need to implement when inheriting from CCAppDelegate.
20+
// This method is a good place to add one time setup code that only runs when your app is first launched.
21+
22+
// Setup Cocos2D with reasonable defaults for everything.
23+
// There are a number of simple options you can change.
24+
// If you want more flexibility, you can configure Cocos2D yourself instead of calling setupCocos2dWithOptions:.
25+
[self setupCocos2dWithOptions:@{
26+
// Show the FPS and draw call label.
27+
CCSetupShowDebugStats: @(YES),
28+
29+
// More examples of options you might want to fiddle with:
30+
// (See CCAppDelegate.h for more information)
31+
32+
// Use a 16 bit color buffer:
33+
// CCSetupPixelFormat: kEAGLColorFormatRGB565,
34+
// Use a simplified coordinate system that is shared across devices.
35+
// CCSetupScreenMode: CCScreenModeFixed,
36+
// Run in portrait mode.
37+
// CCSetupScreenOrientation: CCScreenOrientationPortrait,
38+
// Run at a reduced framerate.
39+
// CCSetupAnimationInterval: @(1.0/30.0),
40+
// Run the fixed timestep extra fast.
41+
// CCSetupFixedUpdateInterval: @(1.0/180.0),
42+
// Make iPad's act like they run at a 2x content scale. (iPad retina 4x)
43+
// CCSetupTabletScale2X: @(YES),
44+
}];
45+
46+
return YES;
47+
}
48+
49+
-(CCScene *)startScene
50+
{
51+
// This method should return the very first scene to be run when your app starts.
52+
return [IntroScene scene];
53+
}
54+
55+
@end
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// HelloWorldScene.h
3+
// ___PROJECTNAME___
4+
//
5+
// Created by ___FULLUSERNAME___ on ___DATE___.
6+
// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
7+
//
8+
// -----------------------------------------------------------------------
9+
10+
// Importing cocos2d.h and cocos2d-ui.h, will import anything you need to start using Cocos2D v3
11+
#import "cocos2d.h"
12+
#import "cocos2d-ui.h"
13+
14+
// -----------------------------------------------------------------------
15+
16+
/**
17+
* The main scene
18+
*/
19+
@interface HelloWorldScene : CCScene
20+
21+
// -----------------------------------------------------------------------
22+
23+
+ (HelloWorldScene *)scene;
24+
- (id)init;
25+
26+
// -----------------------------------------------------------------------
27+
@end
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
//
2+
// HelloWorldScene.m
3+
// ___PROJECTNAME___
4+
//
5+
// Created by ___FULLUSERNAME___ on ___DATE___.
6+
// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
7+
//
8+
// -----------------------------------------------------------------------
9+
10+
#import "HelloWorldScene.h"
11+
#import "IntroScene.h"
12+
#import "NewtonScene.h"
13+
14+
// -----------------------------------------------------------------------
15+
#pragma mark - HelloWorldScene
16+
// -----------------------------------------------------------------------
17+
18+
@implementation HelloWorldScene
19+
{
20+
CCSprite *_sprite;
21+
}
22+
23+
// -----------------------------------------------------------------------
24+
#pragma mark - Create & Destroy
25+
// -----------------------------------------------------------------------
26+
27+
+ (HelloWorldScene *)scene
28+
{
29+
return [[self alloc] init];
30+
}
31+
32+
// -----------------------------------------------------------------------
33+
34+
- (id)init
35+
{
36+
// Apple recommend assigning self with supers return value
37+
self = [super init];
38+
if (!self) return(nil);
39+
40+
// Enable touch handling on scene node
41+
self.userInteractionEnabled = YES;
42+
43+
// Create a colored background (Dark Grey)
44+
CCNodeColor *background = [CCNodeColor nodeWithColor:[CCColor colorWithRed:0.2f green:0.2f blue:0.2f alpha:1.0f]];
45+
[self addChild:background];
46+
47+
// Add a sprite
48+
_sprite = [CCSprite spriteWithImageNamed:@"Icon-72.png"];
49+
_sprite.position = ccp(self.contentSize.width/2,self.contentSize.height/2);
50+
[self addChild:_sprite];
51+
52+
// Animate sprite with action
53+
CCActionRotateBy* actionSpin = [CCActionRotateBy actionWithDuration:1.5f angle:360];
54+
[_sprite runAction:[CCActionRepeatForever actionWithAction:actionSpin]];
55+
56+
// Create a back button
57+
CCButton *backButton = [CCButton buttonWithTitle:@"[ Menu ]" fontName:@"Verdana-Bold" fontSize:18.0f];
58+
backButton.positionType = CCPositionTypeNormalized;
59+
backButton.position = ccp(0.85f, 0.95f); // Top Right of screen
60+
[backButton setTarget:self selector:@selector(onBackClicked:)];
61+
[self addChild:backButton];
62+
63+
// done
64+
return self;
65+
}
66+
67+
// -----------------------------------------------------------------------
68+
69+
- (void)dealloc
70+
{
71+
// clean up code goes here
72+
}
73+
74+
// -----------------------------------------------------------------------
75+
#pragma mark - Enter & Exit
76+
// -----------------------------------------------------------------------
77+
78+
- (void)onEnter
79+
{
80+
// always call super onEnter first
81+
[super onEnter];
82+
83+
// In pre-v3, touch enable and scheduleUpdate was called here
84+
// In v3, touch is enabled by setting userInterActionEnabled for the individual nodes
85+
// Per frame update is automatically enabled, if update is overridden
86+
87+
}
88+
89+
// -----------------------------------------------------------------------
90+
91+
- (void)onExit
92+
{
93+
// always call super onExit last
94+
[super onExit];
95+
}
96+
97+
// -----------------------------------------------------------------------
98+
#pragma mark - Touch Handler
99+
// -----------------------------------------------------------------------
100+
101+
-(void) touchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
102+
CGPoint touchLoc = [touch locationInNode:self];
103+
104+
// Log touch location
105+
CCLOG(@"Move sprite to @ %@",NSStringFromCGPoint(touchLoc));
106+
107+
// Move our sprite to touch location
108+
CCActionMoveTo *actionMove = [CCActionMoveTo actionWithDuration:1.0f position:touchLoc];
109+
[_sprite runAction:actionMove];
110+
}
111+
112+
// -----------------------------------------------------------------------
113+
#pragma mark - Button Callbacks
114+
// -----------------------------------------------------------------------
115+
116+
- (void)onBackClicked:(id)sender
117+
{
118+
// back to intro scene with transition
119+
[[CCDirector sharedDirector] replaceScene:[IntroScene scene]
120+
withTransition:[CCTransition transitionPushWithDirection:CCTransitionDirectionRight duration:1.0f]];
121+
}
122+
123+
- (void)onNewtonClicked:(id)sender
124+
{
125+
[[CCDirector sharedDirector] pushScene:[NewtonScene scene] withTransition:[CCTransition transitionPushWithDirection:CCTransitionDirectionLeft duration:1.0f]];
126+
}
127+
128+
// -----------------------------------------------------------------------
129+
@end
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// IntroScene.h
3+
// ___PROJECTNAME___
4+
//
5+
// Created by ___FULLUSERNAME___ on ___DATE___.
6+
// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
7+
//
8+
// -----------------------------------------------------------------------
9+
10+
// Importing cocos2d.h and cocos2d-ui.h, will import anything you need to start using cocos2d-v3
11+
#import "cocos2d.h"
12+
#import "cocos2d-ui.h"
13+
14+
// -----------------------------------------------------------------------
15+
16+
/**
17+
* The intro scene
18+
* Note, that scenes should now be based on CCScene, and not CCLayer, as previous versions
19+
* Main usage for CCLayer now, is to make colored backgrounds (rectangles)
20+
*
21+
*/
22+
@interface IntroScene : CCScene
23+
24+
// -----------------------------------------------------------------------
25+
26+
+ (IntroScene *)scene;
27+
- (id)init;
28+
29+
// -----------------------------------------------------------------------
30+
@end

0 commit comments

Comments
 (0)