26 Oct 2008, 22:09
Generic-user-small

Andrew Schenk (6 posts)

Hi, I’ve been working on a 2d iPhone game that has points moving across the screen, etc.. Things were going pretty smoothly in the simulator but then I loaded it up on my iPod Touch. Everything slowed down and became next to unresponsive… i.e. taps weren’t registered, the animation came down to a crawl, etc.. Does the iPhone/iPod have enough muscle to run a core graphics game or is my only option to rewrite everything for openGL ES, for which I’m completely clueless?

Thanks in advance

26 Oct 2008, 22:29
Biopic_100x100_pragsmall

Bill Dudney (917 posts)

Hi Andrew,

Are you redrawing every frame?

If so that is likely the issue. On the device its much better to draw once and then move the layer around instead of drawing each sprite in each frame.

Scott Stevenson has a great article on using CA in contexts other than animation in case you have not read it.

http://theocacao.com/document.page/595

If this does not make sense, please ping back.

27 Oct 2008, 03:10
Generic-user-small

Andrew Schenk (6 posts)

Thank you for your prompt answer.

Yes, I’m redrawing every frame.

Could you clarify just one additional question that I have regarding this. According to my limited understanding, I could assign each sprite to a layer, so I could move them independent of each other, and then I would be able to move the layers around frame by frame without the huge performance penalty that I was getting when I used solely CG?

Or is that just wishful thinking?

27 Oct 2008, 09:56
Biopic_100x100_pragsmall

Bill Dudney (917 posts)

Hi Andrew,

You are right on track!

There was a sample bit of code at one point called ‘geek game board’ that used layers for the game pieces (the pieces were checkers). Which might provide a bit of inspiration.

Good luck!

28 Oct 2008, 03:54
Generic-user-small

Andrew Schenk (6 posts)

Hi Bill,

I just wanted to let you know that after I implemented your suggestions my game is running smoothly on both the simulator and my iPod.

Thank you for your help!

28 Oct 2008, 10:22
Biopic_100x100_pragsmall

Bill Dudney (917 posts)

Hey Andrew,

Congratulations! Great news!

Let us know when it makes the app store so we can buy a copy!

  You must be logged in to comment