90 likes | 164 Views
Learn how to create engaging iPhone games using HTML5 and JavaScript. Explore MobiOne for development, testing, and app running. Understand HTML5 concepts and touch event handling to enhance your game design. Access resources for MobiOne and presentation materials.
E N D
Iphone Games with HTML5 and Java Scriptby Dr. Edwin F. Armstrong CGDC, July 15, 2010 http://tinyRealm.com/~efa/papers/ Or http://mars.umhb.edu/~efa/papers/
Use MobiOne to develop for Iphone in HTML5 • Where to get it: • http://www.genuitec.com/mobile/
Using MobiOne Test Center • http://tinyrealm.com/~efa/iphone/
Running a MobiOne App. • http://tinyrealm.com/~efa/iphone/
What does HTML5 look like? • var color, border;// added (efa) 7/03/10 • function touch(e){ • dojo.forEach(e.changedTouches, function(e){ • //var color, border;// removed (efa) 7/03/10 • var target = e.target; • if(target == nodes.green || target == nodes.blue || target == nodes.red){ • // Change the color based on whatever's been changed in the touch start • color = target.id;ports == 0)
}else if(target == nodes.solid || target == nodes.dashed || target == nodes.dotted){ • // Change the border based on whatever's been changed in the touch start • border = target.id; • }else if(target == nodes.item && !dragging){ • // Save the offset of the touch within the current note • dragging = [e.pageX - dojo.style(nodes.item, "left"), e.pageY - dojo.style(nodes.item, "top")]; • }
}else if(target == nodes.solid || target == nodes.dashed || target == nodes.dotted){ • // Change the border based on whatever's been changed in the touch start • border = target.id; • }else if(target == nodes.item && !dragging){ • // Save the offset of the touch within the current note • dragging = [e.pageX - dojo.style(nodes.item, "left"), e.pageY - dojo.style(nodes.item, "top")]; • }
if(color){ • dojo.style(nodes.item, "backgroundColor", color); • }else if(border){ • dojo.style(nodes.item, "border", "3px " + border + " black"); • dojo.style(nodes.item, "border"); // Random Safari bug where I have to read style for it to "take" • } • }); //end of function
Thank you • I had fun putting together this talk. Can I answer any questions? • Reminders: Where to get MobiOne: http://www.genuitec.com/mobile/ Where to get this presentation: http://tinyrealm.com/~efa/papers/ Or http://mars.umhb.edu/~efa/papers/