Quellcode durchsuchen

Premiere révision après le test de la Beta:
-Question écrites en plus grandes
-Correction d'erreurs (réponses)
-etc.

François Gautrais vor 7 Jahren
Ursprung
Commit
2be4ae0342
32 geänderte Dateien mit 384 neuen und 227 gelöschten Zeilen
  1. 1 0
      app/src/main/AndroidManifest.xml
  2. BIN
      app/src/main/assets/e0.mp3
  3. BIN
      app/src/main/assets/e1.mp3
  4. BIN
      app/src/main/assets/e2.mp3
  5. BIN
      app/src/main/assets/e2q.mp3
  6. BIN
      app/src/main/assets/e3.mp3
  7. BIN
      app/src/main/assets/e4.mp3
  8. BIN
      app/src/main/assets/e5.mp3
  9. BIN
      app/src/main/assets/e6.mp3
  10. BIN
      app/src/main/assets/e7.mp3
  11. BIN
      app/src/main/assets/fin.mp3
  12. 32 63
      app/src/main/assets/game_medium
  13. 60 24
      app/src/main/assets/ressources.res
  14. 3 0
      app/src/main/java/macampcorp/macamp/activities/BombActivity.java
  15. 10 3
      app/src/main/java/macampcorp/macamp/activities/HostActivity.java
  16. 2 1
      app/src/main/java/macampcorp/macamp/activities/PermissionActivity.java
  17. 6 0
      app/src/main/java/macampcorp/macamp/activities/TutoActivity.java
  18. 71 1
      app/src/main/java/macampcorp/macamp/activities/fragments/ChallengeFragment.java
  19. 18 4
      app/src/main/java/macampcorp/macamp/activities/fragments/QuestionFragment.java
  20. 15 10
      app/src/main/java/macampcorp/macamp/game/Event.java
  21. 0 4
      app/src/main/java/macampcorp/macamp/game/Stage.java
  22. 2 0
      app/src/main/java/macampcorp/macamp/game/scheduler/Scheduler.java
  23. 1 1
      app/src/main/java/macampcorp/macamp/ui/MediaView.java
  24. 28 0
      app/src/main/java/macampcorp/macamp/ui/Sound.java
  25. 7 0
      app/src/main/res/anim/shake.xml
  26. 5 0
      app/src/main/res/anim/trans_in.xml
  27. 5 0
      app/src/main/res/anim/trans_out.xml
  28. 0 1
      app/src/main/res/layout/fragment_bomb.xml
  29. 37 55
      app/src/main/res/layout/fragment_qcm.xml
  30. 55 41
      app/src/main/res/layout/fragment_qrcode.xml
  31. 9 12
      app/src/main/res/layout/fragment_question.xml
  32. 17 7
      app/src/main/res/values/strings.xml

+ 1 - 0
app/src/main/AndroidManifest.xml

@@ -8,6 +8,7 @@
     <uses-feature android:name="android.hardware.camera" />
     <uses-feature android:name="android.hardware.camera2.full" />
     <uses-feature android:name="android.hardware.camera.autofocus" />
+    <uses-permission android:name="android.permission.VIBRATE"/>
 
 
     <application

BIN
app/src/main/assets/e0.mp3


BIN
app/src/main/assets/e1.mp3


BIN
app/src/main/assets/e2.mp3


BIN
app/src/main/assets/e2q.mp3


BIN
app/src/main/assets/e3.mp3


BIN
app/src/main/assets/e4.mp3


BIN
app/src/main/assets/e5.mp3


BIN
app/src/main/assets/e6.mp3


BIN
app/src/main/assets/e7.mp3


BIN
app/src/main/assets/fin.mp3


+ 32 - 63
app/src/main/assets/game_medium

@@ -5,7 +5,7 @@
 	"stages" : [{
 	"name" : "Intro",
 	"challenges" : [],
-	"resources" : ["intro"],
+	"resources" : ["e0"],
 	"event_end" : [ 
 		{"method" : "tuto"},
 		{"method" : "armBomb"}
@@ -19,27 +19,29 @@
 				"type" : "QRCodeTreasure",
 				"name" : "BibQr",
 				"bad_message" : "C'est pas le bon !",
+				"text" : "Trouvez le QR code caché à côté de la photo suivante",
 				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#1",
 				"resource" : "bib",
 				"indices" : [
 					{
 						"type" : "text",
-						"text" : "On ne peut hélas toujours pas rentrer en vélo dans ces structures...",
+						"text" : "C'est un vélo sur la pancarte ?",
 						"penality": 0.5
 					},
 					{
 						"type" : "text",
 						"penality": 1,
-						"text" : "Encore moins dans la médiathèque !" 
+						"text" : "Et il y a un truc vert pour accrocher les vélos..." 
 					}
 				]
 			}
 		],
-	"resources" : ["intro_fin"]
+	"resources" : ["e1"]
 },
 {
 	"name" : "MPG",
 	"charIndex" : 0,
+	"resources" : ["e3"],
 	"challenges" :
 		[
 			{
@@ -62,7 +64,7 @@
 						"text" : "Ne pas sonner SVP !" 
 					}
 				],
-				"event_end" : { "method" : "giveResource", "args" : ["burger"] }
+				"event_end" : { "method" : "giveResource", "args" : ["e2", "e2q"] }
 			},
 			{
                     "type" : "QCM",
@@ -223,12 +225,17 @@
 				"indices" : [
 					{
 						"type" : "text",
-						"text" : "La pelouse est trop verte pour être vrai...",
+						"text" : "Regardez en face de la porte de la MPG et avancez !",
 						"penality": 0.5
 					},
 					{
 						"type" : "text",
-						"text" : "Alors comme ca on est pas du genre à lever les yeux au ciel ?",
+						"text" : "Fait le tour du jardin de la LUDO et lève la tête !",
+						 "penality": 1
+					},
+					{
+						"type" : "text",
+						"text" : "Quel beau plafond exterieur en beton...",
 						 "penality": 1
 					}
 				]
@@ -237,7 +244,7 @@
 				"type": "Question",
 				"name" : "QuestionLudo",
 				"bad_message" : "Non !",
-				"question" : "Et maintenant, un petit test de raisonnement : Regardez sur la porte à votre gauche. Vous pouvez essayer de deviner sur quelle place est garé la voiture, mais ca m’étonnerais que vous trouviez !",
+				"question" : "Et maintenant, un petit test de raisonnement : Regardez sur la porte, vous trouverez cette énigme. Vous pouvez essayer de deviner sur quelle place est garé la voiture, mais ca m’étonnerais que vous trouviez !",
 				"good_message" : "Brillant !",
 				"resource" : "parking",
 				"answer" : "87",
@@ -258,16 +265,15 @@
 						"penality" : 1,
 						"text": "Bon, regardez à l’envers."
 					}
-				],
-				"penality" : 1
+				]
 			}
 		],
-	"resources" : [],
-	"event_end" : { "method" : "setTimerTo", "args" : [30] },
+	"resources" : ["e4"],
 	"charIndex" : 5
 },
 {
 	"name" : "JardinDhiver",
+	"resources" : ["e5"],
 	"challenges" :
 		[
 			{
@@ -275,17 +281,13 @@
 				"name" : "JardinHiverQuestion",
 				"bad_message" : "Non !",
 				"resource" : "jardin", 
-				"question" : "Rentrez par la porte en face de vous et allez dans le 'jardin d’hiver' de la MJC. Un mot de 6 lettres est caché dans ce dernier, mais bonne chance pour le découvrir !",
+				"question" : "Trouvez les 6 lettres du mot caché dans le jardin d’hiver de la MJC",
 				"good_message" : "Bravo !",
 				"answer" : "patate",
 				"indices" : [
 					{
 						"penality" : 0.5,
-						"text": "J’ai bien dit 6 lettres !"
-					},
-					{
-						"penality" : 1,
-						"text": "A force de chercher sans trouver, vous allez finir par voir rouge…"
+						"text": "Le rouge est ma couleur favorite."
 					},
 					{
 						"penality" : 1,
@@ -293,51 +295,47 @@
 					},
 					{
 						"penality" : 1,
-						"text": "Des LETTRES en ROUGE sur les AFFICHES"
+						"text": "Des LETTRES en ROUGE sur les AFFICHES qui peuvent faire un MOT"
 					}
 				]
 			}
 		],
-	"resources" : [],
 	"charIndex" : 2
 },
 {
 	"name" : "Accueil",
+	"resources" : ["e6"],
 	"challenges" :
 		[
 			{
-				"type" : "Question",
-				"name" : "accueilQuestion",
-				"bad_message" : "Non !",
+				"type" : "QRCodeTreasure",
+				"name" : "accueilQr",
+				"bad_message" : "C'est pas le bon !",
 				"good_message" : "Bravo !",
 				"resource" : "accueil",
-				"question" : "Quel est le sens de la vie ?\nDemandez donc aux personnes les mieux renseignés de la médiathèque ET de la MJC. Et au passage, la plaquette de la MJC et le facebook de la médiathèque pourrait être utile !",
-				"answer" : "De gauche à droite",
+				"qr_value" : "http://www.mjc-louis-aragon.asso.fr/qrcode/#4",
+				"text" : "Pour trouver ce QR code caché, posez la question \"Comment est votre blanquette\" à l’habitant de l’aquarium",
 				"indices" : [
 					{
 						"penality" : 0.5,
-						"text": "Allez ne faites pas les timides, allez demander !"
-					},
-					{
-						"penality" : 1,
 						"text": "Quand on a une question, on la pose à l’accueil non ?"
 					},
 					{
 						"penality" : 1,
-						"text": "Il va falloir la poser à deux endroits !"
+						"text": "On peut aussi avoir des informations à la médiathèque."
 					},
 					{
 						"penality" : 1,
-						"text": "Poser la question \"Comment est votre blanquette ?\" à l’accueil de la MJC ET à l’accueil de la médiathèque..."
+						"text": "C’est quoi ca sur le flyer du facebook de la médiathèque ?"
 					}
 				]
 			}
 		],
-	"resources" : [],
 	"charIndex" : 6
 },
 {
 	"name" : "Prospectus",
+	"resources" : ["e7"],
 	"challenges" :
 		[
 			{
@@ -368,39 +366,10 @@
 						"penality" : 1,
 						"text": "Une moitié de QR code sur la feuille facebook et une à la fin de la plaquette..."
 					}
-				],
-				"penality" : 1
-			}
-		],
-	"resources" : [],
-	"charIndex" : 1
-},
-{
-	"name" : "Accueil",
-	"challenges" :
-		[
-			{
-				"type" : "Question",
-				"name" : "accueilQuestion",
-				"bad_message" : "Non !",
-				"good_message" : "Bravo !",
-				"resource" : "livre",
-				"question" : "Allez chercher ce roman un message codé se trouve à l'intérieur..",
-				"answer" : "Dindon",
-				"indices" : [
-					{
-						"penality" : 0.5,
-						"text": "La Côte est 'R ISH'"
-					},
-					{
-						"penality" : 1,
-						"text": "Généralement, quand on cherche une information dans un livre on va voir le sommaire ou l'index. Ils se trouvent généralement au début ou à la fin du livre..."
-					}
 				]
 			}
 		],
-	"resources" : [],
-	"charIndex" : 6
+	"charIndex" : 1
 },
 {
 	"name" : "Bomb",
@@ -428,7 +397,7 @@
      "win" : {
          "name" : "win",
           "challenges" : [],
-         "resources" : ["intro"]
+         "resources" : ["fin"]
      },
       "loose" : {
           "name" : "loose",

+ 60 - 24
app/src/main/assets/ressources.res

@@ -1,40 +1,76 @@
 {
+	"mjc" : {"type" : "Image"},
 	"intro_fin" : { "type" : "Audio"},
 	"mpg" : { "type" : "Image" } ,
-	"question" : {"type" : "Image"}, 
-	"mjc" : {"type" : "Image"},
-	"milieu" : {
-		"comment" : "Nous avons reçu un  nouveau message !",
-		"title" : "Un nouveau message",
+	"question" : {"type" : "Image"},
+	"creche": {"type" : "Image"},
+	"bib" : {"type" : "Image"},
+	"ludo" :  {"type" : "Image"},
+	"jardin" :  {"type" : "Image"},
+	"accueil" :  {"type" : "Image"},
+	"prospect" :  {"type" : "Image"},
+	"error" : {"type" : "Image"},
+	"livre" : {"type" : "Image"},
+	"oeil" : { "type": "Image" },
+	"parking" : { "type" : "Image" },
+	"e0" : {
+		"comment" : "Appel inconnu",
+		"title" : "Appel inconnu",
 		"type" : "Audio",
 		"display" : true
 	},
-	"intro" : {
-		"comment" : "Nous avons reçu un étrange message...",
-		"title" : "Un étrange message",
+	"e1" : {
+		"comment" : "Appel inconnu",
+		"title" : "Appel inconnu",
 		"type" : "Audio",
 		"display" : true
 	},
-	"fin" : {
-		"comment" : "Nous avons réussi !",
-		"title" : "On a gagné",
+	"e2" : {
+		"comment" : "Appel inconnu",
+		"title" : "Appel inconnu",
 		"type" : "Audio",
 		"display" : true
 	},
-	"burger" : {
-		"comment" : "Ecoutez bien ces questions, et répondez y dans l'ordre ! Cliquez sur OK quand vous êtes prêts",
-		"title" : "Le burger de la mort !",
+	"e2q" : {
+		"comment" : "Appel inconnu",
+		"title" : "Appel inconnu",
 		"type" : "Audio",
 		"display" : true
 	},
-	"creche": {"type" : "Image"},
-	"bib" : {"type" : "Image"},
-	"ludo" :  {"type" : "Image"},
-	"jardin" :  {"type" : "Image"},
-	"accueil" :  {"type" : "Image"},
-	"prospect" :  {"type" : "Image"},
-	"error" : {"type" : "Image"},
-	"livre" : {"type" : "Image"},
-	"oeil" : { "type": "Image" },
-	"parking" : { "type" : "Image" }
+	"e3" : {
+		"comment" : "Appel inconnu",
+		"title" : "Appel inconnu",
+		"type" : "Audio",
+		"display" : true
+	},
+	"e4" : {
+		"comment" : "Appel inconnu",
+		"title" : "Appel inconnu",
+		"type" : "Audio",
+		"display" : true
+	},
+	"e5" : {
+		"comment" : "Appel inconnu",
+		"title" : "Appel inconnu",
+		"type" : "Audio",
+		"display" : true
+	},
+	"e6" : {
+		"comment" : "Appel inconnu",
+		"title" : "Appel inconnu",
+		"type" : "Audio",
+		"display" : true
+	},
+	"e7" : {
+		"comment" : "Appel inconnu",
+		"title" : "Appel inconnu",
+		"type" : "Audio",
+		"display" : true
+	}, 
+	"fin" : {
+		"comment" : "Nous avons réussi !",
+		"title" : "On a gagné",
+		"type" : "Audio",
+		"display" : true
+	}
 }

+ 3 - 0
app/src/main/java/macampcorp/macamp/activities/BombActivity.java

@@ -22,6 +22,7 @@ import macampcorp.macamp.game.Bomb;
 import macampcorp.macamp.game.Game;
 import macampcorp.macamp.game.scheduler.SpecialTask;
 import macampcorp.macamp.lang.Locale;
+import macampcorp.macamp.ui.Sound;
 import macampcorp.macamp.utils.Const;
 
 public class BombActivity extends AppCompatActivity {
@@ -168,6 +169,7 @@ public class BombActivity extends AppCompatActivity {
 
             if(mBomb.disarm(mTyped))//section critique
             { //code bon
+                Sound.ok(this);
                 mGame.getScheduler().clear();
                 mGame.getScheduler().append(SpecialTask.FINISHED_SUCESS);
                 setResult(0);
@@ -176,6 +178,7 @@ public class BombActivity extends AppCompatActivity {
                 clear();
             }else
             { //code mauvais
+                Sound.fail(this);
                 Toast.makeText(this,  R.string.toast_fail, Toast.LENGTH_LONG).show();
                 mGame.getBomb().addTime(-Const.BOMB_PENALITY);
                 clear();

+ 10 - 3
app/src/main/java/macampcorp/macamp/activities/HostActivity.java

@@ -11,6 +11,8 @@ import android.os.Bundle;
 import android.support.v7.app.AlertDialog;
 import android.util.Log;
 import android.view.View;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.Button;
 import android.widget.TextView;
@@ -57,6 +59,7 @@ public class HostActivity extends Activity implements ChallengeFragment.OnFragme
     protected ChallengeFragment mCurrentFragment;
     protected Challenge mCurrentChallenge;
 
+
     private static final int ACTIVITY_RESULT_RESOURCE_VIEWER_SCHEDULER = 2;
 
     public String _(int x)
@@ -81,7 +84,7 @@ public class HostActivity extends Activity implements ChallengeFragment.OnFragme
 
     public void onHelp(View v)
     {
-        TutoActivity.start(this);
+        TutoActivity.startHelp(this);
     }
 
 
@@ -113,6 +116,8 @@ public class HostActivity extends Activity implements ChallengeFragment.OnFragme
 
         }, 0, 1000);
 
+
+
         updateCode();
 
         if(mGame.getCurrentStageIndex()<0) { //noueau jeu
@@ -149,6 +154,8 @@ public class HostActivity extends Activity implements ChallengeFragment.OnFragme
             throw new RuntimeException("Erreur: La classe de fragment est null");
         }
 
+
+
         if(f!=mCurrentFragment)
         {
             mCurrentFragment=f;
@@ -257,7 +264,7 @@ public class HostActivity extends Activity implements ChallengeFragment.OnFragme
 
             new AlertDialog.Builder(this)
                     .setTitle(_(R.string.dialog_sure_title))
-                    .setMessage(_(R.string.dialog_sure_pre)+out+
+                    .setMessage(_(R.string.dialog_sure_pre)+" "+out+
                                 _(R.string.dialog_sure_post))
                     .setNegativeButton(android.R.string.no,  null)
                     .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
@@ -342,7 +349,7 @@ public class HostActivity extends Activity implements ChallengeFragment.OnFragme
         if(ok)
             mGame.getBomb().addKnownCharacter(c.getCharIndex());
         updateCode();
-        mCurrentFragment.onChallengeEnd();
+        mCurrentFragment.challengeEnd();
         nextChallenge();
 
         mGame.getScheduler().schedule(this, mGame);

+ 2 - 1
app/src/main/java/macampcorp/macamp/activities/PermissionActivity.java

@@ -41,7 +41,8 @@ public class PermissionActivity extends AppCompatActivity {
     protected TextView mText;
 
     protected static final String PERMISSIONS[] = {
-            Manifest.permission.CAMERA
+            Manifest.permission.CAMERA,
+            Manifest.permission.VIBRATE
     };
 
     private static final String DISCLAMER="<h1>Attention :</h1> \n" +

+ 6 - 0
app/src/main/java/macampcorp/macamp/activities/TutoActivity.java

@@ -142,4 +142,10 @@ public class TutoActivity extends AppCompatActivity  {
         Intent it = new Intent(c, TutoActivity.class);
         c.startActivityForResult(it, REQUEST_CODE);
     }
+
+    public static void startHelp(Activity c)
+    {
+        Intent it = new Intent(c, TutoActivity.class);
+        c.startActivity(it);
+    }
 }

+ 71 - 1
app/src/main/java/macampcorp/macamp/activities/fragments/ChallengeFragment.java

@@ -11,6 +11,8 @@ import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
@@ -30,6 +32,9 @@ import macampcorp.macamp.utils.files.FileManager;
 import uk.co.senab.photoview.PhotoViewAttacher;
 
 public abstract class ChallengeFragment extends Fragment{
+    private Animation mAnimIn;
+    private Animation mAnimOut;
+
     public abstract int check();
     protected abstract  void onResetUi();
 
@@ -65,6 +70,63 @@ public abstract class ChallengeFragment extends Fragment{
 
     }
 
+    public void challengeEnd()
+    {
+        getView().startAnimation(mAnimOut);
+        onChallengeEnd();
+    }
+
+    public void appendToAnim()
+    {
+        mAnimOut.setAnimationListener(new Animation.AnimationListener() {
+            @Override
+            public void onAnimationStart(Animation animation) {
+
+            }
+
+            @Override
+            public void onAnimationEnd(Animation animation) {
+                getView().startAnimation(mAnimIn);
+                mAnimIn.setAnimationListener(new Animation.AnimationListener() {
+                    @Override
+                    public void onAnimationStart(Animation animation) {
+                        mAnimOut.setAnimationListener(new Animation.AnimationListener() {
+                            @Override
+                            public void onAnimationStart(Animation animation) {
+
+                            }
+
+                            @Override
+                            public void onAnimationEnd(Animation animation) {
+
+                            }
+
+                            @Override
+                            public void onAnimationRepeat(Animation animation) {
+
+                            }
+                        });
+                    }
+
+                    @Override
+                    public void onAnimationEnd(Animation animation) {
+
+                    }
+
+                    @Override
+                    public void onAnimationRepeat(Animation animation) {
+
+                    }
+                });
+            }
+
+            @Override
+            public void onAnimationRepeat(Animation animation) {
+
+            }
+        });
+    }
+
     public  void onChallengeEnd()
     {
 
@@ -166,8 +228,12 @@ public abstract class ChallengeFragment extends Fragment{
 
 
     @Override
-    public void onCreate(Bundle savedInstanceState) {
+    public void onCreate(Bundle savedInstanceState)
+    {
         super.onCreate(savedInstanceState);
+        mAnimIn= AnimationUtils.loadAnimation(getActivity(), R.anim.trans_in);
+
+        mAnimOut= AnimationUtils.loadAnimation(getActivity(), R.anim.trans_out);
     }
 
     public View onCreateView(LayoutInflater inflater, ViewGroup container,int res) {
@@ -193,6 +259,10 @@ public abstract class ChallengeFragment extends Fragment{
             getHostActivity().setVisibilityView(R.id.btn_indice, View.INVISIBLE);
         }
         onInitChallenge(c);
+        if(getView().getAnimation()==null)
+            getView().startAnimation(mAnimIn);
+        else appendToAnim();
+
     }
 
 

+ 18 - 4
app/src/main/java/macampcorp/macamp/activities/fragments/QuestionFragment.java

@@ -7,6 +7,7 @@ import android.app.Fragment;
 import android.text.InputType;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
+import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.inputmethod.EditorInfo;
@@ -68,6 +69,14 @@ public class QuestionFragment extends ChallengeFragment  {
             }
 
         });
+        mUIResponse.setOnTouchListener(new View.OnTouchListener() {
+            @Override
+            public boolean onTouch(View v, MotionEvent event) {
+                mUIResponse.setFocusableInTouchMode(true);
+                mUIResponse.setFocusable(true);
+                return false;
+            }
+        });
         return v;
     }
 
@@ -78,6 +87,7 @@ public class QuestionFragment extends ChallengeFragment  {
         if(resp.length()==0)
         {
             Toast.makeText(getActivity(), R.string.no_respons_q, Toast.LENGTH_SHORT).show();
+            unFocus();
             return Challenge.NO_RESPONSE;
         }
         if(mQuestion.checkAnswer(resp))
@@ -104,7 +114,7 @@ public class QuestionFragment extends ChallengeFragment  {
     @Override
     protected void onInitChallenge(Challenge c) {
         super.onInitChallenge(c);
-        Android.hideKeyboard(getActivity());
+        unFocus();
 
         if(c instanceof Question)
         {
@@ -122,15 +132,19 @@ public class QuestionFragment extends ChallengeFragment  {
         mUIResponse.setText("");
         mUIResponse.setHint(R.string.hint_resp);
         getHostActivity().setVisibilityView(R.id.btn_valid, View.VISIBLE);
-        Android.hideKeyboard(getActivity());
 
     }
 
     @Override
     public  void onChallengeEnd()
     {
-        Android.hideKeyboard(getActivity());
+        unFocus();
     }
 
-
+    public void unFocus()
+    {
+        Android.hideKeyboard(getActivity());
+        mUIResponse.setFocusableInTouchMode(false);
+        mUIResponse.setFocusable(false);
+    }
 }

+ 15 - 10
app/src/main/java/macampcorp/macamp/game/Event.java

@@ -120,7 +120,7 @@ public class Event implements Serializable {
     private int argAsInt(int i, int def) { return mArgs.get(i).optInt(def); }
     private double argAsDouble(int i, double def) { return mArgs.get(i).optDouble(def);  }
     private String argAsString(int i, String def) { return mArgs.get(i).optString(def); }
-
+    private int argc(){ return mArgs.size();}
 
 
     public EventReturn armBomb(HostActivity a, Game g)
@@ -189,18 +189,23 @@ public class Event implements Serializable {
 
     public EventReturn giveResource(HostActivity a, Game g)
     {
-        String rname = argAsString(0, "null");
-        Resource r = g.getResourceByName(rname);
-        if(r==null)
+        int l = argc();
+        EventReturn ev = new EventReturn(0, "OK");
+        for(int i=0; i<l; i++)
         {
-            L.error("Erreur dans Event: la ressource '"+rname+"' n'existe pas !");
-            throw new RuntimeException("Erreur dans Event: la ressource '"+rname+"' n'existe pas !");
+            String rname = argAsString(i, "null");
+            Resource r = g.getResourceByName(rname);
+            if(r==null)
+            {
+                L.error("Erreur dans7 Event: la ressource '"+rname+"' n'existe pas !");
+                throw new RuntimeException("Erreur dans Event: la ressource '"+rname+"' n'existe pas !");
+            }
+            g.getInventaire().addResource(r);
+            a.startResource(r, true);
+            ev.setWait();
         }
-        g.getInventaire().addResource(r);
-        a.startResource(r, true);
-        EventReturn ev = new EventReturn(0, "OK");
-        ev.setWait();
         return ev;
+
     }
 
     public String getMethod() {

+ 0 - 4
app/src/main/java/macampcorp/macamp/game/Stage.java

@@ -23,10 +23,6 @@ public class Stage  implements Serializable {
     protected ArrayList<Event> mStartEvent = new ArrayList<Event>();
     protected ArrayList<Event> mEndEvent = new ArrayList<Event>();
 
-
-
-
-
     public Stage(Game g, JSONObject root, Activity act)
     {
         try {

+ 2 - 0
app/src/main/java/macampcorp/macamp/game/scheduler/Scheduler.java

@@ -140,4 +140,6 @@ public class Scheduler implements Serializable {
             mLastTask=null;
         }
     }
+
+
 }

+ 1 - 1
app/src/main/java/macampcorp/macamp/ui/MediaView.java

@@ -33,7 +33,6 @@ public class MediaView extends SurfaceView implements View.OnClickListener,Surfa
     public void setOnCompleteListener(MediaPlayer.OnCompletionListener l)
     {
         mOnComplete=l;
-        mPlayer.setOnCompletionListener(mOnComplete);
     }
 
     public MediaView(Activity cont) {
@@ -93,6 +92,7 @@ public class MediaView extends SurfaceView implements View.OnClickListener,Surfa
                     mOnStart.onStart(x);
             }
         });
+        mPlayer.setOnCompletionListener(mOnComplete);
         return true;
 
     }

+ 28 - 0
app/src/main/java/macampcorp/macamp/ui/Sound.java

@@ -1,9 +1,16 @@
 package macampcorp.macamp.ui;
 
 import android.app.Activity;
+import android.content.Context;
 import android.media.AudioManager;
 import android.media.MediaPlayer;
 import android.media.SoundPool;
+import android.os.Build;
+import android.os.VibrationEffect;
+import android.os.Vibrator;
+import android.view.View;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
 
 import macampcorp.macamp.activities.R;
 
@@ -37,5 +44,26 @@ public class Sound {
     public static void fail(Activity a)
     {
         play(a, R.raw.fail);
+        vibrate(a,500);
+        animateFail(a);
+    }
+
+    public static void animateFail(Activity a)
+    {
+        View v = a.getWindow().getDecorView().findViewById(android.R.id.content);
+        final Animation animShake = AnimationUtils.loadAnimation(a, R.anim.shake);
+        v.startAnimation(animShake);
+    }
+
+    public static void vibrate(Activity a, int ms)
+    {
+        Vibrator v = (Vibrator) a.getSystemService(Context.VIBRATOR_SERVICE);
+        // Vibrate for 500 milliseconds
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+            v.vibrate(VibrationEffect.createOneShot(500,VibrationEffect.DEFAULT_AMPLITUDE));
+        }else{
+            //deprecated in API 26
+            v.vibrate(500);
+        }
     }
 }

+ 7 - 0
app/src/main/res/anim/shake.xml

@@ -0,0 +1,7 @@
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+    <translate android:duration="150"
+        android:fromXDelta="-10%"
+        android:repeatCount="5"
+        android:repeatMode="reverse"
+        android:toXDelta="10%"/>
+</set>

+ 5 - 0
app/src/main/res/anim/trans_in.xml

@@ -0,0 +1,5 @@
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+    <translate android:duration="600"
+        android:fromYDelta="-100%"
+        android:toYDelta="0%"/>
+</set>

+ 5 - 0
app/src/main/res/anim/trans_out.xml

@@ -0,0 +1,5 @@
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+    <translate android:duration="600"
+        android:fromYDelta="0%"
+        android:toYDelta="100%"/>
+</set>

+ 0 - 1
app/src/main/res/layout/fragment_bomb.xml

@@ -20,7 +20,6 @@
                     android:id="@+id/tv_question"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_weight="5"
                     android:editable="false"
                     android:text="Qui a tué le cheval blanc d'Henri IV ?"
                     android:textSize="@dimen/lbl_question_size" />

+ 37 - 55
app/src/main/res/layout/fragment_qcm.xml

@@ -6,78 +6,60 @@ android:layout_height="match_parent"
     android:orientation="vertical"
 tools:context="macampcorp.macamp.activities.fragments.QCMFragment">
 
-    <LinearLayout
+    <ScrollView
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:orientation="vertical">
+        android:layout_weight="1">
 
-        <TextView
-            android:id="@+id/tv_question"
+        <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:editable="false"
-            android:text="Comment s'appelait le joli cheval blanc d'Henri IV ?"
-            android:textSize="@dimen/lbl_question_size" />
+            android:orientation="vertical">
 
-        <ImageView
-            android:id="@+id/iv_img"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:adjustViewBounds="true"
-            android:src="@drawable/explosion" />
+            <TextView
+                android:id="@+id/tv_question"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:editable="false"
+                android:text="Comment s'appelait le joli cheval blanc d'Henri IV ?"
+                android:textSize="@dimen/lbl_question_size" />
 
-        <FrameLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent">
+            <ImageView
+                android:id="@+id/iv_img"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:adjustViewBounds="true"
+                android:src="@drawable/explosion" />
+
+            <Space
+                android:layout_width="match_parent"
+                android:layout_height="20sp"
+                android:layout_weight="1" />
 
             <LinearLayout
+                android:id="@+id/ll_rootIndices"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
                 android:orientation="vertical">
 
-                <Space
-                    android:layout_width="match_parent"
-                    android:layout_height="20sp"
-                    android:layout_weight="1" />
-
                 <LinearLayout
-                    android:id="@+id/ll_rootIndices"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_weight="1"
-                    android:orientation="vertical">
-
-                    <LinearLayout
-                        android:id="@+id/ll_textIndices"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:orientation="vertical"></LinearLayout>
-
-                </LinearLayout>
-
-                <ScrollView
+                    android:id="@+id/ll_textIndices"
                     android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_weight="1">
-
-                    <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:orientation="vertical">
-
-                        <RadioGroup
-                            android:id="@+id/rg_qcm"
-                            android:layout_width="match_parent"
-                            android:layout_height="match_parent">
-
-                        </RadioGroup>
-                    </LinearLayout>
-                </ScrollView>
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"></LinearLayout>
 
             </LinearLayout>
 
-        </FrameLayout>
+            <RadioGroup
+                android:id="@+id/rg_qcm"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent">
 
+            </RadioGroup>
+        </LinearLayout>
+    </ScrollView>
 
-    </LinearLayout>
 </LinearLayout>

+ 55 - 41
app/src/main/res/layout/fragment_qrcode.xml

@@ -22,7 +22,6 @@
         </com.journeyapps.barcodescanner.DecoratedBarcodeView>
 
 
-
         <LinearLayout
             android:id="@+id/ll_rootIndices2"
             android:layout_width="match_parent"
@@ -38,61 +37,76 @@
 
     </android.support.design.widget.CoordinatorLayout>
 
-    <LinearLayout
-        android:id="@+id/presentation"
+    <ScrollView
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical">
-
-        <Space
-            android:layout_width="match_parent"
-            android:layout_height="10sp" />
+        android:layout_height="match_parent">
 
         <LinearLayout
-            android:id="@+id/ll_rootIndices"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:orientation="vertical">
+            android:orientation="vertical" >
 
             <LinearLayout
-                android:id="@+id/ll_textIndices"
+                android:id="@+id/presentation"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
+                android:layout_height="wrap_content"
                 android:orientation="vertical">
 
+                <Space
+                    android:layout_width="match_parent"
+                    android:layout_height="10sp" />
+
+                <LinearLayout
+                    android:id="@+id/ll_rootIndices"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical">
+
+                    <LinearLayout
+                        android:id="@+id/ll_textIndices"
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:orientation="vertical">
+
+                    </LinearLayout>
+                </LinearLayout>
+
+                <TextView
+                    android:id="@+id/tv_question"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:text="Retrouvez un QR Code à cet endroit"
+                    android:textSize="@dimen/lbl_question_size" />
+
+                <Button
+                    android:id="@+id/btn_scan"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="bottom"
+                    android:text="@string/btn_scan"
+                    android:textSize="@dimen/font_button_size" />
+
+                <Space
+                    android:layout_width="match_parent"
+                    android:layout_height="10sp" />
+
+                <ImageView
+                    android:id="@+id/iv_img"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:adjustViewBounds="true"
+                    android:src="@drawable/explosion" />
+
+                <Space
+                    android:layout_width="match_parent"
+                    android:layout_height="20sp" />
+
             </LinearLayout>
         </LinearLayout>
+    </ScrollView>
 
-        <TextView
-            android:id="@+id/tv_question"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="Retrouvez un QR Code à cet endroit"
-            android:textSize="@dimen/lbl_question_size" />
 
-        <Space
-            android:layout_width="match_parent"
-            android:layout_height="10sp" />
 
-        <ImageView
-            android:id="@+id/iv_img"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:adjustViewBounds="true"
-            android:src="@drawable/explosion" />
 
-        <Space
-            android:layout_width="match_parent"
-            android:layout_height="20sp" />
-
-    </LinearLayout>
-
-    <Button
-        android:id="@+id/btn_scan"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_gravity="bottom"
-        android:text="@string/btn_scan"
-        android:textSize="@dimen/font_button_size" />
 
 </LinearLayout>

+ 9 - 12
app/src/main/res/layout/fragment_question.xml

@@ -62,18 +62,6 @@ tools:context="macampcorp.macamp.activities.fragments.QuestionFragment">
                             android:text="Qui a tué le cheval blanc d'Henri IV ?"
                             android:textSize="@dimen/lbl_question_size" />
 
-                        <ImageView
-                            android:id="@+id/iv_img"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_gravity="top"
-                            android:adjustViewBounds="true"
-                            android:src="@drawable/explosion" />
-
-                        <Space
-                            android:layout_width="match_parent"
-                            android:layout_height="20sp" />
-
                         <EditText
                             android:id="@+id/et_response"
                             android:layout_width="match_parent"
@@ -82,6 +70,15 @@ tools:context="macampcorp.macamp.activities.fragments.QuestionFragment">
                             android:ems="10"
                             android:hint="Entrer votre réponse"
                             android:inputType="textPersonName" />
+
+                        <ImageView
+                            android:id="@+id/iv_img"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="top"
+                            android:adjustViewBounds="true"
+                            android:src="@drawable/explosion" />
+
                     </LinearLayout>
                 </ScrollView>
 

+ 17 - 7
app/src/main/res/values/strings.xml

@@ -96,23 +96,26 @@
     <string name="hello_blank_fragment">Hello blank fragment</string>
     <string name="title_activity_test_video">TestVideoActivity</string>
     <string name="title_activity_bomb">BombActivity</string>
+
+
+
     <string name="btn_credits">Crédits</string>
     <string name="btn_retry">Réessayer</string>
     <string name="btn_quit">Quitter</string>
     <string name="lbl_time">Temps restant:</string>
-    <string name="btn_code">Code de la bombe:</string>
+    <string name="btn_code">Code de désactivation:</string>
     <string name="btn_indice">Indice</string>
     <string name="btn_journal">Journal</string>
     <string name="btn_valid">Valider</string>
     <string name="btn_ok">Ok</string>
     <string name="btn_understood">J\'ai compris</string>
     <string name="lbl_journal">Journal</string>
-    <string name="btn_prev">Précédant</string>
+    <string name="btn_prev">Précédent</string>
     <string name="btn_pass">Passer</string>
     <string name="btn_next">Suivant</string>
     <string name="btn_defuse">Désamorcer</string>
     <string name="btn_scan">Scanner le code</string>
-    <string name="toast_ok">Bombe désamorcée !</string>
+    <string name="toast_ok">Dispositif désactivé !</string>
     <string name="toast_fail">Mauvais code !</string>
     <string name="toast_length">Code incomplet</string>
     <string name="game_loading">Chargment...</string>
@@ -121,7 +124,7 @@
     <string name="no">Non</string>
     <string name="toast_continue">Voulez-vous continuer la partie ?</string>
     <string name="tuto_pass_title">Passer le tutorial</string>
-    <string name="tuto_pass">Êtes-vous variment sûre de vouloir passer le tutorial. Il est important pour bien comprendre le fonctionnement du jeu...</string>
+    <string name="tuto_pass">Êtes-vous variment sûre de vouloir passer le tutoriel. Il est important pour bien comprendre le fonctionnement du jeu...</string>
     <string name="indice_prefix">Indice :</string>
     <string name="no_response">Vous devez sélectionner une réponse</string>
     <string name="no_respons_q">Vous devez entrer une réponse</string>
@@ -130,10 +133,17 @@
     <string name="secondes">secondes</string>
     <string name="and">et</string>
     <string name="dialog_sure_title">Êtes-vous sûre ?</string>
-    <string name="dialog_sure_pre">Cet indice vous coutera</string>
+    <string name="dialog_sure_pre">Cet indice vous coutera </string>
     <string name="dialog_sure_post">, voulez vous continuer ?</string>
-    <string name="text_success"><h1>Félicitations !</h1>Tu as réussi tous les défis et tu a désamrocé la bombe IEM !<br/> Si cette aventure t'as plu, n'hésite pas à la partager et à remercier le personel de la médiathèque et de la MJC.</string>
-    <string name="text_fail"><h1>Tu as échoué !</h1> La tâche était trop dure ! C\'est pas si grave, il n\'y aura plus d\'objets électroniques (téléphone, tablettes, PC, télévisions, etc.). À moins que ... tu souhaite réessayer ?</string>
+    <string name="text_success"><![CDATA[
+        <h1>Félicitations !</h1>
+        Tu as réussi tous les défis et tu as désamorcé l\'engin électromagnétique !<br>
+        Si cette aventure t\'as plu, n\'hésite pas à la partager et à remercier le personel de la médiathèque et de la MJC.
+    ]]></string>
+    <string name="text_fail"><![CDATA[
+        <h1>Tu as échoué !</h1>
+        La tâche était trop dure ! C\'est pas si grave, il n\'y aura plus d\'objets électroniques (téléphone, tablettes, PC, télévisions, etc.). À moins que ... tu souhaites réessayer ?
+    ]]></string>
 
 
 </resources>