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', {
|
.state('suchspiel', {
|
||||||
url: '/suchspiel',
|
url: '/suchspiel',
|
||||||
|
cache: false,
|
||||||
templateUrl: 'templates/suchspiel.html',
|
templateUrl: 'templates/suchspiel.html',
|
||||||
controller: 'Suchspiel'
|
controller: 'Suchspiel',
|
||||||
|
reload: true
|
||||||
})
|
})
|
||||||
.state('minispiel1', {
|
.state('minispiel1', {
|
||||||
url: '/minispiel1',
|
url: '/minispiel1',
|
||||||
|
cache: false,
|
||||||
templateUrl: 'templates/minispiel1.html',
|
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
|
//Minispiel
|
||||||
$scope.showteddybear=false;
|
$scope.showteddybear=false;
|
||||||
$scope.teddyback=false;
|
$scope.teddyback=false;
|
||||||
|
$scope.bin_am_lachen=false;
|
||||||
|
|
||||||
|
//Globale MediaVariable fure Soundeffekte
|
||||||
|
var gamesound='';
|
||||||
|
var lachensound='';
|
||||||
|
|
||||||
$ionicPlatform.ready(function() {
|
$ionicPlatform.ready(function() {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sounds definieren
|
* Sounds definieren
|
||||||
*/
|
*/
|
||||||
//Globale MediaVariable fure Soundeffekte
|
|
||||||
var gamesound='';
|
|
||||||
var lachensound='';
|
|
||||||
|
|
||||||
|
|
||||||
$scope.lachensounds=[];
|
$scope.lachensounds=[];
|
||||||
$scope.gamesounds=[];
|
$scope.gamesounds=[];
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Hintergrundbild setzen
|
||||||
|
*/
|
||||||
|
$rootScope.backgroundimage = "spielsets/minispielset1/images/background.png";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Spiele IntroSounds laden
|
* Spiele IntroSounds laden
|
||||||
* Typen: successsound -> Bravo, super, tollgemacht Sounds
|
* Typen: successsound -> Bravo, super, tollgemacht Sounds
|
||||||
@ -73,9 +80,13 @@ function playsound(playtype, soundfile, callbackfunction, volume){
|
|||||||
|
|
||||||
if (playtype=='lachensound'){
|
if (playtype=='lachensound'){
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Nur durchführen wenn Bär nicht lacht
|
||||||
|
*/
|
||||||
|
if ($scope.bin_am_lachen==false){
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
//versuchen Soundfile freizugeben
|
|
||||||
lachensound.release();
|
lachensound.release();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -86,9 +97,12 @@ function playsound(playtype, soundfile, callbackfunction, volume){
|
|||||||
}
|
}
|
||||||
|
|
||||||
lachensound = new Media(soundfile, callbackfunction ,null);
|
lachensound = new Media(soundfile, callbackfunction ,null);
|
||||||
|
$scope.bin_am_lachen=true;
|
||||||
lachensound.play();
|
lachensound.play();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
else if (playtype=='gamesound'){
|
else if (playtype=='gamesound'){
|
||||||
|
|
||||||
try{
|
try{
|
||||||
@ -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(){
|
function minispielstart(){
|
||||||
$timeout(function () {
|
$timeout(function () {
|
||||||
$scope.showteddybear=true;
|
$scope.showteddybear=true;
|
||||||
@ -138,19 +159,19 @@ $scope.teddyaction = function() {
|
|||||||
|
|
||||||
if ($scope.teddyanimation==1){
|
if ($scope.teddyanimation==1){
|
||||||
$scope.teddyani1=true;
|
$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){
|
if ($scope.teddyanimation==2){
|
||||||
$scope.teddyani2=true;
|
$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){
|
if ($scope.teddyanimation==3){
|
||||||
$scope.teddyani3=true;
|
$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){
|
if ($scope.teddyanimation==4){
|
||||||
$scope.teddyani4=true;
|
$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;
|
$scope.CCSInittimer = false;
|
||||||
|
|
||||||
//SpieleTimer
|
//SpieleTimer
|
||||||
$scope.Spielzeit = 90;
|
$scope.Spielzeit = 10;
|
||||||
$scope.showgametimer = false;
|
$scope.showgametimer = false;
|
||||||
|
|
||||||
//Spielzeit vorbei
|
//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