diff --git a/_RemoveForDeployment_/Images/PSD/blaues_auto.psd b/_RemoveForDeployment_/Images/PSD/blaues_auto.psd new file mode 100644 index 0000000..cf56438 Binary files /dev/null and b/_RemoveForDeployment_/Images/PSD/blaues_auto.psd differ diff --git a/_RemoveForDeployment_/Images/PSD/minispiel1_background.psd b/_RemoveForDeployment_/Images/PSD/minispiel1_background.psd new file mode 100644 index 0000000..5a4ab6d Binary files /dev/null and b/_RemoveForDeployment_/Images/PSD/minispiel1_background.psd differ diff --git a/www/js/app.js b/www/js/app.js index 468c796..534dd82 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -117,13 +117,17 @@ angular.module('kinderspiel', ['ionic', 'ngCordova','ngAnimate', 'ngDraggable', }) .state('suchspiel', { url: '/suchspiel', + cache: false, templateUrl: 'templates/suchspiel.html', - controller: 'Suchspiel' + controller: 'Suchspiel', + reload: true }) .state('minispiel1', { url: '/minispiel1', + cache: false, templateUrl: 'templates/minispiel1.html', - controller: 'Minispiel1' + controller: 'Minispiel1', + reload: true }) /* diff --git a/www/js/minispiel1_controller.js b/www/js/minispiel1_controller.js index a775a6d..03438d8 100644 --- a/www/js/minispiel1_controller.js +++ b/www/js/minispiel1_controller.js @@ -1,4 +1,4 @@ -appControllers.controller('Minispiel1', function($scope, $ionicPlatform, $cordovaMedia, backgroundsounds_mediahandler, $state, $timeout,$q, $http) { +appControllers.controller('Minispiel1', function($scope, $rootScope, $ionicPlatform, $cordovaMedia, backgroundsounds_mediahandler, $state, $timeout,$q, $http) { /* @@ -8,20 +8,27 @@ appControllers.controller('Minispiel1', function($scope, $ionicPlatform, $cordo //Minispiel $scope.showteddybear=false; $scope.teddyback=false; +$scope.bin_am_lachen=false; +//Globale MediaVariable fure Soundeffekte +var gamesound=''; +var lachensound=''; $ionicPlatform.ready(function() { /* * Sounds definieren */ - //Globale MediaVariable fure Soundeffekte - var gamesound=''; - var lachensound=''; - $scope.lachensounds=[]; $scope.gamesounds=[]; + + + /* + * Hintergrundbild setzen + */ + $rootScope.backgroundimage = "spielsets/minispielset1/images/background.png"; + /* * Spiele IntroSounds laden * Typen: successsound -> Bravo, super, tollgemacht Sounds @@ -73,20 +80,27 @@ function playsound(playtype, soundfile, callbackfunction, volume){ if (playtype=='lachensound'){ - try{ + /* + * Nur durchführen wenn Bär nicht lacht + */ + if ($scope.bin_am_lachen==false){ - //versuchen Soundfile freizugeben - lachensound.release(); + try{ + + lachensound.release(); + + } + catch(e){ + + //Soundfile Objekt gabs nicht oder Freigabefehler + console.log("Sounddatei nicht da"); + } + + lachensound = new Media(soundfile, callbackfunction ,null); + $scope.bin_am_lachen=true; + lachensound.play(); } - catch(e){ - - //Soundfile Objekt gabs nicht oder Freigabefehler - console.log("Sounddatei nicht da"); - } - - lachensound = new Media(soundfile, callbackfunction ,null); - lachensound.play(); } else if (playtype=='gamesound'){ @@ -112,6 +126,13 @@ function playsound(playtype, soundfile, callbackfunction, volume){ } +/* +* Bär lacht gerade, warte bis fertig +*/ +function lachegerade(){ + $scope.bin_am_lachen=false; +} + function minispielstart(){ $timeout(function () { $scope.showteddybear=true; @@ -138,19 +159,19 @@ $scope.teddyaction = function() { if ($scope.teddyanimation==1){ $scope.teddyani1=true; - playsound('lachensound', $scope.lachensounds[getRandomInt(0, $scope.lachensounds.length - 1)], null,'1.0'); + playsound('lachensound', $scope.lachensounds[getRandomInt(0, $scope.lachensounds.length - 1)], lachegerade,'1.0'); } if ($scope.teddyanimation==2){ $scope.teddyani2=true; - playsound('lachensound', $scope.lachensounds[getRandomInt(0, $scope.lachensounds.length - 1)], null,'1.0'); + playsound('lachensound', $scope.lachensounds[getRandomInt(0, $scope.lachensounds.length - 1)], lachegerade,'1.0'); } if ($scope.teddyanimation==3){ $scope.teddyani3=true; - playsound('lachensound', $scope.lachensounds[getRandomInt(0, $scope.lachensounds.length - 1)], null,'1.0'); + playsound('lachensound', $scope.lachensounds[getRandomInt(0, $scope.lachensounds.length - 1)], lachegerade,'1.0'); } if ($scope.teddyanimation==4){ $scope.teddyani4=true; - playsound('lachensound', $scope.lachensounds[getRandomInt(0, $scope.lachensounds.length - 1)], null,'1.0'); + playsound('lachensound', $scope.lachensounds[getRandomInt(0, $scope.lachensounds.length - 1)], lachegerade,'1.0'); } diff --git a/www/js/suchspiel_controller.js b/www/js/suchspiel_controller.js index 6731837..94cac77 100644 --- a/www/js/suchspiel_controller.js +++ b/www/js/suchspiel_controller.js @@ -30,7 +30,7 @@ $scope.CSSFalscheAntwort = false; $scope.CCSInittimer = false; //SpieleTimer -$scope.Spielzeit = 90; +$scope.Spielzeit = 10; $scope.showgametimer = false; //Spielzeit vorbei diff --git a/www/spielsets/minispielset1/images/background.png b/www/spielsets/minispielset1/images/background.png new file mode 100644 index 0000000..fb08de9 Binary files /dev/null and b/www/spielsets/minispielset1/images/background.png differ