effet sonnores defait victoire renomage de carte et amélioration de l'acceuil

This commit is contained in:
marc barbier
2021-01-10 12:52:17 +01:00
parent 0de2841523
commit 5f67e85598
12 changed files with 28 additions and 26 deletions
@@ -63,7 +63,7 @@ public class Mythes_Hermione extends Card {
*/
@Override
public String getName() {
return "Hermione, fille de Ménélas";
return "Hermione";
}
/**
@@ -63,7 +63,7 @@ public class Mythes_Sémélé extends Card {
*/
@Override
public String getName() {
return "Sémélé, Mére de Dionysos";
return "Sémélé";
}
/**
@@ -63,7 +63,7 @@ public class Renaissance_Succession_Bourgogne extends Card {
*/
@Override
public String getName() {
return "Guerre de succession de Bourgogne";
return "Succession de Bourgogne";
}
/**
@@ -134,6 +134,8 @@ public class GameLogicThread extends Thread implements SoundPool.OnLoadCompleteL
soundMap=new HashMap<>();
soundMap.put("fight",soundPool.load(cont,R.raw.combat_sfx,1));
soundMap.put("card",soundPool.load(cont,R.raw.carte_jouer_sfx,1));
soundMap.put("win",soundPool.load(cont,R.raw.victoire,1));
soundMap.put("lose",soundPool.load(cont,R.raw.defaite,1));
@@ -296,21 +298,27 @@ public class GameLogicThread extends Thread implements SoundPool.OnLoadCompleteL
case Command.WIN:
//on termine la parite
backgroundMusicPlayer.stop();
playSound("win");
gameActivity.runOnUiThread(new PopupRunable("bravo ! vous avez gagné",gameActivity));
renderer.addToDraw(new DrawableBitmap(bitmapVictory,0,0,"victory",100F,50F));
renderer.updateFrame();
cancelled = true;
currentThread().sleep(2000);
returnToTheMainActivity();
break;
case Command.LOSE:
//on termine la partie
backgroundMusicPlayer.stop();
playSound("lose");
gameActivity.runOnUiThread(new PopupRunable("vous avez perdu!",gameActivity));
renderer.addToDraw(new DrawableBitmap(bitmapDefeat,0,0,"defeat",100F,50F));
renderer.updateFrame();
cancelled=true;
currentThread().sleep(2000);
//gameativity.finish() n'etait pas utilisable il fermais l'application
returnToTheMainActivity();
break;
case Command.PING:
@@ -159,7 +159,7 @@ public class DrawableCard extends Drawable{
if(c.getDescription() != null)
cardDescription = new DrawableText(c.getDescription(),0,0,toString()+"description",DESCRIPTION_WIDTH*ratio,DESCRIPTION_HEIGHT*ratio,DESCRIPTION_FONT_SIZE,DESCRIPTION_TEXT_X_RES,DESCRIPTION_TEXT_Y_RES,Color.BLACK);
cardTitle = new DrawableText(c.getName(),0,0,toString()+"name",TITLE_WIDTH*ratio,TITLE_HEIGHT*ratio,TITLE_FONT_SIZE*0.75F,TEXT_TITLE_X_RES,TEXT_TITLE_Y_RES,Color.BLACK,30);
cardTitle = new DrawableText(c.getName(),0,0,toString()+"name",TITLE_WIDTH*ratio,TITLE_HEIGHT*ratio,TITLE_FONT_SIZE*0.75F,TEXT_TITLE_X_RES,TEXT_TITLE_Y_RES,Color.BLACK,26);
cardCostDrawable = new DrawableText(c.getCost() + "", 0, 0, toString() + "cost", OFFBOARD_ATK_HP_WIDTH*ratio, OFFBOARD_ATK_HP_HEIGHT*ratio, HP_ATK_FONT_SIZE, TEXT_ATK_HP_X_RES, TEXT_ATK_HP_Y_RES,Color.BLACK);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 KiB

After

Width:  |  Height:  |  Size: 643 KiB

+14 -3
View File
@@ -21,13 +21,24 @@
<TextView
android:id="@+id/textView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:text="@string/creditText"
android:textSize="24sp"
android:textSize="20sp"
app:layout_constraintBottom_toTopOf="@+id/textView3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/copyright"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
app:layout_constraintTop_toBottomOf="@+id/textView" />
</androidx.constraintlayout.widget.ConstraintLayout>
+1 -19
View File
@@ -22,22 +22,6 @@
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/t_b_batiut" />
<TextView
android:id="@+id/textView2"
android:layout_width="400dp"
android:layout_height="wrap_content"
android:fontFamily="@font/alfa_slab_one"
android:text="Le Choc des Histoires"
android:textAlignment="center"
android:textColor="#A6FF9800"
android:textSize="30sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.454"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.672" />
<Button
android:id="@+id/playButton"
android:layout_width="wrap_content"
@@ -76,9 +60,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.92"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2"
app:layout_constraintVertical_bias="0.95" />
app:layout_constraintStart_toStartOf="parent" />
<Button
android:id="@+id/credit"
Binary file not shown.
Binary file not shown.
+1
View File
@@ -6,4 +6,5 @@
<string name="handicape">false</string>
<string name="credit">Qui sommes nous</string>
<string name="creditText">"Nous sommes un groupe quatre étudiants du département informatique de l\'IUT de Laval nommés Marc BARBIER, Antoine GALBRUN, Clément CHERBONNIER et Adrien LIGOT. Cette application a été créée dans le cadre de notre projet tuteuré du semestre 3 en s'inspirant des jeux Hearthstone et Magic The Gathering mais sur un thème historique."</string>
<string name="copyright">les effet sonores de victoires et de defaite vienne de mixkit.co</string>
</resources>
Binary file not shown.