Phil Hassey - game dev blog
Phil Hassey as Wolverine
"What kind of
arrogant jerk
has a website like this?"

Archive for the 'iphone' Category

iGalcon – touch input, orientation handling, and fun!

Tuesday, June 17th, 2008

I had some pretty good progress today 🙂  I got touch input implemented and tweaked pretty well for playing the game.  I also got in some crude orientation handling so that the numbers on the planets are readable from any normal orientation of the device.  I also added in a simple AI player, adjusted planet sizes, and added simple particle effects.

Next up: improved graphics, font, and sound effects.  I’m still pretty mystified by ObjC, but I’m getting by, I suppose.  It amazes me how much boilerplate junk is in languages that are not python 😉  Ah well, that’s life I guess.  On the practical side of things, I’m continuing to keep my SDL version of this working, so I can do work within my linux environment.  I’m glad I did all that work on tinypy, as I feel pretty comfortable in C now.

iGalcon – and we’re live! Sort of!

Monday, June 16th, 2008

Well, getting it “running” on the phone after that was pretty easy. Although not everything went quite as planned … Here’s a really awful picture of my progress:

Stuff to deal with later this week:

  • I’ve still got a long way to go in comprehending ObjectiveC .. So far, it’s all black magic to me, so I just guess until the compiler stops yelling at me.
  • No input yet, so no game play .. that’ll come next 🙂 Should be fun! I don’t think that part will be too hard, Apple provides a number of tutorials on getting touch input, so hopefully that will be straightforward.
  • It’s rotated the wrong way. I’ve got my game defined in a 480×320 box, but I guess the default view for the iphone is in the 320×480 direction. I’ll probably just switch my default setup to be in the 320×480 orientation. I might use gravity to determine which way the numbers on the planets are rendered.
  • No anti-aliased lines .. Hmn .. I think I’ve enabled all the right stuff, but I guess I’ll have to read up on that. It would be a pity of Galcon wasn’t anti-aliased on the iphone.

iGalcon – OpenGL ES for all!

Monday, June 16th, 2008

Since I’m too lazy to switch my monitor cables back and forth to my mac, I VNC onto my mac mini for dev.  Which, since that’s kind of a pain, and the whole app compiling process is sort of slow .. well .. I figured I’d port my code to OpenGL in the safety and security of my normal linux environment first.  After I got it working using the normal OpenGL glBegin / glEnd stuff, I switched the code up to use the OpenGL ES style vertex buffers.  Here’s a screenshot:

Next up, see if it runs on my ipod …  For the easily disgusted, I should mention that I’m rendering the text using some old BIOS font using GL_POINTS.  That seemed less mentally taxing than trying to get textures working already.

iGalcon – port of Galcon to the iphone – part 1

Saturday, June 14th, 2008

I’m going to blog a bit about my experience porting Galcon to the iphone.  It’s not overly python related, so I won’t send all these posts to the python planets.  Maybe just a couple.  Anyway, if you’re interested, keep an eye on my blog.

There is a chance I’ll use tinypy in iGalcon, but I haven’t really decided on that yet.  There isn’t a large need for scripting at this point, but if one comes up, I might just do that.  To start, I’ve takened the main flocking engine in Galcon, re-factored it a bit, and built a 100% C / SDL mini version of Galcon at the res I will be rendering it on the iphone.  I decided to do this, so I could be sure that the core engine was working perfectly in C before I complicated the matter by trying to run it using the apple tools.

So far so good 🙂  It took me about 6 hours to get this mini version of Galcon up and running in SDL.  Most of the code I was able to grab from the original Galcon.  I did a small amount of reorganizing to make things cleaner.

One of the requirements for iphone development is for your app to be able to be closed and opened and have the app recover to its previous state.  At least, that’s the ideal.  I adjusted my C structures so that they include no pointers, only ID numbers, so I should be able to write the game state to a file and reload it and have everything back.  The full game state is around 32k, so I think that will work.

On the iphone side of things, it took me several hours to get all my certs set up so I could work with the dev environment.  I was able to build their example app this morning.  Here’s to hoping the rest goes smoothly 🙂