Book Image

PhoneGap 3.x Mobile Application Development HOTSHOT

By : Kerri Shotts
Book Image

PhoneGap 3.x Mobile Application Development HOTSHOT

By: Kerri Shotts

Overview of this book

<p>PhoneGap allows you to use your existing knowledge of HTML, CSS, and JavaScript to create useful and exciting mobile applications.<br /><br />This book will present you with 12 exciting projects that will introduce you to the dynamic world of app development in PhoneGap. Starting with their design and following through to their completion, you will develop real-world mobile applications. Each app uses a combination of core PhoneGap technologies, plugins, and various frameworks covering the necessary concepts you can use to create many more great apps for mobile devices.</p>
Table of Contents (21 chapters)
PhoneGap 3.x Mobile Application Development HOTSHOT
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Touched-based input


As we don't have a physical keyboard or joystick or D-pad, we have to emulate one on the screen. One control scheme does this with two buttons on the screen for our game—one to go left, and one to go right. Another way is to allow for the differences in how a swipe might occur—a slow movement when our ship is not in danger, or a sudden movement when we need to avoid an obstacle in a hurry. Another method would be to simply link up the touch position on the screen to the ship—essentially our finger would have to trace the path through the cave. For smaller devices this might be fine, but for larger devices, it is better to go with some other method.

Getting ready

In our game, if the user has selected the slide control scheme, our touch input can handle swipes (where the finger isn't always on the screen) to move the ship in short bursts, and can handle long drags where the finger is always on the screen and slight movements provide the steering.

Put simply, if we move to...