Category Archives: Objective C

iOS Game App Dev Log Entry # 2

Share this:  

For this game, I am using the layout of Scrabble on the iPhone and the iPad as a frame of reference. I am not copying it exactly. BTW, this is not a Scrabble knock-off! It is a word game though, and I’m sure it will be something you would find under the “Word” category in “Games” on the app store!

Hopefully, this app will be so good, that you find it featured by Apple!

For reference, today, I needed a screen shot from Scrabble on my iPhone where the game board is “zoomed in.” So I…

Read more

iOs game app – Dev Log Entry # 1

Share this:  

Today I am wanting to get iOS app for friend that I am working on (see previous post), displaying sprites for game board properly (with the right widths and heights, and at the right positions).

If I can get just THAT done today, that will make me feel like I am getting somewhere.

If I can get gradients too that would be nice. But Orville… dude… the other stuff is more important!!

#journal #ios #app #objc Read more

Back to Work on an iOS Game!

Share this:  

I promised a friend quite some time ago that I would work on converting his physical board game into an iOS game.

I’ve worked on it in fits and starts. I even has somewhat of a UI set up that I’d shown him (like maybe 2 years ago)… I know… not so good.

But now I can work on it full time!  I am bound and determined to finish this sucker and get it into the app store!

Although I’ve played around with Swift somewhat, the original code was done in Objective C and I’m going to stick with that. The original code was using SpriteKit… and will continue to do so.

I’ve been spending the past few days studying the existing code, adding comments to it, and jotting down notes on how I want to handle coding the game.

I realize now that for the kind of game it is, that needs just basic geometric shapes, that I really have no need for bitmapped images (at least for the most part), and, by using some simple math, I can have my game’s graphics scale nicely without needed all sorts of images with different resolutions included in my project.

SO, onward I go! My goal is to have it out in the Apple App store for sale for my friend by the end of this July.

Doing Math in Objective C

Share this:  


One thing you will find you need to do in any programming language is do math. Here are some useful math functions for the Objective C language. I give a little bit of a comparison to Visual Basic for those who know that language. They are provided in no special order:

  • fabs() – Gets the absolute value of the value in parentheses. Works like ABS() function in Visual Basic. fabs(-123) = 123, fabs(34) = 34.
  • ceil() – Find the ceiling integer. Kind of like rounding up. Same as INT(x+1) in Visual Basic.  ceil(3.1) = 4.
  • floor() – Find the floor integer. Kind of like rounding down. Same as INT(x) in Visual Basic. floor(3.6) = 3.
  • exp() – Find the exponential value.
  • pow() – Raise a number to the power. pow(3,6) = 3^6 in Visual Basic.
  • rand() – Generate a pseudo random number. Function is RND(x) in Visual Basic. A good discussion on random numbers in Objective C can be found here.
  • srandom() – Generate a seed for the random number generator. This is done with the Randomize statement in Visual Basic.
  • sqrt() – Find out the square root of a number. sqrt(x) = x^(1/2) in Visual Basic.

How to Create Class Categories in Objective C

Share this:  


Note: Video is Best Viewed in Full Screen Mode

As I began refining some sample code for making Universal Apps for the iPhone and iPad, I sought a way to make my code as concise as possible. I needed to determine if the app was running on an iPad or iPhone/iPod Touch and use it to my advantage. This basic information is contained in the UIDevice class.

Unfortunately, using:

Read more