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


0 Members and 1 Guest are viewing this topic.

Silverwind


  • ^ This guy is amazing.

  • ****


  • Posts: 2805

  • For the glory of my maker
Re: My iPhone Game Tutorials for Beginners
« Reply #90 on: June 28, 2010, 03:56:27 PM »
Oh yeah, I don't think I mentioned it but I finally got around to watching the first of your iPhone tutorials a few weeks back. It's really good Gan. :) I actually understood it without popping a lobe, hehe...
« Last Edit: June 28, 2010, 03:56:51 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 #91 on: June 28, 2010, 06:09:42 PM »
Awesome. :) Hopefully soon you'll be making your own great apps.


-Gan

breshi


  • GMG Newbie

  • *


  • Posts: 31

  • Carpe Diem
Re: My iPhone Game Tutorials for Beginners
« Reply #92 on: June 28, 2010, 06:29:16 PM »
I have an interesting problem.
I have used your fantastic Game making structure as my base and have written what I think is a pretty good game. Everything was perfect until I upgraded to OS4 - now the game runs extremely slow.
I can easily fix this within the code but then when the game runs on earlier OS versions it will run extremely fast.
Has any one else run across this problem?

I would have thought that since all my other games (on my iPhone) run well on all OS versions the problem lies with your base Game Structure. I can do an overall fix and check to see what version of the OS is being used and slow down/speed up the game accordingly but why don't other games not written for OS4 have this problem?

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #93 on: June 28, 2010, 06:47:58 PM »
It's probably my game structure. I made the structure before os 4 and while I was a beginner.
Currently I use a new structure that's similar to this one. Though it's quite a bit more advanced and uses OpenGL and a reliable thread loop for logic.
If you want I can make my latest one a bit more beginner friendly and post it up. Because it uses OpenGl you can have a ton more objects on screen.
If you don't want to use the new template I have code to get the os number. That way you don't need to change anything.


-Gan
« Last Edit: June 28, 2010, 06:52:01 PM by Gandolf »

breshi


  • GMG Newbie

  • *


  • Posts: 31

  • Carpe Diem
Re: My iPhone Game Tutorials for Beginners
« Reply #94 on: June 28, 2010, 06:54:08 PM »
That would be fantastic!
Would it be a hard thing to modify the old structure, i'd hate to have to rewrite my entire game?
Keep up the great work!!!

I-NEED-HELP


  • GMG Newbie

  • *


  • Posts: 40

  • I love YaBB 1G - SP1!
Re: My iPhone Game Tutorials for Beginners
« Reply #95 on: June 28, 2010, 08:10:28 PM »
Thanks for your help with opening/saving files!

But what if the app is running for the first time... would you create a new file? But then how would you tell whether the app was running for the first time or not? Or if you could test whether or not the file already exists? How to tell whether or not a file exists?

Thanks in advance.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #96 on: June 28, 2010, 09:29:50 PM »
Here's the code to detect the current OS:
Code: [Select]
if ([[[UIDevice currentDevice] systemVersion] floatValue] < 4.0) {
//Less then 4.0
} else {
//4.0 or greater
}

To check if your file exists just load it as normal and do this:
Code: [Select]
if (testFile == nil) {
//File doesn't exist
}

I will see about converting it but still pretty busy.


-Gan

I-NEED-HELP


  • GMG Newbie

  • *


  • Posts: 40

  • I love YaBB 1G - SP1!
Re: My iPhone Game Tutorials for Beginners
« Reply #97 on: June 29, 2010, 11:16:57 AM »
I tried with the file stuff for highscores, but when my program gets to the part where it's supposed to check highscores and update the file, it crashes. Any help?

Code: [Select]
            int score = loopCounter;
            if (!gottenScore) {
                  NSMutableArray* highscore = [NSMutableArray new];
                  highscore = [self openFileInDocs:@"Highscore.txt"];
                  if (highscore != nil) {
                        if (score > [[highscore objectAtIndex:0] intValue]) {
                              [highscore replaceObjectAtIndex:0 withObject:[NSNumber numberWithInt:score]];
                              gotHighscore = TRUE;
                        }
                        [self saveFileInDocs:@"Highscore.txt" object:highscore];
                  }
                  else {
                        [highscore addObject:[NSNumber numberWithInt:score]];
                        [self saveFileInDocs:@"Highscore.txt" object:highscore];
                  }
                  gottenScore = TRUE;
                  
                  [self drawString:context translate:CGPointMake(0, 0) text:[NSString stringWithFormat:[highscore objectAtIndex:0]] point:CGPointMake(0, screenDimensions.y-130) rotation:0 font:@"Arial" color:color size:20];
                  if (gotHighscore) {
                        [self drawString:context translate:CGPointMake(0, 0) text:@"HIGHSCORE!" point:CGPointMake(70, screenDimensions.y-80) rotation:0 font:@"Arial" color:color size:20];
                  }
            }
« Last Edit: June 29, 2010, 01:08:02 PM by I-NEED-HELP »

I-NEED-HELP


  • GMG Newbie

  • *


  • Posts: 40

  • I love YaBB 1G - SP1!
Re: My iPhone Game Tutorials for Beginners
« Reply #98 on: July 04, 2010, 08:11:36 PM »
I was wondering how to resize a sprite. Your drawing methods seem to leave the sprite dimensions as they were, but I would like to be able to change them, e.g. make a sprite from a file that is 20x20 pixels but show it on the screen as 40x40 pixels. How do you do this?

Thanks in advance.

I-NEED-HELP


  • GMG Newbie

  • *


  • Posts: 40

  • I love YaBB 1G - SP1!
Re: My iPhone Game Tutorials for Beginners
« Reply #99 on: July 09, 2010, 04:32:32 PM »
Quote
Do you know of a graphic design program better than pixen? Pixen is to blocky for what i want to be creating.
Sorry this is really late, your question might have already been answered, but I use GIMP. Gnu Image Manipulation Program. It's free, easy to use, and I use it for all my sprites in games. It has tons of awesome tools too, very nice software. You can save as tons of different image formats, even as ASCII art! Try it.

I-NEED-HELP


  • GMG Newbie

  • *


  • Posts: 40

  • I love YaBB 1G - SP1!
Re: My iPhone Game Tutorials for Beginners
« Reply #100 on: July 11, 2010, 09:53:25 PM »
How to you use OpenGL to draw 2d sprites? Can you post a tutorial? Or update the iPhone Game Template code so that is uses OpenGL ES instead of CoreGraphics? I'm making a sprite intensive game that requires very fast update speeds.

Thanks in advance.

breshi


  • GMG Newbie

  • *


  • Posts: 31

  • Carpe Diem
Re: My iPhone Game Tutorials for Beginners
« Reply #101 on: July 11, 2010, 10:46:43 PM »
Yes, that would be a great help to find out how to use openGL for sprites. With the update to OS4 I have to rewrite my game to speed it up - not sure how.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #102 on: July 14, 2010, 06:40:33 PM »
Here's one of my old opengl templates. It has most of what you need to get the job done but it's a mess.
If I had more than 5 minutes I could clean it up.

http://web.mac.com/avisaria/OpenGL%20Template.zip


-Gan

I-NEED-HELP


  • GMG Newbie

  • *


  • Posts: 40

  • I love YaBB 1G - SP1!
Re: My iPhone Game Tutorials for Beginners
« Reply #103 on: July 17, 2010, 12:43:50 PM »
THANK YOU!  :D :D :D :D :D :D

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: My iPhone Game Tutorials for Beginners
« Reply #104 on: July 21, 2010, 05:28:31 PM »
I'm remaking the template. This latest will completely blow all previous templates out of the water.
I'm making it so that you can build all menus in interface builder while having the game view a little separate for maximum speed in an easy to use OpenGl ES view.
This also allows use of professional looking transitions.


-Gan