Permalink
Newer
100644
33 lines (25 sloc)
894 Bytes
6
define(function (require) {
7
var activity = require("sugar-web/activity/activity");
8
9
// Manipulate the DOM only when it is ready.
10
require(['domReady!'], function (doc) {
11
12
// Initialize the activity.
13
activity.setup();
14
15
// Save mouse position
16
document.onmousemove = function(e) { mouse.position = {x: e.pageX, y: e.pageY}; }
17
18
// Create sound component
19
sound = new TankOp.Audio();
20
sound.renderInto(document.getElementById("audio"));
21
25
app.renderInto(document.getElementById("board"));
26
27
// Stop sound at end of game to sanitize media environment, specifically on Android
28
document.getElementById("stop-button").addEventListener('click', function (event) {
29
sound.pause();
30
});