Changement de l'algorithme de vitesse (un peu d'aléatoire) et mise à jour des dépendances.
This commit is contained in:
@@ -26,16 +26,12 @@ public class BanditManchotAnimator implements View.OnTouchListener {
|
||||
long t00 = -1;
|
||||
long t0 = -1;
|
||||
long t1 = -1;
|
||||
int deltat0 = 1000;
|
||||
int deltat0 = 2000;
|
||||
int deltat = 500;
|
||||
int deltax = 1000;
|
||||
double epsilon = 0.008;
|
||||
double omega = 0.02*Math.PI;
|
||||
|
||||
public int speed = 511;
|
||||
public int speedRand = 10;
|
||||
|
||||
|
||||
|
||||
public BanditManchotAnimator(GridLayout layout, Context ctx,int questionCount, JeuDeQuestions questions, Button triggerer) {
|
||||
this.questionCount = questionCount;
|
||||
@@ -68,6 +64,7 @@ public class BanditManchotAnimator implements View.OnTouchListener {
|
||||
layout.postInvalidate();
|
||||
}
|
||||
|
||||
public int speed = 467;
|
||||
|
||||
private void onFrameDraw(){
|
||||
|
||||
@@ -103,7 +100,7 @@ public class BanditManchotAnimator implements View.OnTouchListener {
|
||||
}
|
||||
|
||||
for (int i = rollingMinIndex; i < questionCount; i++) {
|
||||
views[i].position += speed + rand.nextInt(speedRand*2+1)-speedRand;
|
||||
views[i].position += speed;
|
||||
views[i].invalidate();
|
||||
}
|
||||
if(rollingMinIndex!=questionCount || deceleratingQuestion!=-1){
|
||||
|
||||
@@ -28,8 +28,6 @@ import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
public class JeuDeQuestions {
|
||||
|
||||
public static final String jeuxSubFolder = "jeux";
|
||||
@@ -211,7 +209,6 @@ public class JeuDeQuestions {
|
||||
entry.getValue().sauvegarderJeu(ctx,entry.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
public static Map<String,JeuDeQuestions> lireTousLesJeux(Context ctx){
|
||||
Map<String,JeuDeQuestions> output = new HashMap<>();
|
||||
for(String nom : nomDesJeuxDispos(ctx)){
|
||||
@@ -222,16 +219,9 @@ public class JeuDeQuestions {
|
||||
}
|
||||
|
||||
public static void getAndSetDefaultQuestions(Context ctx){
|
||||
try {
|
||||
InputStream fis = ctx.getResources().openRawResource(R.raw.default_infortune);
|
||||
JeuDeQuestions jeu = JeuDeQuestions.read(fis);
|
||||
fis.close();
|
||||
jeu.sauvegarderJeu(ctx,ctx.getString(R.string.jeuParDefaut));
|
||||
Log.i("DefaultJeu","Le jeu par défaut a été créé !!!");
|
||||
}catch (IOException err){
|
||||
Log.e("defaultJeu","Le jeu n'a as pu être lu",err);
|
||||
}
|
||||
|
||||
JeuDeQuestions jeu = new JeuDeQuestions(new String[]{ctx.getString(R.string.questionParDéfaut)},new double[]{1});
|
||||
jeu.sauvegarderJeu(ctx,ctx.getString(R.string.jeuParDefaut));
|
||||
Log.i("DefaultJeu","Le jeu par défaut a été créé !!!");
|
||||
}
|
||||
|
||||
public static final String DOTTED_EXTENSION = ".jeuDeQuestions";
|
||||
|
||||
@@ -13,6 +13,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import io.github.kexanie.library.MathView;
|
||||
|
||||
public class QuestionsView extends View {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user