diff --git a/test/AndroidManifest.xml b/test/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..c2f81453060f8e4cdcd51c891e12bc2bd4b3f7de --- /dev/null +++ b/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/test/code/sketch.properties b/test/code/sketch.properties new file mode 100644 index 0000000000000000000000000000000000000000..c6c5075368ba803ee1c1a5defff24da032954843 --- /dev/null +++ b/test/code/sketch.properties @@ -0,0 +1 @@ +component=app diff --git a/test/data/menu.jpg b/test/data/menu.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ad451632d4f5c674f5dffa6c81faca3fd9314675 Binary files /dev/null and b/test/data/menu.jpg differ diff --git a/test/menu.pde b/test/menu.pde new file mode 100644 index 0000000000000000000000000000000000000000..0132310765ef52b71a26e3b30df2e6348e44390c --- /dev/null +++ b/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/test/sketch.properties b/test/sketch.properties new file mode 100644 index 0000000000000000000000000000000000000000..6c0182c2b4b1bb939862b17d7f2d22ffeda4e7cf --- /dev/null +++ b/test/sketch.properties @@ -0,0 +1,2 @@ +mode=Android +mode.id=processing.mode.android.AndroidMode diff --git a/test/test.wav b/test/test.wav new file mode 100644 index 0000000000000000000000000000000000000000..e40087285f561f1d26f8a99f6ead2d11d371b28b Binary files /dev/null and b/test/test.wav differ