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


0 Members and 1 Guest are viewing this topic.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
My iPhone Game Tutorials for Beginners
« on: January 21, 2010, 08:10:07 PM »
Hey guys, I've finally come up with the courage to make a tutorial about iPhone game development. Yes, using my voice. This is my very first screen cast + voice tutorial so it definitely won't be perfect.

The purpose of the tutorials is to teach you guys how to make your own games for the iPhone platform. I have created a template(Download is below) that will make the process painless and quite fun.

Right-click to download. Stars(*) mean downloads that go along with tutorial.

Tutorial #1(75mb,13min): Basics of Syntax/Structure and Building Your First Game
*Ball Game

Tutorial #2(80mb,10min): Drawing Images and Detecting Touch
*Ball Game 2

Tutorial #3(115mb,20min): Using NSMutableArray, Making a Main Menu, and Infinite Balls
*InfiniBalls

*iPhone Game Template Download


-Gandolf
P.S. If you encounter an error when trying to download a tutorial, that's because the tutorial is still uploading.
« Last Edit: February 18, 2010, 08:30:34 PM by Gandolf »

Gnome


  • GMG Extraordinaire

  • ***


  • Posts: 1073
Re: My iPhone Game Tutorials for Beginners
« Reply #1 on: January 21, 2010, 09:18:16 PM »
THANK YOU :D
This Cannot be, NOOOOOOOO!!!!

-Gnomes Cry when the McRib was discontinued again.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #2 on: January 22, 2010, 07:47:30 AM »
You're welcome. I'm hoping to give you guys everything you need in the easiest and most painless way possible.

If you guys see something you don't like such as:
"The video's too long."
"You used too many complicated terms!"
"Your voice isn't great enough. Change it to Darth Vader."
"You go too fast, slow down!"

Post away. I want to make this better and custom tailor these tutorials to fit exactly how you guys want them. Likewise, if you have suggestions for the next tutorial, post that too!


-Gandolf
P.S. If you have any coding questions, post them here.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: My iPhone Game Tutorials for Beginners
« Reply #3 on: January 22, 2010, 11:14:21 AM »
I downloaded the files but couldn't figure out what anything was, nor where the video itself was. What's the name of the file?
I survived the spammage of 2007

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #4 on: January 22, 2010, 03:05:21 PM »
The video is named iPhoneTut1.mov, future tutorials will just have a higher number. Ball game resource is BallGame.zip. IPhone game template is called iPhoneGameTemplate.zip. If you're using safari, just hit the magnifying glass next to the download in the downloads windows to reveal it in finder.


-Gandolf
P.S. Do you guys need directions to get and install Xcode and the iPhone SDK?

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #5 on: February 01, 2010, 07:46:14 PM »
Tutorial #2 is up!


-Gandolf

DWapps


  • GMG Newbie

  • *


  • Posts: 14

  • I love YaBB 1G - SP1!
Re: My iPhone Game Tutorials for Beginners
« Reply #6 on: February 12, 2010, 03:09:01 PM »
Hi, i'm getting a 'position' undeclared and a 'True' undeclared. Can't find the problem

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: My iPhone Game Tutorials for Beginners
« Reply #7 on: February 12, 2010, 03:37:02 PM »
Gadzooks... a new member just waltzed in from nowhere? Quick! Everyone smile!

Welcome to the GMG! :) ;D :D
« Last Edit: February 12, 2010, 03:37:37 PM by Silverwind »
I survived the spammage of 2007

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #8 on: February 12, 2010, 03:58:28 PM »
:)
Quote
Hi, i'm getting a 'position' undeclared and a 'True' undeclared. Can't find the problem
That means that either you haven't made the global variables 'position' and 'true' or you have a syntax error. I could give you the correct answer immediately if you could post your source. An easy way to do that is uploading on MediaFire and posting the link.


-Gan
« Last Edit: February 12, 2010, 03:59:15 PM by Gandolf »

DWapps


  • GMG Newbie

  • *


  • Posts: 14

  • I love YaBB 1G - SP1!
Re: My iPhone Game Tutorials for Beginners
« Reply #9 on: February 12, 2010, 04:47:30 PM »
Here,http://  http://www.mediafire/DWapps
BTW, love the guide and how the codes setup. Helped a tonnn

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #10 on: February 12, 2010, 05:21:50 PM »
Thanks, I'd love to make it better if you had any suggestions.

Now in your code you had a few mistypes.
In MyCustomView.h:
Code: [Select]
//Put your global game variables here, but don't set a value to them!!

//This works: int test;

//This doesn't: int test = 0;

CGPoint postion;

int xVel;

int yVel;
'position' is spelled as 'postion'. That leads the compiler to believe you hadn't made this variable when you try to use it.
In MyCustomView.m:
Code: [Select]
- (void) awakeFromNib
{

screenDimensions = CGPointMake([[UIScreen mainScreen] bounds].size.height, [[UIScreen mainScreen] bounds].size.width);


//Set any global variables you have made here.

//For example, test = 10;

xVel = 0;

yVel = 0;

positon = CGPointMake(50, 50);
You spelled 'position' as 'positon'.

Code: [Select]
- (void) handleGameTimer: (NSTimer *) gameTimer {

//All game logic goes here, this is updated 60 times a second

positon.x += xVel;

positon.y += yVel;

//This updates the screen

[self setNeedsDisplay];
}
Same error here. Just change 'positon' to 'position'.

And finally you had an error in drawRect:
Code: [Select]
- (void) drawRect:(CGRect)rect
{

CGContextRef context;

//To set a color for a shape:

float color[] = {1.0,0.0,0.0,1.0};


//ALL DRAWING CODE GOES HERE

[self drawOval:context translate:CGPointMake(0,0) color:color point:position dimensions:CGPointMake(10,10) rotation:0 filled:True linesize:0,0];


}
The error is that you have 'filled:True'. In Obj-C you want a boolean to be fully capital: 'filled:TRUE'. Finally your 'linesize:0,0' has an error. That comma should be a period.
No big errors, all good. :) Perhaps I'll make a debugging tutorial...


-Gan
P.S. If you don't want to have to upload rtf files, you could just zip the source and send that.
« Last Edit: February 12, 2010, 05:36:24 PM by Gandolf »

DWapps


  • GMG Newbie

  • *


  • Posts: 14

  • I love YaBB 1G - SP1!
Re: My iPhone Game Tutorials for Beginners
« Reply #11 on: February 13, 2010, 08:25:55 AM »
Ohhh, didn't see my typos, thanks. It worked afterwards. Time to continue on with the tutorial. I'll post back if i have any problems or ?'s.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #12 on: February 13, 2010, 10:46:47 AM »
Ok. :)


-Gan

bloodline


  • GMG Newbie

  • *


  • Posts: 4

  • I love YaBB 1G - SP1!
Re: My iPhone Game Tutorials for Beginners
« Reply #13 on: February 16, 2010, 01:12:56 PM »
Hey Gandolf!

I was having a terrible time trying to figure out where the callbacks were (the timer handler is a great help!) and where the CGContext was coming from! After reading through your source code, it all make sense now, so many thanks!

I realise now that it only makes sense for an object to be drawing in it's own context :)

Now I have to figure out a way to link my game model object to the view controller :))

I expect I'll have more questions later!

Xiphos


  • GMG-er

  • **


  • Posts: 676
Re: My iPhone Game Tutorials for Beginners
« Reply #14 on: February 16, 2010, 03:05:39 PM »
I can't wait to start making a game! However it would take 2 hours to download Xcode and the Iphone SDK so I think I'll wait until I have more time.