p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning iOS Game Development (http://p2p.wrox.com/forumdisplay.php?f=667)
-   -   So, I was attempting the Blocker project and ... (http://p2p.wrox.com/showthread.php?t=87024)

whjones March 19th, 2012 10:39 PM

So, I was attempting the Blocker project and ...
 
Aloha everyone,

My name is Bud and I'm currently living in Honolulu. I have an iOS development company, but am really new to Objective-C. I've only written four apps, and they're simple database-driven (SQLite) apps. I've always wanted to create a good game, but didn't know where to begin.

To make a long story short, I got Beginning iOS Game Development and have been going through the book. I got stuck in the Blocker project, because when I run the app the first time (pg 195), it compiles and runs, but no blocks are created.

I got confused when the author writes "Users of your class will pass you a frame size and a color to initialize block of a specified color." Where, exactly, does the user pass on this information? What I think is happening is that when the init method of the BlockView.m file is called, it doesn't know the value of inputColor and just executes the rest of the code without creating the blocks. All I get is a grey screen. I've been over and over the code, but can't find the error. Has anyone else experienced this issue?

Gordio March 20th, 2012 12:35 AM

Quote:

Originally Posted by whjones (Post 282669)
Aloha everyone,

My name is Bud and I'm currently living in Honolulu. I have an iOS development company, but am really new to Objective-C. I've only written four apps, and they're simple database-driven (SQLite) apps. I've always wanted to create a good game, but didn't know where to begin.

To make a long story short, I got Beginning iOS Game Development and have been going through the book. I got stuck in the Blocker project, because when I run the app the first time (pg 195), it compiles and runs, but no blocks are created.

I got confused when the author writes "Users of your class will pass you a frame size and a color to initialize block of a specified color." Where, exactly, does the user pass on this information? What I think is happening is that when the init method of the BlockView.m file is called, it doesn't know the value of inputColor and just executes the rest of the code without creating the blocks. All I get is a grey screen. I've been over and over the code, but can't find the error. Has anyone else experienced this issue?

Question: how far in the chapter did you get before you compiled? This part of the chapter you set up the block to allow a size and color parameters. later in the chapter you create a 5x3 array of colored bricks. But if you compiled right here, there should be no zero bricks yet.

(I have the kindle version, so I'm not sure where page 195 is)

whjones March 20th, 2012 01:52 PM

Aloha Gordio,

Thanks for your response. I was unable to answer your question until now. With respect to the page I mentioned, that was the first time we are directed to build and run the game. The author stated that the game should compile and run, but made no mention as to whether or not the blocks would appear. While giving the code, the author mentions that the switch statement is used to determine the color of the blocks themselves, and the sentence I quoted seemed to give me the impression that the blocks should have appeared, but as I posted, I could see no instance of the user actually sending any color information to the game, at least not at that time.

In other words, when you went through the process of building this game, were you only presented a gray screen at that point? I would just like to verify that I am getting the correct response from the iPhone simulator.

Thanks again for your response.

Gordio March 20th, 2012 02:15 PM

Quote:

Originally Posted by whjones (Post 282693)
Aloha Gordio,

Thanks for your response. I was unable to answer your question until now. With respect to the page I mentioned, that was the first time we are directed to build and run the game. The author stated that the game should compile and run, but made no mention as to whether or not the blocks would appear. While giving the code, the author mentions that the switch statement is used to determine the color of the blocks themselves, and the sentence I quoted seemed to give me the impression that the blocks should have appeared, but as I posted, I could see no instance of the user actually sending any color information to the game, at least not at that time.

In other words, when you went through the process of building this game, were you only presented a gray screen at that point? I would just like to verify that I am getting the correct response from the iPhone simulator.

Thanks again for your response.

Yea I see where you are now. He told you to compile to make sure it doesn't crash. At this point, you're expected to see just grey.

The purpose of the section is to set up the brick objects. Later in the chapter, you place the bricks in the level. Then you'll see them. I hope this answers your question.

whjones March 20th, 2012 07:42 PM

Aloha again Gordio,
Thank you for your response. I'll continue driving on then. That was my assumption, but I just wanted to verify that. Actually, I really, really like this book. He not only give the code necessary to build the app, but also takes the time to explain what is going on. This is one of the best programming books I've read. I can do a lot of things with Objective-C, but I do need the hand-holding when it comes to understanding how to write games - that's something I've not done before.

Gordio March 20th, 2012 07:47 PM

Quote:

Originally Posted by whjones (Post 282708)
Aloha again Gordio,
Thank you for your response. I'll continue driving on then. That was my assumption, but I just wanted to verify that. Actually, I really, really like this book. He not only give the code necessary to build the app, but also takes the time to explain what is going on. This is one of the best programming books I've read. I can do a lot of things with Objective-C, but I do need the hand-holding when it comes to understanding how to write games - that's something I've not done before.

I totally agree. My background: I'm not a programmer. I've tried learning C++ or javascript years ago on my own while in college, and even recently. It was frustrating and I gave up. This is the first programming book I actually finished. I used to blame myself for not being able to learn the code, but the fact this book made sense to me proves it hadn't been me who failed. The books I have tried just sucked! This book is responsible for 99% of the code I know. I hope the author writes more programming books (or adds a second edition to this book). This is the least intimidating programming book I've ever read.

whjones March 20th, 2012 08:17 PM

Aloha Gordio,

Have you read any of the other Wrox books dealing with iOS or Mac OS? I'm just curious if this is the author's style or if that requirement was placed on the author by the publisher. Either way, I can't wait until I get to learn about Bluetooth connectivity, as I have an idea for a neat game, based on a podcast I enjoy, which as they say is a complete ripoff of a BBC show. Assuming I can avoid the lawyers [:eek:] once I have it complete it should be a good game. I just don't know where to get that "compelling content" stuff [:D]

Gordio March 20th, 2012 08:33 PM

Quote:

Originally Posted by whjones (Post 282712)
Aloha Gordio,

Have you read any of the other Wrox books dealing with iOS or Mac OS? I'm just curious if this is the author's style or if that requirement was placed on the author by the publisher. Either way, I can't wait until I get to learn about Bluetooth connectivity, as I have an idea for a neat game, based on a podcast I enjoy, which as they say is a complete ripoff of a BBC show. Assuming I can avoid the lawyers [:eek:] once I have it complete it should be a good game. I just don't know where to get that "compelling content" stuff [:D]

No. this is the only book I've read by him and by the publisher. Reading other books by other publishers and other authors, I think it's usually the author that affects how good a book is. The publisher sometimes has a format, but it's really up to the author to make that format work.

For example, I had gotten one book by Apress that is poised with typos that even as a beginner, just looking at the I knew the code wasn't going to work! but the book I'm reading now on cocos2d, also by Apress but a different author, is good and has a different writing style.

whjones March 20th, 2012 10:39 PM

Aloha Gordio,

I also was interested in getting that Cocos2D book, but when I tried to load the Cocos2D templates on my MacBookPro, I was unsuccessful. I am running Xcode 4.3.1, and the only people that have it running successfully, from what I can gather, are the ones that had it installed under an earlier version of Xcode. When did you load the Cocos2D templates? Have you heard of anyone successfully loading them under Xcode 4.3x?

Gordio March 21st, 2012 12:16 AM

Quote:

Originally Posted by whjones (Post 282715)
Aloha Gordio,

I also was interested in getting that Cocos2D book, but when I tried to load the Cocos2D templates on my MacBookPro, I was unsuccessful. I am running Xcode 4.3.1, and the only people that have it running successfully, from what I can gather, are the ones that had it installed under an earlier version of Xcode. When did you load the Cocos2D templates? Have you heard of anyone successfully loading them under Xcode 4.3x?

I don't know yet…I just read the free sample pages (kindle), and I just bought the full book. The sampler didn't really have me compile anything. I'm hesitantly optimistic, because of some 3 star reviews on amazon. I'll tell u how it is as I read it.

Edit: back to the original topic about the author. This book actually taught me objective C better than any "beginner objective C" book I've read. For example, the standard method syntax "-(void) method:(int)inValue1 parameter2:(int)inValue2" confused me. I didn't know how to interpret it. All books I've read never explained how to read this, and I thought "if I see it more, maybe it'll start to make sense. Nope it never did. Only after this book explained it to me, I understood it. If this guy wrote a cocos2D book, I'd be the first in line. I might come off riding on his ballsack, but I'm grateful the author wrote this book.


All times are GMT -4. The time now is 10:52 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.