aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorSize432015-04-23 16:50:24 +0200
committerSize432015-04-23 16:50:24 +0200
commit4ec27f9b29ea7653069f996c02b40ad2c0bb2226 (patch)
tree01ae80ace90c34f3edc8975b202ce2384c97dd5a /app/src
parentBoardLoader added (diff)
parentiml files (diff)
Merge branch 'master' of https://github.com/camilstaps/RushHourAndroid
Diffstat (limited to 'app/src')
-rwxr-xr-xapp/src/main/java/com/camilstaps/rushhour/FullscreenActivity.java15
-rw-r--r--app/src/main/res/raw/cantmove.wavbin0 -> 325838 bytes
-rw-r--r--app/src/main/res/raw/rushhourtune.mp3bin0 -> 879456 bytes
-rw-r--r--app/src/main/res/raw/tune.wavbin0 -> 879488 bytes
4 files changed, 8 insertions, 7 deletions
diff --git a/app/src/main/java/com/camilstaps/rushhour/FullscreenActivity.java b/app/src/main/java/com/camilstaps/rushhour/FullscreenActivity.java
index b39cddc..29b74ac 100755
--- a/app/src/main/java/com/camilstaps/rushhour/FullscreenActivity.java
+++ b/app/src/main/java/com/camilstaps/rushhour/FullscreenActivity.java
@@ -25,8 +25,7 @@ import java.io.InputStream;
public class FullscreenActivity extends Activity {
private SoundPool soundPool;
- private boolean soundBackgroundLoaded = false;
- private int soundBackgroundId;
+ private int soundBackgroundId, soundCarDriveId;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -56,10 +55,14 @@ public class FullscreenActivity extends Activity {
soundPool.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() {
@Override
public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {
- soundBackgroundLoaded = true;
+ Log.d("FA", "Loaded: " + sampleId);
+ if (sampleId == soundBackgroundId) {
+ soundPool.play(soundBackgroundId, 1, 1, 2, -1, 1);
+ }
}
});
- soundBackgroundId = soundPool.load(this, R.raw.car_drive, 1);
+ soundCarDriveId = soundPool.load(this, R.raw.car_drive, 1);
+ soundBackgroundId = soundPool.load(this, R.raw.tune, 2);
final RelativeLayout boardLayout = (RelativeLayout) findViewById(R.id.board);
ViewTreeObserver vto = boardLayout.getViewTreeObserver();
@@ -74,9 +77,7 @@ public class FullscreenActivity extends Activity {
board.setDriveListener(new DriveListener() {
@Override
public void onDrive() {
- if (soundBackgroundLoaded) {
- soundPool.play(soundBackgroundId, 1, 1, 1, 0, 1f);
- }
+ soundPool.play(soundCarDriveId, 1, 1, 1, 0, 1);
}
});
}
diff --git a/app/src/main/res/raw/cantmove.wav b/app/src/main/res/raw/cantmove.wav
new file mode 100644
index 0000000..71e13e6
--- /dev/null
+++ b/app/src/main/res/raw/cantmove.wav
Binary files differ
diff --git a/app/src/main/res/raw/rushhourtune.mp3 b/app/src/main/res/raw/rushhourtune.mp3
new file mode 100644
index 0000000..a11c342
--- /dev/null
+++ b/app/src/main/res/raw/rushhourtune.mp3
Binary files differ
diff --git a/app/src/main/res/raw/tune.wav b/app/src/main/res/raw/tune.wav
new file mode 100644
index 0000000..42b5a42
--- /dev/null
+++ b/app/src/main/res/raw/tune.wav
Binary files differ