Changement de l'algorithme de vitesse (un peu d'aléatoire) et mise à jour des dépendances.

This commit is contained in:
Mysaa 2021-05-19 20:11:14 +02:00
parent af803440b1
commit 469296e2f5
7 changed files with 19 additions and 31 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="LaRoueDeLInfortune" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.id="LaRoueDeLInfortune" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="LaRoueDeLInfortune" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.id=":app" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":app" />
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="4.0.0" />
<option name="LAST_KNOWN_AGP_VERSION" value="4.0.0" />
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="3.6.0" />
<option name="LAST_KNOWN_AGP_VERSION" value="3.6.0" />
</configuration>
</facet>
<facet type="android" name="Android">
@ -19,8 +19,8 @@
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res;file://$MODULE_DIR$/src/debug/res;file://$MODULE_DIR$/build/generated/res/rs/debug" />
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/androidTest/res;file://$MODULE_DIR$/src/test/res;file://$MODULE_DIR$/src/androidTestDebug/res;file://$MODULE_DIR$/src/testDebug/res;file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
@ -32,13 +32,13 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debug/out" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/renderscript_source_output_dir/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/aidl_source_output_dir/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debugAndroidTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/ap_generated_sources/debugUnitTest/out" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />

View File

@ -2,12 +2,12 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.bernard.larouedelinfortune"
minSdkVersion 24
targetSdkVersion 29
versionCode 5
versionCode 3
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@ -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){

View File

@ -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";

View File

@ -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 {

View File

@ -7,7 +7,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:3.6.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files