BRB Going to space

by midge 19. December 2014 03:01

Tonight was pretty experimental. I was a little bit downtrodden yesterday when I realized that my early approaches to using images for tiles was too slow. I was afraid I was going to have to convert the whole thing to openGL, use a framework, or do some crazy hacks. Fortunately, I only had to use some mild hacks. And I added in a static background image, which was fun and surprisingly adds a lot to it.

I decided before I freaked out about the slow textures, I was going to do some science-


and by science I just meant take some accurate measurements to confirm that what I thought was a problem was one. The original naive tiling implementation was much much too slow, but I had added a hack to speed it up. Instead of looking up every image, I could use the image as a paintbrush sort of, and automatically repeat it. Also, this allowed me to treat consecutive tiles as a single rectangle, which meant only one drawRect call for multiple tiles in a vertical run. I wasn't sure that would speed it up but I had a hunch that it would.

Taking accurate measurements, the time was barely slower in the textured version... So I'm going to stick with it. Also I had the idea that I could use different rendering modes per level, depending on the tileset it calls for (more than 1?).

The background image was 1. Testing out if it slowed anything down, and 2. For fun. I do think it made the level look much better. It's just static for now, but I may do some parallax later. Parallax scrolling could be kind of a pain in the ass because of the dumb way I'm doing the whole thing. I tried using a UIImage view, and it did work, but the app was crashing. I could probably figure that out, heck I might if I decide I do want to do parallax, but it was a problem I just didn't want to deal with at the time.

I pretty good night. I need to just plow ahead and finish this thing. "Good enough" will be the mantra to keep moving, I think.

Onward and upward.


Add comment

  Country flag

  • Comment
  • Preview

About the author

Hi, I'm Midge.

Month List

Page List