Posts Tagged 'Programming'

Tone Generating

Here’s a nice gentle introduction to audio synthesis on the iPhone from Matt Gallagher:

An iOS tone generator (an introduction to AudioUnits)

In this post, I present a tiny iOS app that generates a continuous tone at a frequency determined by a slider. It’s a small sample app intended to show the simplest way to send audio data you generate to the speaker…

If you … like us … haven’t delved below the AudioQueue level of playback yet, this is an excellent place to start!

Continue Reading →
0

Smart Network Content Updates

Here’s a piece on how to intelligently update your cached network content based on server file modification time:

How To Download a File Only If It Has Been Updated

You should always avoid downloading data over a wireless network whenever possible. If there is a file on a server that your app needs and it’s infrequently updated, then a good approach would be to cache that file in your app and only download it when an update is detected … The code below does a HTTP HEAD request, checks the returned “Last-Modified” header, and compares it with updated timestamp of the local file. (A slightly more efficient approach would be to send a “If-Modified-Since” header with your request. But there seems to be some issues with that, so proceed carefully with that approach.)

Handy stuff … if you trust your server’s mod dates. Personally, we’d be more inclined to have a manifest file with explicit versioning, if the data in question was large enough for downloading it to be a significant task; but hey, a range of options is always good to have!

Continue Reading →
0

Links: Game Programming

Here’s a site with a darn fine collection of game programming links:

Amit’s Game Programming Information

Organized by section:

Something for everyone there no doubt!

h/t: learn-cocos2d.com!

Continue Reading →
0

PNG Normalizing

Need a Python script to normalize iDevice-converted PNGs? Why, here it is.

iPhone PNG Images Normalizer

Note that this functionality is also available commercially cheaply.

These and other alternatives are mentioned along with exactly how Apple iDevice PNG Format works can be found here at modmyi.com. Just in case you really need to know more.

h/t: @Zoel!

Continue Reading →
0

Library: Tapku

Here’s a nifty bit of open source to plunder for all kinds of tidbits: Tapku! Tap-what? “tap + haiku = well crafted open source iphone library”. OK, not completely sure where the “haiku” bit comes in, but it’s got some nifty stuff:

Tapkulibrary.jpg

The calendar view, coverflow view, and charting view are particularly notable, but there’s a bunch of alert and table cell and progress and so forth helpers as well. All Apache-licensed and available on github; definitely worth building the demo app and taking a look!

h/t: ManiacDev!

Continue Reading →
3

MAObjCRuntime

And speaking of things you can learn from Mike Ash, here’s a library to make it easy to do crazy runtime stuff with Objective-C:

MAObjCRuntime

MAObjCRuntime is an ObjC wrapper around the Objective-C runtime APIs. If that’s confusing, it provides a nice object-oriented interface around (some of) the C functions in /usr/include/objc …

… You can query any class’s methods, instance variables, or other attributes … You can add new methods …. You can modify the implementation of an existing method … You can create new classes … -rt_setClass: does pretty much what it says: sets the class of the object. It won’t reallocate the object or anything, so the new class had better have a memory layout that’s compatible with the old one, or else hilarity will ensue…

And much, much more. Good stuff if you need it, all, but as you can deduce from that last snippet, the expression “enough rope to shoot yourself in the foot” should be kept in mind whilst thinking up clever uses for this. With great power comes great ability to completely mess things up beyond all recall, or something like that.

Continue Reading →
1

Tip: Equality and Hashing

If you implement any kind of custom object equality in Cocoa, you should read this.

Friday Q&A 2010-06-18: Implementing Equality and Hashing

Particularly note this line:

… Because of the semantics of hash, if you override isEqual: then you must override hash. If you don’t, then you risk having two objects which are equal but which don’t have the same hash. If you use these objects in a dictionary, set, or something else which uses a hash table, then hilarity will ensue…

Pretty much no matter how much of a Cocoa god you are, we’ll betcha you’ll learn something from the post and comments here!

UPDATES:

levigroker / HashBuilder: “A utility to generate a hash for NSObject subclasses.”

Continue Reading →
1

Utility: Tile Cutter

So you checked out session 104 in the WWDC videos about doing scrolling that doesn’t suck with CATiledLayer and all no doubt, but actually creating those tiles, that’s a bit of a task, isn’t it now? Well, here’s Jeff Lamarche with Tile Cutter, just the thing to fix that problem:

… I was able to slice up a 1.3 gig image (yes, really) into 400×400 chunks in about 15 minutes on my laptop. I would imagine I’m not the only person who needs to slice up images to use in UIScrollView, so I’ve decided to release Tile Cutter as a free utility…

and promptly open sourced as well, find code on github.

Note from the comments that there’s also a commercial (and cheap, $9.99!) cross-platform program Tilen with similar functionality; also metion was made of this script:

… I ended up using imagemagic. I wrote a little ruby script to handle all the details so I could output at multiple levels and tile sizes. Plust as a script it makes it easy to integrate into our build system…

So there you go, lots of options for your image slicing preparations!

Continue Reading →
0

Galaxy Engine

If you’re planning on doing a 3D game for the Mac, iPhone, or iPad, and like us you have a predilection for using open source frameworks where possible, the Galaxy Engine sure looks like something you should review seriously:

Galaxy Engine is a complete game development package for Mac, iPhone, and iPad. It is programmed in Cocoa and uses the OpenGL, OpenGL ES, and OpenAL libraries to give you a powerful core with direct access to iPhone SDK features such as Game Center. Galaxy Engine is designed with indie developers in mind. Which means that it is designed to be as efficient and flexible as possible. It also is one of the only Open Source game engines to include critical tools for game development such as: Level Editor, Terrain Editor, Model Viewer, Particle Editor, and Shader IDE. It also includes features such as: vertex animation, advanced lighting, dynamic shadows, vertex and pixel shaders, normal mapping, parallax mapping, and massive outdoor environments.

Wow! Quite the package, there. And nicely suited to the Cocoa-centric:

Intuitive complete object orientated Objective-C framework designed in the same style as Cocoa allows you to quickly write your game with a relatively small learning curve compared to other C++ based systems. Galaxy engine is extremely flexible and not based on a specific game type which allows you start on your game no matter what it is on day one. Comprehensive source code allows you to confidently configure, edit, and expand the engine right out of the box. Extensive documentation allows you to quickly understand how classes work and how you can use them. Proven stability used in several commercial products from iPhone games to space shuttle simulation software…

We tried out the template project, and aside from having to compile the library instead of it being included in the template as the documentation lies about, it installed and ran without incident, so apparently all this is for real. They don’t seem to mention anywhere what the commercial iPhone games referred to above are though, so if anyone knows what they are let us know so we can check it out in action, please!

h/t: ManiacDev!

Continue Reading →
2

Game Design TCR

And with exactly 2 hours and 30 minutes left on the clock until Lose Your App Name Day™:

The status for the following app has changed to Waiting For Review.

App Name: BallZOut

App Version Number: 1.0

Whew! And with 21 full days left in October, that should be plenty of time for a rejection cycle or two and still get it in the store in time for someone, hopefully, to buy it for us to win the October Challenge. Assuming that we have indeed achieved a minimum viable product here. The play mechanics are pretty much as simple as simple gets,

bztutorial.png

… but hey, so are Angry Birds’, and that’s done all right for itself.

So now we have to find some time to put together a website — conveniently, already registered from last year’s nugatory discussions at putting together the original “BallZOut” project — and think about maybe doing some actual marketing. So perhaps you will see some posts on that in the nearish future.

But for today, let’s just list a couple interesting posts on game design noted recently, which we’ll get around to reading after the drink or fifteen on order to celebrate this submission:

This thread on TouchArcade (h/t: @wadevondoom) started by none other than John Carmack(!!) asking for “the things that every self respecting ios app should handle correctly … we’ll make a serious effort to adhere to it in Rage and our future products.” 11 pages and counting — no doubt chock full of stuff we should have done here! Note particularly this post, for instance.

And this is a fascinating post (h/t @rwenderlich) on the history of Ngmoco and their Neil Young’s prognostications for the future!

Continue Reading →
2
Page 40 of 82 «...1020303839404142...»