Topic:   My iPhone Game Tutorials for Beginners   (Read 391449 times)


0 Members and 1 Guest are viewing this topic.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #165 on: April 27, 2011, 04:59:08 PM »
Quote
I can't seem to download the iPhone game template. The computer keeps saying that it can't find the URL
Yeah, some of the links are dead but hey:
I still got the ultimate iPhone OpenGL game template!

Quote
a lot of the cases (at least that's what I think they are) start with NS or CG what do they stand for
NS stands for NextStep. It's just what the API was built from.
CG stands for CoreGraphics. It's a powerful framework for drawing.

Quote
And what is the importance of the semi-colon.
Semi-colons separate commands.
int x = 1; int y = 1;
Meaning you can put multiple things on the same line if you wanted. You must have a semi-colon after every command or you will get an error.

Quote
And what does the star (*) actually do.
The star means that variable is a pointer to a piece of memory. You use it on objects.
NSString* myString = @"This is a string";
You don't need to use it on:
int test = 5;

Pointers(*) come in handy when you want to pass objects through functions and use them elsewhere.
This is really hard to understand until you actually use it.

Quote
And what is the difference between strong typing, and weak typing?
This article can explain better than I can:
http://en.wikipedia.org/wiki/Strong_typing


It appears that a few of the iPhone tutorial links still work.

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: My iPhone Game Tutorials for Beginners
« Reply #166 on: April 27, 2011, 05:25:39 PM »
also how do the brackets [] and the other brackets {} differ.
And what is the name of the language that Xcode uses?
EDIT: Also what are all of the cases, and what they do?
« Last Edit: April 27, 2011, 08:53:16 PM by KurtManion »
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #167 on: April 27, 2011, 05:32:21 PM »
Quote
And what is the name of the language that Xcode uses?
Xcode actually can use many languages. Java, C, C++, ect. But what you'll be using is called Objective C.

Quote
also how do the brackets [] and the other brackets {} differ.
[] are used for arrays and commands.
Example array:
int test[5];
test[0] = 33;

Example command:
NSString* myString = @"BWAHAAHAHA";
myString = [myString lowercaseString];

{} are used to put code in. For example:
if (test == 5) {
     test += 1;
     [self doSomeRandomCommand];
}
It's just organizing the code so the compiler knows what goes where.

x


  • GMG-er

  • **


  • Posts: 247
Re: My iPhone Game Tutorials for Beginners
« Reply #168 on: April 27, 2011, 06:57:31 PM »
Quote
Xcode actually can use many languages. Java, C, C++, ect. But what you'll be using is called Objective C.

[] are used for arrays and commands.
Example array:
int test[5];
test[0] = 33;

Example command:
NSString* myString = @"BWAHAAHAHA";
myString = [myString lowercaseString];

{} are used to put code in. For example:
if (test == 5) {
 Â    test += 1;
 Â    [self doSomeRandomCommand];
}
It's just organizing the code so the compiler knows what goes where.

Actually {} in Objective-C can also represent scope. Same as in Java and C++ (and C).
« Last Edit: April 27, 2011, 06:58:27 PM by x »

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: My iPhone Game Tutorials for Beginners
« Reply #169 on: April 27, 2011, 08:54:32 PM »
what do commands like += do, and is <> still a valid command, or can I use the regular inequal symbol?
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #170 on: April 27, 2011, 08:58:32 PM »
test += 1
is the same as
test = test + 1

<> isn't a valid command. Instead use !=

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: My iPhone Game Tutorials for Beginners
« Reply #171 on: April 27, 2011, 09:02:06 PM »
and how do I find out about cases? Like what are all the different types, and what do they do?
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: My iPhone Game Tutorials for Beginners
« Reply #172 on: April 27, 2011, 09:04:35 PM »
when, and why would you use strong typing over weak typing, and vice versa
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: My iPhone Game Tutorials for Beginners
« Reply #173 on: April 27, 2011, 09:05:46 PM »
Quote

Actually {} in Objective-C can also represent scope. Same as in Java and C++ (and C).
what do you mean by scope?
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: My iPhone Game Tutorials for Beginners
« Reply #174 on: April 27, 2011, 09:06:56 PM »
Quote
Xcode actually can use many languages. Java, C, C++, ect. But what you'll be using is called Objective C.

[] are used for arrays and commands.
Example array:
int test[5];
test[0] = 33;

Example command:
NSString* myString = @"BWAHAAHAHA";
myString = [myString lowercaseString];

{} are used to put code in. For example:
if (test == 5) {
 Â    test += 1;
 Â    [self doSomeRandomCommand];
}
It's just organizing the code so the compiler knows what goes where.

what does the @ sign do?
And why would you put == instead of =
« Last Edit: April 27, 2011, 09:07:06 PM by KurtManion »
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #175 on: April 27, 2011, 09:09:39 PM »
The @ tells the compiler that you're making an NSString. So @"this is a test" is an NSString you made. So you can do:
NSString* test = @"This is a test";

== means = but when comparing two objects you must use ==. So
if (1 == 1) {
     NSLog(@"Yay");
}

NSLog just prints out a message to the debugger.

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: My iPhone Game Tutorials for Beginners
« Reply #176 on: April 27, 2011, 09:14:07 PM »
it seems that
test[0] = 33;
is comparing two objects. Why doesn't it have the two equal signs, and does NSString just make a string variable?
Also where do you find all the cases, and what they do. It seems like you just pull them out of thin air :-/
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #177 on: April 27, 2011, 09:31:45 PM »
test[0] = 33;
That's setting a number to the index of 0 in an array.
If you want to compare two things you must use ==.

NSString is a type of string variable.

What do you mean by cases?

x


  • GMG-er

  • **


  • Posts: 247
Re: My iPhone Game Tutorials for Beginners
« Reply #178 on: April 27, 2011, 10:25:24 PM »
Scope is your programming locality.

for example take this piece of pseudocode:
int x = 10;
{
 Â   int x = 20;
 Â   output x;
}
output x;

Will print out:
20
10.

You can use {} to create a new scope.
« Last Edit: April 27, 2011, 10:25:34 PM by x »

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #179 on: April 27, 2011, 10:48:03 PM »
Ah yeah, X is right. Obj-C isn't like Sc where all variables are global. You gotta make sure the variable you want is made within scope.