CSS Media Screen angepasst, Minispiel mit Sounds und effekten versehen

This commit is contained in:
Carsten Hilmer
2016-11-25 02:24:40 +01:00
parent 13119a71a4
commit 1f0ec98e0a
25 changed files with 336 additions and 70 deletions

View File

@@ -8,6 +8,7 @@ appControllers.controller('home', function($scope, $rootScope, $ionicPlatform, $
$scope.CSSFarmhaus=false;
$scope.CSSWindrad=false;
$scope.CSSKornspeicher=false;
$scope.CSSufo=false;
$scope.baumhauszufallaction=99;
@@ -16,11 +17,13 @@ appControllers.controller('home', function($scope, $rootScope, $ionicPlatform, $
var farmhaussound='';
var windradsound='';
var kornspeichersound='';
var ufosound='';
var mentor_is_speakting=false;
var farmhaus_is_sounding=false;
var windrad_is_sounding=false;
var kornspeicher_is_sounding=false;
var ufo_is_sounding=false;
$scope.$on("$ionicView.beforeEnter", function(event, data){
/*
@@ -91,6 +94,14 @@ appControllers.controller('home', function($scope, $rootScope, $ionicPlatform, $
//$state.go('minispiel2');
}
/*
* DEVELOPMENT TEST
*/
$scope.devtest = function(){
$state.go('minispiel2');
}
$scope.animate_farmhaus=function(){
$scope.CSSFarmhaus=true;
playsound('farmhaussound', $scope.boingsound_action[getRandomInt(0, $scope.boingsound_action.length - 1)], farmhaussound_stop,'1.0');
@@ -108,6 +119,12 @@ appControllers.controller('home', function($scope, $rootScope, $ionicPlatform, $
playsound('kornspeichersound', $scope.boingsound_action[getRandomInt(0, $scope.boingsound_action.length - 1)], kornspeichersound_stop,'1.0');
}
$scope.animate_ufo=function(){
$scope.CSSufo=true;
playsound('ufosound', $scope.boingsound_action[getRandomInt(0, $scope.boingsound_action.length - 1)], ufosound_stop,'1.0');
}
$scope.baumhaus_actiondo=function(){
$scope.baumhauszufallaction=getRandomInt(1,2);
@@ -191,6 +208,28 @@ appControllers.controller('home', function($scope, $rootScope, $ionicPlatform, $
kornspeicher_is_sounding=true;
}
}
else if (playtype=='ufosound'){
if (ufo_is_sounding==false){
try{
//versuchen Soundfile freizugeben
ufosound.release();
}
catch(e){
//Soundfile Objekt gabs nicht oder Freigabefehler
console.log("Sounddatei nicht da");
}
ufosound = new Media(soundfile, callbackfunction ,null);
ufosound.play();
ufosound.setVolume(volume);
ufo_is_sounding=true;
}
}
else if (playtype=='mentorsound'){
if (mentor_is_speakting==false){
@@ -234,6 +273,14 @@ appControllers.controller('home', function($scope, $rootScope, $ionicPlatform, $
}
function ufosound_stop(){
$timeout(function () { $scope.CSSufo=false; }, 0);
ufosound.release();
ufo_is_sounding=false;
}
function farmhaussound_stop(){
$timeout(function () { $scope.CSSFarmhaus=false; }, 0);