I also added pinch-zooming. That was a major pain, since my logic for handling touches was a bit more complicated than necessary. I'm still not quite sure why the first way didn't work, but after hours of debugging, I went to a simpler model, and now it all works well. Some lessons you have to learn over and over: Keep It Simple, Steven.
I'm considering going back to sorting instead of z-buffering. Alpha-blend is just too crucial for the sprites to look good over each other. Sorting could involve some heavy CPU crunching every time something changes. But the good thing is, changes are infrequent time compared to the graphics rate. I only change geometry (easy) when stuff happens (e.g. a wall is destroyed). Although...animations still involve lots of changes, such as a missile flying across the map. Hmm I'll have to think about this a big more. Re-sorting could be expensive since it involves moving a ton of data around, although simple in concept.
Speed is still not satisfactory. I can draw 50x50 at 30FPS, but that's only one layer. I need to draw probably 3x as much for a multi-layer level, with sprites layered over each-other (another issue with sorting). I'll have to consider some partitioning to make things draw faster when zoomed-in.
Next action items:
- Think about sorting vs. z-buffer.
- Think about layering sprites.
- Think about partitioning.
No comments:
Post a Comment