1 decade ago by tarrent
Hi Everyone,
I've created a very simple, basic game, just to test OGG sounds for android. The game loads and sounds work when in desktop, but the loading bar stops when loaded on mobile.
Can you advice me what am I doing wrong?
P.S.: I've got both .mp3 and .ogg sound files available for the game.
The game can be accessed at:
http://tarrent.webs.com/test/androidos/
And the Entity that plays the sound is written like this:
Thanks.
I've created a very simple, basic game, just to test OGG sounds for android. The game loads and sounds work when in desktop, but the loading bar stops when loaded on mobile.
Can you advice me what am I doing wrong?
P.S.: I've got both .mp3 and .ogg sound files available for the game.
The game can be accessed at:
http://tarrent.webs.com/test/androidos/
And the Entity that plays the sound is written like this:
ig.module( 'game.entities.square' ) .requires( 'impact.game' ) .defines(function(){ EntitySquare = ig.Entity.extend({ size: {x:48,y:48}, animSheet: new ig.AnimationSheet('media/48x48.png', 48, 48), sfx_click: new ig.Sound('media/paytable.*'), sfx_bell: new ig.Sound('media/casino_bell.*'), sfx_cash: new ig.Sound('media/Cash.*'), soundOn: false, sprIndex: 0, init: function(x, y, settings){ this.parent(x, y, settings); this.addAnim('idle', 0.1, [0]); this.currentAnim = this.anims.idle; if(settings.sprIndex != null){ this.sprIndex = settings.sprIndex; } }, update: function(){ this.parent(); if(ig.input.pressed('leftclick') && this.inRange()){ switch(this.sprIndex){ case 0: this.sfx_click.play(); break; case 1: this.sfx_bell.play(); break; case 2: this.sfx_cash.play(); break; default: break; } } }, inRange: function(){ var valid = 0; var isInRange = false; if(ig.input.mouse.x >= this.pos.x && ig.input.mouse.x <= (this.pos.x+this.size.x)) valid++; if(ig.input.mouse.y >= this.pos.y && ig.input.mouse.y <= (this.pos.y+this.size.y)) valid++; if(valid == 2) isInRange = true; return isInRange; } }); });
Thanks.