HTML and CSS Reference
In-Depth Information
return Q;
This code takes only one parameter, a boolean option about whether to turn on the joypad or just use the
Next, this code needs to be tested. Create a file called input_test.html and fill in the code from Listing 10-9 .
Listing 10-9: input_test.html input test
<html lang="en">
<meta charset="UTF-8">
<title>Input Test</title>
<meta name='viewport' content='width=device-width,
<script src='jquery.min.js'></script>
<script src='underscore.js'></script>
<script src='quintus.js'></script>
<script src='quintus_input.js'></script>
var Q = Quintus()
.setup("quintus",{ "maximize": true })
Q.input.bind('fire',function() {
Q.input.bind('fireUp',function() {
console.log('fire up');
Q.gameLoop(function() {
You'll see this code walks through the steps of setting up Quintus, including the Quintus.Input module
you just wrote, and then turning on the controls with the joypad. It also binds a couple of event handlers to test
that events are triggered. You can try binding some additional inputs, including the movement inputs left, right,
up, and down. On a mobile device you should see the console logs if you turn the console on.
Search WWH ::

Custom Search