Tuesday, April 23, 2013

1GAM April: Day 16

Play online

For today, I've fixed the mobile UI controls! It took a while to figure out exactly what was wrong with it, because it's not very intuitive. Basically, I have to keep track of every touch event by id that ever occurs, and iterate through that list, not the list provided by the event. That's because melonJS provides only the `changedTouches` list, and ignores the complete list of touches.

This sounds like a feature request here; include the `touches` list and `changedTouches` list like the spec! That would mean I won't have to track touches myself, just check `me.input.touches` in my `touchstart` handler, and `me.input.changedTouches` in my `touchend` handler. Done!

I also discovered in testing that mobile Safari is terribly slow on my iPhone because the game object count rapidly increases until the browser crashes. I haven't seen that on Chrome though, and I haven't verified it with CocoonJS yet. So that's going to need some investigation.

That's it for now! See you tomorrow!

Update: Fixed the object count problem. :) Actually, it's just a workaround within melonJS, but it's really helpful for this game (uses lots of Tweens!)

No comments: