Hello,
I am following along with this tutorial, and I need some help understanding some code.
In the interface of Terrain.h the following lines of code are there:
Why is there an underscore before offsetX and stripes, is that just a naming convention used by the author or is it a known Objective-C naming convention? I have the same question with the #define line, I have seen these before, but why is there a k in front of MaxHillPoints?
Can someone also explain the CGPoint with the brackets beside it, what do the brackets mean?
In the Terrain.m there is a synthesize line that looks like this:
@synthesize stripes = _stripes;
What this code mean? I have seen and used @synthesize, but why is the author setting it equal to something?
I know this tutorial was written for IOS, but I am using the Mac port of Cocos2d.
Thanks!
I am following along with this tutorial, and I need some help understanding some code.
In the interface of Terrain.h the following lines of code are there:
Code:
#define kMaxHillPoints 1000
int _offsetX;
CGPoint _hillKeyPoints[kMaxHillKeyPoints];
CCSprite *_stripes;
Why is there an underscore before offsetX and stripes, is that just a naming convention used by the author or is it a known Objective-C naming convention? I have the same question with the #define line, I have seen these before, but why is there a k in front of MaxHillPoints?
Can someone also explain the CGPoint with the brackets beside it, what do the brackets mean?
In the Terrain.m there is a synthesize line that looks like this:
@synthesize stripes = _stripes;
What this code mean? I have seen and used @synthesize, but why is the author setting it equal to something?
I know this tutorial was written for IOS, but I am using the Mac port of Cocos2d.
Thanks!