Gio,
I've actually had this problem for quite some time on apple devices, so I must be doing something fundamentally wrong.
I've just never had a good reason to dig around and figure out what the problem was. Anyway...
All the sound files are up there in aac and ogg format.
I checked it out on my sons iphone.
Here's what happens:
- Loading screen loads and then finishes.
- Intro music starts playing.
- Intro screen loads first image, and then fades out to show the second intro image
- Then you can't start the game by clicking the start button on the intro screen
here are the snippets I use to hand off and return control from various "Scenes"
the game scene loader in the main app
this.gameSceneLoader = function(sceneName) { console.log('load game scene ' + sceneName); currentScene = null; var params = { sceneParameters: { app: self, layer: self.SCENE_LAYER, width: wade.app.GAME_WIDTH, height: wade.app.GAME_HEIGHT, levelNumber: levelNumber || 0 }}; mySoundManager.playLoop(self.SOUND_MUSIC_INTRO); switch (sceneName) { case 'IntroScene': currentScene = new SceneObject(0, IntroScene, 0, 0); break; case 'HelpScene': currentScene = new SceneObject(0, HelpScene, 0, 0); break; case 'SplashScene': currentScene = new SceneObject(0, SplashScene, 0, 0); break; case 'LevelScene': currentScene = new SceneObject(0, LevelScene, 0, 0); break; case 'CreditScene': currentScene = new SceneObject(0, CreditScene, 0, 0); break; default: break; }; // end switch wade.addSceneObject(currentScene,false,params); }; // end gameSceneLoader
and the game scene manager in the main app
this.gameSceneManager = function(sceneName,sceneState) { console.log('game scene manager ' + sceneName + ' ' + sceneState + ' ' + gameState.current); mySoundManager.stopAll(); switch(gameState.current) { case gameState.INTRO: console.log('intro callback from ' + sceneName + ' ' + sceneState); wade.removeSceneObject(currentScene); if (sceneState == 'loadHelp') { self.gameSceneLoader('HelpScene'); } else { gameState.current = gameState.LOAD_LEVEL; self.gameSceneLoader('LevelScene',levelNumber); } break; case gameState.LOAD_LEVEL: console.log('load level callback from ' + sceneName + ' ' + sceneState); wade.removeSceneObject(currentScene); self.loadLevel(); gameState.current = gameState.PLAYING; self.startGame(); break; case gameState.PAUSED: console.log('callback from paused state' + sceneName + ' ' + sceneState); wade.removeSceneObject(currentScene); gameState.current = gameState.PLAYING; self.gameUnpause(); break; case gameState.OVER: wade.clearScene(); levelNumber = 1; gameState.current = gameState.INTRO; self.loadIntro(); break; default: break; }; // end switch }; // end gameSceneManager
here is my introScreen.js file
IntroScene = function() { var self = this; var name = "IntroScene"; var mainApp; var state = 'intro1Clicked'; var params; var clickCount = 0; this.onAddToScene = function(eventData) { console.log(name + ' added to scene'); params = eventData.sceneParameters; mainApp = params.app; var sp0 = new Sprite('./images/introScreen2.jpg',params.layer); sp0.setSize(params.width,params.height); self.owner.addSprite(sp0); var sp1 = new Sprite('./images/introScreen.jpg',params.layer); self.owner.addSprite(sp1); sp1.setDrawFunction(wade.drawFunctions.fadeOpacity_(1,0,2,sp1.draw,self.titleFadeComplete)); }; // end onAddToScene this.titleFadeComplete = function() { console.log('title fade complete'); state = 'act1Complete'; wade.addEventListener(self.owner,'onClick'); return true; }; // end titleFadeComplete this.onClick = function(eventData) { var sToW = wade.screenPositionToWorld(params.layer,eventData.screenPosition); var choice = sToW.x; if (choice < 0) { state = 'loadLevel'; } else { state = 'loadHelp'; } mainApp.gameSceneManager(name,state); return true; }; // end onClick this.onRemoveFromScene = function() { console.log(name + ' removed from scene'); }; // end onRemoveFromScene }; // end IntroScene
When I do this -- wade.addEventListener(self.owner,'onClick'); am I adding it to the wrong place ?
Should it instead be (self,'onClick') ?
But then why does it work on everything but the apple ?
As usual, thanks for the help.
cheers,
Shri