Reload in App-routen geschrieben um Controller immer neu zu laden
This commit is contained in:
parent
5e323b684d
commit
51cf274b29
BIN
_RemoveForDeployment_/Images/PSD/blaues_auto.psd
Normal file
BIN
_RemoveForDeployment_/Images/PSD/blaues_auto.psd
Normal file
Binary file not shown.
BIN
_RemoveForDeployment_/Images/PSD/minispiel1_background.psd
Normal file
BIN
_RemoveForDeployment_/Images/PSD/minispiel1_background.psd
Normal file
Binary file not shown.
@ -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
|
||||
})
|
||||
|
||||
/*
|
||||
|
||||
@ -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');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ $scope.CSSFalscheAntwort = false;
|
||||
$scope.CCSInittimer = false;
|
||||
|
||||
//SpieleTimer
|
||||
$scope.Spielzeit = 90;
|
||||
$scope.Spielzeit = 10;
|
||||
$scope.showgametimer = false;
|
||||
|
||||
//Spielzeit vorbei
|
||||
|
||||
BIN
www/spielsets/minispielset1/images/background.png
Normal file
BIN
www/spielsets/minispielset1/images/background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 338 KiB |
Loading…
x
Reference in New Issue
Block a user