How To Make A Simple iPhone Game with Cocos2D 2.X Tutorial

Discussion of the official tutorials published on raywenderlich.com. Please only discuss the official tutorials here - for general questions, use the General Discussion forum instead.

How To Make A Simple iPhone Game with Cocos2D 2.X Tutorial

Postby rwenderlich » Thu Nov 22, 2012 11:00 am

This is the official thread to discuss the following blog post: How To Make A Simple iPhone Game with Cocos2D 2.X Tutorial
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Site Admin
 
Posts: 2264
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 381 times

Re: How To Make A Simple iPhone Game with Cocos2D 2.X Tutori

Postby charlie » Thu Nov 22, 2012 10:42 pm

Awesome that you updated this one buddy, I still remember reading the original when it came out :)
charlie
iOS Tutorial Team Member
 
Posts: 113
Joined: Sun Jan 02, 2011 7:40 am
Has thanked: 3 times
Been thanked: 12 times

Re: How To Make A Simple iPhone Game with Cocos2D 2.X Tutori

Postby skiba » Wed Nov 28, 2012 9:47 pm

Great tutorial thanks !

One remark

"On Retina display devices, 1 point = 2 pixels" - should be 2 x 2 pixels

Regards
skiba
n00b
 
Posts: 1
Joined: Wed Nov 28, 2012 9:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How To Make A Simple iPhone Game with Cocos2D 2.X Tutori

Postby DurdenSC » Thu Nov 29, 2012 7:24 am

These are really great tutorials. Thanks for sharing.

I wanted to share one thing that tripped me up. The article states uses the line

[self setTouchEnabled:YES];

however, I had to change the line to

[self setIsTouchEnabled:YES];

to get it to work properly. I am a total noob, so I don't know if this has something to do with the version of cocos2d (2.x) or Xcode (4.5.1), or something that I messed up elsewhere in the code.

Thanks again!
DurdenSC
Baby Hacker
 
Posts: 9
Joined: Thu Nov 29, 2012 7:18 am
Has thanked: 3 times
Been thanked: 0 time

Re: How To Make A Simple iPhone Game with Cocos2D 2.X Tutori

Postby matt27 » Sun Dec 02, 2012 5:38 pm

I have a question about installing cocos2d 2.1(Unstable) I currently have Cocos2d 2.0 (Stable) installed. Do I have to delete this and install the unstable version? Or can I install the unstable version and it will run smoothly? Thanks.
matt27
n00b
 
Posts: 1
Joined: Sun Dec 02, 2012 5:35 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How To Make A Simple iPhone Game with Cocos2D 2.X Tutori

Postby derpoliuk » Fri Dec 07, 2012 8:50 pm

Great tutorial.Thanks.
I have a question about installing cocos2d 2.1(Unstable) I currently have Cocos2d 2.0 (Stable) installed. Do I have to delete this and install the unstable version? Or can I install the unstable version and it will run smoothly? Thanks.

I've installed cocos2d stable and right next after it cocos2d unstable. Everything works fine.
derpoliuk
n00b
 
Posts: 1
Joined: Fri Dec 07, 2012 8:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How To Make A Simple iPhone Game with Cocos2D 2.X Tutori

Postby Rambod » Mon Dec 10, 2012 9:09 pm

first of thanks for great tutorial i luv it great job,
question is [self setTouchEnabled:Yes] gives me wringing which say setTouchEnabled doesnt found whats the problem with that , i add this one in init
whats my problem ?!
Rambod
n00b
 
Posts: 2
Joined: Fri May 04, 2012 12:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How To Make A Simple iPhone Game with Cocos2D 2.X Tutori

Postby gimmick66 » Sat Dec 22, 2012 7:35 am

HelloWorldLayer.m:40:38: Sending 'ccColor4B' (aka 'struct _ccColor4B') to parameter of incompatible type 'CIColor *'

for

if ((self = [super initWithColor:ccc4(255,255,255,255)])) {
gimmick66
n00b
 
Posts: 1
Joined: Sat Dec 22, 2012 7:34 am
Has thanked: 0 time
Been thanked: 0 time

Re: How To Make A Simple iPhone Game with Cocos2D 2.X Tutori

Postby Baskyn » Tue Dec 25, 2012 10:03 am

hey Ray, I'm new to objective c(but not programming). I have everything working fine except the sounds. I don't have any errors on them or anything, they just won't play. Can you give me any reason for this?

Thanks! :D
Baskyn
Baskyn
n00b
 
Posts: 4
Joined: Tue Dec 25, 2012 10:01 am
Has thanked: 0 time
Been thanked: 0 time

Re: How To Make A Simple iPhone Game with Cocos2D 2.X Tutori

Postby koppen » Wed Dec 26, 2012 2:44 pm

gimmick66 wrote:HelloWorldLayer.m:40:38: Sending 'ccColor4B' (aka 'struct _ccColor4B') to parameter of incompatible type 'CIColor *'

for

if ((self = [super initWithColor:ccc4(255,255,255,255)])) {


I fixed that one by following http://www.cocos2d-iphone.org/forum/topic/15237, changing the CCLayer class to a CCLayerColor. Ie in HelloWorldLayer.h change

Code: Select all
@interface HelloWorldLayer : CCLayer


to

Code: Select all
@interface HelloWorldLayer : CCLayerColor
koppen
n00b
 
Posts: 3
Joined: Wed Dec 26, 2012 2:41 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to Official Tutorials

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 11 guests