diff --git a/build/code/.gitkeep b/build/code/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/tests/arc_test.pde b/tests/arc_test.pde new file mode 100644 index 0000000000000000000000000000000000000000..59f97bf98165e8cb2650d16b8f069ee89aa3b282 --- /dev/null +++ b/tests/arc_test.pde @@ -0,0 +1,61 @@ +void setup(){ + size(displayWidth,displayHeight); + background(0,0,0); + stroke(255,0,0); + noFill(); + frameRate(60); + + + +} +void slash(float a,float b,float c,float d,color col,float offset,float lastcomp, float comp){ + stroke(col); + arc(a,b,c,d,lastcomp+offset,comp+offset); + + if (comp <PI/2){strokeWeight(comp*5);} + if (comp > PI/2) {strokeWeight(PI/2*5 - (comp%(PI/2))*5);} + + + +} + +void mousePressed(){ + is_slash = true; + comp = 0; + points = points + 1; + +} +float comp = 0; +float lastcomp = 0; +float a = random(100,displayWidth); + float b = random(100,displayHeight); + float c = random(250,displayWidth); + float d = random(500,displayHeight); + float offset = random(0,2*PI); +boolean is_slash = false; +int points = 0; +void draw() { + if (is_slash == true){ + + slash(a,b,c,d,#FFFFFF,offset,lastcomp,comp); + slash(a+5,b+5,c,d,#FF0000,offset + PI/4,lastcomp,comp); + slash(a+10,b+10,c,d,#FFFFFF,offset + 2*PI/4,lastcomp,comp); + slash(a+15,b+15,c,d,#FF0000,offset + 3*PI/4,lastcomp,comp); + } + + lastcomp = comp; + comp = comp + PI/20; + if (comp > PI){ + clear(); + textSize(32); + text("X"+str(points),100,100); + + a = random(100,displayWidth - displayWidth/10); + b = random(100,displayHeight - displayHeight/10); + c = random(250,displayWidth-displayHeight/5); + d =random(500,displayHeight-displayHeight/5); + offset = random(0,2*PI); + is_slash =false; + comp = 0;} + +} diff --git a/tests/boucle_de_jeu.zip b/tests/boucle_de_jeu.zip new file mode 100644 index 0000000000000000000000000000000000000000..d3062f2fbcab9b91c3858df8f57f1747739e616a Binary files /dev/null and b/tests/boucle_de_jeu.zip differ diff --git a/tests/menu_images.zip b/tests/menu_images.zip new file mode 100644 index 0000000000000000000000000000000000000000..982de590147422710fc31507a52ceef7246d318e Binary files /dev/null and b/tests/menu_images.zip differ diff --git a/tests/test/AndroidManifest.xml b/tests/test/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..c2f81453060f8e4cdcd51c891e12bc2bd4b3f7de --- /dev/null +++ b/tests/test/AndroidManifest.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package=""> + <uses-sdk android:minSdkVersion="17" android:targetSdkVersion="29"/> + <application android:icon="@mipmap/ic_launcher" android:label=""> + <activity android:name=".MainActivity" android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER"/> + </intent-filter> + </activity> + </application> +</manifest> diff --git a/build/code/sketch.properties b/tests/test/code/sketch.properties similarity index 100% rename from build/code/sketch.properties rename to tests/test/code/sketch.properties diff --git a/tests/test/data/menu.jpg b/tests/test/data/menu.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ad451632d4f5c674f5dffa6c81faca3fd9314675 Binary files /dev/null and b/tests/test/data/menu.jpg differ diff --git a/tests/test/menu.pde b/tests/test/menu.pde new file mode 100644 index 0000000000000000000000000000000000000000..0132310765ef52b71a26e3b30df2e6348e44390c --- /dev/null +++ b/tests/test/menu.pde @@ -0,0 +1,91 @@ +import processing.sound.*; + +int mode = 0; + +//int nbrSound; + +int startX, startY, startSizeX, startSizeY; +color startColor, startHighlight; +boolean startOver; +PImage img; +SoundFile files[][]; +void setup(){ + size(displayWidth, displayHeight); + + // création de la liste des sons et initialisation de ceux-ci. + /*files = new SoundFile[8][nbrSound]; + for(int i = 0; i<8 ; i++){ + for(int j = 0; j<3; j++){ + String name = "sound" + str(i) + str(j); + files[i][j] = new SoundFile(this, name); + } + } + */ + + //Image menu + startColor = color(255); + startHighlight = color(204); + + startSizeX = displayWidth * 3 / 4; + startSizeY = displayHeight/8; + startX = displayWidth/2-startSizeX/2; + startY = displayHeight * 3 / 4; + + + PImage img = new PImage(); + img = loadImage("menu.jpg"); + img.resize(displayWidth, displayHeight); + background(img); +} + +void playSound(int direction){ // direction = 0 => gauche ; puis on tourne dans le sens horaire. 8 directions au total + int i = int(random(0,3)); + files[direction][i].play(); +} + +float timeBetweenTwoEnemies(int enemyCounter){ + return 0; +} + +void score(int combo){ + +} + +void draw(){ + switch(mode){ + case 0 : //Correspond au menu de jeu + update(mouseX, mouseY); + if (startOver) { + fill(startHighlight); + } else { + fill(startColor); + } + stroke(0); + rect(startX, startY, startSizeX, startSizeY); + fill(0, 0, 0); + textSize(150); + text("Play", startX+startSizeX/3, startY+startSizeY/4, startSizeX, startSizeY); + break; + case 1 : //Correspond au jeu en lui-même + background(0); + break; + + case 2 : //Correspond à la mort du joueur + break; + } +} + +void mousePressed() { + if (startOver) { + mode = 1; + } +} + +void update(int x, int y) { + if (mouseX >= startX && mouseX <= x+startSizeX && + mouseY >= startY && mouseY <= y+startSizeY){ + startOver = true; + } else { + startOver = false; + } +} diff --git a/tests/test/sketch.properties b/tests/test/sketch.properties new file mode 100644 index 0000000000000000000000000000000000000000..6c0182c2b4b1bb939862b17d7f2d22ffeda4e7cf --- /dev/null +++ b/tests/test/sketch.properties @@ -0,0 +1,2 @@ +mode=Android +mode.id=processing.mode.android.AndroidMode diff --git a/tests/test/test.wav b/tests/test/test.wav new file mode 100644 index 0000000000000000000000000000000000000000..e40087285f561f1d26f8a99f6ead2d11d371b28b Binary files /dev/null and b/tests/test/test.wav differ diff --git a/tests/tests_gyro.zip b/tests/tests_gyro.zip new file mode 100644 index 0000000000000000000000000000000000000000..7e4d1d409e95483c913b1619f038695915c587a7 Binary files /dev/null and b/tests/tests_gyro.zip differ