Changement de l'algorithme de vitesse (un peu d'aléatoire) et mise à jour des dépendances.
This commit is contained in:
parent
af803440b1
commit
469296e2f5
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<component name="FacetManager">
|
||||||
<facet type="java-gradle" name="Java-Gradle">
|
<facet type="java-gradle" name="Java-Gradle">
|
||||||
<configuration>
|
<configuration>
|
||||||
|
|||||||
16
app/app.iml
16
app/app.iml
@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<component name="FacetManager">
|
||||||
<facet type="android-gradle" name="Android-Gradle">
|
<facet type="android-gradle" name="Android-Gradle">
|
||||||
<configuration>
|
<configuration>
|
||||||
<option name="GRADLE_PROJECT_PATH" value=":app" />
|
<option name="GRADLE_PROJECT_PATH" value=":app" />
|
||||||
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="4.0.0" />
|
<option name="LAST_SUCCESSFUL_SYNC_AGP_VERSION" value="3.6.0" />
|
||||||
<option name="LAST_KNOWN_AGP_VERSION" value="4.0.0" />
|
<option name="LAST_KNOWN_AGP_VERSION" value="3.6.0" />
|
||||||
</configuration>
|
</configuration>
|
||||||
</facet>
|
</facet>
|
||||||
<facet type="android" name="Android">
|
<facet type="android" name="Android">
|
||||||
@ -19,8 +19,8 @@
|
|||||||
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
<option name="ALLOW_USER_CONFIGURATION" value="false" />
|
||||||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
|
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
|
||||||
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
|
<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="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
|
||||||
<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="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />
|
||||||
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
|
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
|
||||||
</configuration>
|
</configuration>
|
||||||
</facet>
|
</facet>
|
||||||
@ -32,13 +32,13 @@
|
|||||||
<content url="file://$MODULE_DIR$">
|
<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/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/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/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/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/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/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/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$/build/generated/ap_generated_sources/debugUnitTest/out" isTestSource="true" generated="true" />
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
|
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
|
||||||
|
|||||||
@ -2,12 +2,12 @@ apply plugin: 'com.android.application'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion "29.0.3"
|
buildToolsVersion "29.0.2"
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.bernard.larouedelinfortune"
|
applicationId "com.bernard.larouedelinfortune"
|
||||||
minSdkVersion 24
|
minSdkVersion 24
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 5
|
versionCode 3
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,16 +26,12 @@ public class BanditManchotAnimator implements View.OnTouchListener {
|
|||||||
long t00 = -1;
|
long t00 = -1;
|
||||||
long t0 = -1;
|
long t0 = -1;
|
||||||
long t1 = -1;
|
long t1 = -1;
|
||||||
int deltat0 = 1000;
|
int deltat0 = 2000;
|
||||||
int deltat = 500;
|
int deltat = 500;
|
||||||
int deltax = 1000;
|
int deltax = 1000;
|
||||||
double epsilon = 0.008;
|
double epsilon = 0.008;
|
||||||
double omega = 0.02*Math.PI;
|
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) {
|
public BanditManchotAnimator(GridLayout layout, Context ctx,int questionCount, JeuDeQuestions questions, Button triggerer) {
|
||||||
this.questionCount = questionCount;
|
this.questionCount = questionCount;
|
||||||
@ -68,6 +64,7 @@ public class BanditManchotAnimator implements View.OnTouchListener {
|
|||||||
layout.postInvalidate();
|
layout.postInvalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int speed = 467;
|
||||||
|
|
||||||
private void onFrameDraw(){
|
private void onFrameDraw(){
|
||||||
|
|
||||||
@ -103,7 +100,7 @@ public class BanditManchotAnimator implements View.OnTouchListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = rollingMinIndex; i < questionCount; i++) {
|
for (int i = rollingMinIndex; i < questionCount; i++) {
|
||||||
views[i].position += speed + rand.nextInt(speedRand*2+1)-speedRand;
|
views[i].position += speed;
|
||||||
views[i].invalidate();
|
views[i].invalidate();
|
||||||
}
|
}
|
||||||
if(rollingMinIndex!=questionCount || deceleratingQuestion!=-1){
|
if(rollingMinIndex!=questionCount || deceleratingQuestion!=-1){
|
||||||
|
|||||||
@ -28,8 +28,6 @@ import java.util.Set;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.xml.transform.stream.StreamSource;
|
|
||||||
|
|
||||||
public class JeuDeQuestions {
|
public class JeuDeQuestions {
|
||||||
|
|
||||||
public static final String jeuxSubFolder = "jeux";
|
public static final String jeuxSubFolder = "jeux";
|
||||||
@ -211,7 +209,6 @@ public class JeuDeQuestions {
|
|||||||
entry.getValue().sauvegarderJeu(ctx,entry.getKey());
|
entry.getValue().sauvegarderJeu(ctx,entry.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Map<String,JeuDeQuestions> lireTousLesJeux(Context ctx){
|
public static Map<String,JeuDeQuestions> lireTousLesJeux(Context ctx){
|
||||||
Map<String,JeuDeQuestions> output = new HashMap<>();
|
Map<String,JeuDeQuestions> output = new HashMap<>();
|
||||||
for(String nom : nomDesJeuxDispos(ctx)){
|
for(String nom : nomDesJeuxDispos(ctx)){
|
||||||
@ -222,16 +219,9 @@ public class JeuDeQuestions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void getAndSetDefaultQuestions(Context ctx){
|
public static void getAndSetDefaultQuestions(Context ctx){
|
||||||
try {
|
JeuDeQuestions jeu = new JeuDeQuestions(new String[]{ctx.getString(R.string.questionParDéfaut)},new double[]{1});
|
||||||
InputStream fis = ctx.getResources().openRawResource(R.raw.default_infortune);
|
jeu.sauvegarderJeu(ctx,ctx.getString(R.string.jeuParDefaut));
|
||||||
JeuDeQuestions jeu = JeuDeQuestions.read(fis);
|
Log.i("DefaultJeu","Le jeu par défaut a été créé !!!");
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final String DOTTED_EXTENSION = ".jeuDeQuestions";
|
public static final String DOTTED_EXTENSION = ".jeuDeQuestions";
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import io.github.kexanie.library.MathView;
|
||||||
|
|
||||||
public class QuestionsView extends View {
|
public class QuestionsView extends View {
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ buildscript {
|
|||||||
|
|
||||||
}
|
}
|
||||||
dependencies {
|
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
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user