diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..7bc01d9
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/.project b/.project
new file mode 100644
index 0000000..4f11afe
--- /dev/null
+++ b/.project
@@ -0,0 +1,33 @@
+
+
+ SpeedTrain
+
+
+
+
+
+ com.android.ide.eclipse.adt.ResourceManagerBuilder
+
+
+
+
+ com.android.ide.eclipse.adt.PreCompilerBuilder
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ com.android.ide.eclipse.adt.ApkBuilder
+
+
+
+
+
+ com.android.ide.eclipse.adt.AndroidNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..b080d2d
--- /dev/null
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,4 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
new file mode 100644
index 0000000..7b840dc
--- /dev/null
+++ b/AndroidManifest.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bin/AndroidManifest.xml b/bin/AndroidManifest.xml
new file mode 100644
index 0000000..7b840dc
--- /dev/null
+++ b/bin/AndroidManifest.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bin/SpeedTrain.apk b/bin/SpeedTrain.apk
new file mode 100644
index 0000000..706ef8c
Binary files /dev/null and b/bin/SpeedTrain.apk differ
diff --git a/bin/classes.dex b/bin/classes.dex
new file mode 100644
index 0000000..915f84b
Binary files /dev/null and b/bin/classes.dex differ
diff --git a/bin/classes/com/example/speedtrain/BuildConfig.class b/bin/classes/com/example/speedtrain/BuildConfig.class
new file mode 100644
index 0000000..e0ead54
Binary files /dev/null and b/bin/classes/com/example/speedtrain/BuildConfig.class differ
diff --git a/bin/classes/com/example/speedtrain/DBHelper.class b/bin/classes/com/example/speedtrain/DBHelper.class
new file mode 100644
index 0000000..54a3fd2
Binary files /dev/null and b/bin/classes/com/example/speedtrain/DBHelper.class differ
diff --git a/bin/classes/com/example/speedtrain/Game$1.class b/bin/classes/com/example/speedtrain/Game$1.class
new file mode 100644
index 0000000..34a6f36
Binary files /dev/null and b/bin/classes/com/example/speedtrain/Game$1.class differ
diff --git a/bin/classes/com/example/speedtrain/Game.class b/bin/classes/com/example/speedtrain/Game.class
new file mode 100644
index 0000000..e9ef355
Binary files /dev/null and b/bin/classes/com/example/speedtrain/Game.class differ
diff --git a/bin/classes/com/example/speedtrain/MainMenu.class b/bin/classes/com/example/speedtrain/MainMenu.class
new file mode 100644
index 0000000..dde7de3
Binary files /dev/null and b/bin/classes/com/example/speedtrain/MainMenu.class differ
diff --git a/bin/classes/com/example/speedtrain/R$anim.class b/bin/classes/com/example/speedtrain/R$anim.class
new file mode 100644
index 0000000..65072bc
Binary files /dev/null and b/bin/classes/com/example/speedtrain/R$anim.class differ
diff --git a/bin/classes/com/example/speedtrain/R$attr.class b/bin/classes/com/example/speedtrain/R$attr.class
new file mode 100644
index 0000000..731fae4
Binary files /dev/null and b/bin/classes/com/example/speedtrain/R$attr.class differ
diff --git a/bin/classes/com/example/speedtrain/R$dimen.class b/bin/classes/com/example/speedtrain/R$dimen.class
new file mode 100644
index 0000000..8a57f9d
Binary files /dev/null and b/bin/classes/com/example/speedtrain/R$dimen.class differ
diff --git a/bin/classes/com/example/speedtrain/R$drawable.class b/bin/classes/com/example/speedtrain/R$drawable.class
new file mode 100644
index 0000000..b9f5d50
Binary files /dev/null and b/bin/classes/com/example/speedtrain/R$drawable.class differ
diff --git a/bin/classes/com/example/speedtrain/R$id.class b/bin/classes/com/example/speedtrain/R$id.class
new file mode 100644
index 0000000..e481ab2
Binary files /dev/null and b/bin/classes/com/example/speedtrain/R$id.class differ
diff --git a/bin/classes/com/example/speedtrain/R$layout.class b/bin/classes/com/example/speedtrain/R$layout.class
new file mode 100644
index 0000000..d3bdc18
Binary files /dev/null and b/bin/classes/com/example/speedtrain/R$layout.class differ
diff --git a/bin/classes/com/example/speedtrain/R$menu.class b/bin/classes/com/example/speedtrain/R$menu.class
new file mode 100644
index 0000000..4742e77
Binary files /dev/null and b/bin/classes/com/example/speedtrain/R$menu.class differ
diff --git a/bin/classes/com/example/speedtrain/R$string.class b/bin/classes/com/example/speedtrain/R$string.class
new file mode 100644
index 0000000..2700ea0
Binary files /dev/null and b/bin/classes/com/example/speedtrain/R$string.class differ
diff --git a/bin/classes/com/example/speedtrain/R$style.class b/bin/classes/com/example/speedtrain/R$style.class
new file mode 100644
index 0000000..d8d8525
Binary files /dev/null and b/bin/classes/com/example/speedtrain/R$style.class differ
diff --git a/bin/classes/com/example/speedtrain/R.class b/bin/classes/com/example/speedtrain/R.class
new file mode 100644
index 0000000..20094da
Binary files /dev/null and b/bin/classes/com/example/speedtrain/R.class differ
diff --git a/bin/classes/com/example/speedtrain/Records.class b/bin/classes/com/example/speedtrain/Records.class
new file mode 100644
index 0000000..4ba4845
Binary files /dev/null and b/bin/classes/com/example/speedtrain/Records.class differ
diff --git a/bin/dexedLibs/android-support-v4-b87225fc96977d782b5db77e83bcb711.jar b/bin/dexedLibs/android-support-v4-b87225fc96977d782b5db77e83bcb711.jar
new file mode 100644
index 0000000..ad70e34
Binary files /dev/null and b/bin/dexedLibs/android-support-v4-b87225fc96977d782b5db77e83bcb711.jar differ
diff --git a/bin/jarlist.cache b/bin/jarlist.cache
new file mode 100644
index 0000000..0565465
--- /dev/null
+++ b/bin/jarlist.cache
@@ -0,0 +1,3 @@
+# cache for current jar dependency. DO NOT EDIT.
+# format is
+# Encoding is UTF-8
diff --git a/bin/res/crunch/drawable-hdpi/ic_launcher.png b/bin/res/crunch/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..bcfa058
Binary files /dev/null and b/bin/res/crunch/drawable-hdpi/ic_launcher.png differ
diff --git a/bin/res/crunch/drawable-mdpi/ic_launcher.png b/bin/res/crunch/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..85848ff
Binary files /dev/null and b/bin/res/crunch/drawable-mdpi/ic_launcher.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/button.png b/bin/res/crunch/drawable-xhdpi/button.png
new file mode 100644
index 0000000..0a2af44
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/button.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/buttonclicked.png b/bin/res/crunch/drawable-xhdpi/buttonclicked.png
new file mode 100644
index 0000000..b01f925
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/buttonclicked.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/combo.png b/bin/res/crunch/drawable-xhdpi/combo.png
new file mode 100644
index 0000000..60f7031
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/combo.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/ds.png b/bin/res/crunch/drawable-xhdpi/ds.png
new file mode 100644
index 0000000..7f0afee
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/ds.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/fail.png b/bin/res/crunch/drawable-xhdpi/fail.png
new file mode 100644
index 0000000..d494daa
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/fail.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/h.png b/bin/res/crunch/drawable-xhdpi/h.png
new file mode 100644
index 0000000..8a8a066
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/h.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/header_game.png b/bin/res/crunch/drawable-xhdpi/header_game.png
new file mode 100644
index 0000000..c6d89ae
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/header_game.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/ic_launcher.png b/bin/res/crunch/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..916901e
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/ic_launcher.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/main_menu.png b/bin/res/crunch/drawable-xhdpi/main_menu.png
new file mode 100644
index 0000000..dbfa413
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/main_menu.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/manual1.png b/bin/res/crunch/drawable-xhdpi/manual1.png
new file mode 100644
index 0000000..eeef193
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/manual1.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/manual2.png b/bin/res/crunch/drawable-xhdpi/manual2.png
new file mode 100644
index 0000000..502c8d2
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/manual2.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/menu.png b/bin/res/crunch/drawable-xhdpi/menu.png
new file mode 100644
index 0000000..c5daa37
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/menu.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/menu_clicked.png b/bin/res/crunch/drawable-xhdpi/menu_clicked.png
new file mode 100644
index 0000000..9b7e208
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/menu_clicked.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/o.png b/bin/res/crunch/drawable-xhdpi/o.png
new file mode 100644
index 0000000..07e73fc
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/o.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/pause.png b/bin/res/crunch/drawable-xhdpi/pause.png
new file mode 100644
index 0000000..cba6449
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/pause.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/r.png b/bin/res/crunch/drawable-xhdpi/r.png
new file mode 100644
index 0000000..6264243
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/r.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/records_title.png b/bin/res/crunch/drawable-xhdpi/records_title.png
new file mode 100644
index 0000000..a80ce8f
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/records_title.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/success.png b/bin/res/crunch/drawable-xhdpi/success.png
new file mode 100644
index 0000000..4892050
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/success.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/text.png b/bin/res/crunch/drawable-xhdpi/text.png
new file mode 100644
index 0000000..4095ed1
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/text.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/textclicked.png b/bin/res/crunch/drawable-xhdpi/textclicked.png
new file mode 100644
index 0000000..e77c65c
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/textclicked.png differ
diff --git a/bin/res/crunch/drawable-xhdpi/x.png b/bin/res/crunch/drawable-xhdpi/x.png
new file mode 100644
index 0000000..4dd5698
Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/x.png differ
diff --git a/bin/resources.ap_ b/bin/resources.ap_
new file mode 100644
index 0000000..6d0d19d
Binary files /dev/null and b/bin/resources.ap_ differ
diff --git a/gen/com/example/speedtrain/BuildConfig.java b/gen/com/example/speedtrain/BuildConfig.java
new file mode 100644
index 0000000..661988c
--- /dev/null
+++ b/gen/com/example/speedtrain/BuildConfig.java
@@ -0,0 +1,6 @@
+/** Automatically generated file. DO NOT MODIFY */
+package com.example.speedtrain;
+
+public final class BuildConfig {
+ public final static boolean DEBUG = true;
+}
\ No newline at end of file
diff --git a/gen/com/example/speedtrain/R.java b/gen/com/example/speedtrain/R.java
new file mode 100644
index 0000000..25ae504
--- /dev/null
+++ b/gen/com/example/speedtrain/R.java
@@ -0,0 +1,139 @@
+/* AUTO-GENERATED FILE. DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found. It
+ * should not be modified by hand.
+ */
+
+package com.example.speedtrain;
+
+public final class R {
+ public static final class anim {
+ public static final int scale=0x7f040000;
+ public static final int scale_combo=0x7f040001;
+ public static final int transin=0x7f040002;
+ }
+ public static final class attr {
+ }
+ public static final class dimen {
+ /** Default screen margins, per the Android Design guidelines.
+
+ Example customization of dimensions originally defined in res/values/dimens.xml
+ (such as screen margins) for screens with more than 820dp of available width. This
+ would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
+
+ */
+ public static final int activity_horizontal_margin=0x7f050000;
+ public static final int activity_vertical_margin=0x7f050001;
+ }
+ public static final class drawable {
+ public static final int button=0x7f020000;
+ public static final int buttonclicked=0x7f020001;
+ public static final int combo=0x7f020002;
+ public static final int ds=0x7f020003;
+ public static final int fail=0x7f020004;
+ public static final int h=0x7f020005;
+ public static final int header_game=0x7f020006;
+ public static final int ic_launcher=0x7f020007;
+ public static final int main_menu=0x7f020008;
+ public static final int manual1=0x7f020009;
+ public static final int manual2=0x7f02000a;
+ public static final int menu=0x7f02000b;
+ public static final int menu_clicked=0x7f02000c;
+ public static final int o=0x7f02000d;
+ public static final int pause=0x7f02000e;
+ public static final int r=0x7f02000f;
+ public static final int records_title=0x7f020010;
+ public static final int success=0x7f020011;
+ public static final int text=0x7f020012;
+ public static final int textclicked=0x7f020013;
+ public static final int x=0x7f020014;
+ }
+ public static final class id {
+ public static final int action_settings=0x7f090029;
+ public static final int btnBack=0x7f090021;
+ public static final int btnNo=0x7f090005;
+ public static final int btnStart=0x7f09000f;
+ public static final int btnYes=0x7f090006;
+ public static final int buttonNext=0x7f090020;
+ public static final int buttonPrev=0x7f09001f;
+ public static final int cart=0x7f090004;
+ public static final int combo=0x7f090009;
+ public static final int end=0x7f090014;
+ public static final int endButtons=0x7f090018;
+ public static final int fail=0x7f09000b;
+ public static final int game=0x7f090000;
+ public static final int imageManual=0x7f09001e;
+ public static final int imageView0=0x7f09000a;
+ public static final int imageView1=0x7f090008;
+ public static final int imageView2=0x7f09000c;
+ public static final int pause=0x7f090010;
+ public static final int quit=0x7f09001d;
+ public static final int records=0x7f09001c;
+ public static final int shadow=0x7f09000d;
+ public static final int start=0x7f09000e;
+ public static final int success=0x7f090007;
+ public static final int textEnd1=0x7f090015;
+ public static final int textEnd2=0x7f090016;
+ public static final int textEnd3=0x7f090017;
+ public static final int textFinish=0x7f090019;
+ public static final int textPause=0x7f090001;
+ public static final int textQuit=0x7f090013;
+ public static final int textRecord1=0x7f090022;
+ public static final int textRecord2=0x7f090023;
+ public static final int textRecord3=0x7f090024;
+ public static final int textRecord4=0x7f090025;
+ public static final int textRecord5=0x7f090026;
+ public static final int textRecord6=0x7f090027;
+ public static final int textRecord7=0x7f090028;
+ public static final int textRestart=0x7f090012;
+ public static final int textRestart2=0x7f09001a;
+ public static final int textResume=0x7f090011;
+ public static final int textScore=0x7f090003;
+ public static final int textTime=0x7f090002;
+ public static final int train=0x7f09001b;
+ }
+ public static final class layout {
+ public static final int game=0x7f030000;
+ public static final int main=0x7f030001;
+ public static final int manual=0x7f030002;
+ public static final int records=0x7f030003;
+ }
+ public static final class menu {
+ public static final int main_menu=0x7f080000;
+ }
+ public static final class string {
+ public static final int action_settings=0x7f060002;
+ public static final int app_name=0x7f060000;
+ public static final int hello_world=0x7f060001;
+ }
+ public static final class style {
+ /**
+ Base application theme, dependent on API level. This theme is replaced
+ by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
+
+
+ Theme customizations available in newer API levels can go in
+ res/values-vXX/styles.xml, while customizations related to
+ backward-compatibility can go here.
+
+
+ Base application theme for API 11+. This theme completely replaces
+ AppBaseTheme from res/values/styles.xml on API 11+ devices.
+
+ API 11 theme customizations can go here.
+
+ Base application theme for API 14+. This theme completely replaces
+ AppBaseTheme from BOTH res/values/styles.xml and
+ res/values-v11/styles.xml on API 14+ devices.
+
+ API 14 theme customizations can go here.
+ */
+ public static final int AppBaseTheme=0x7f070000;
+ /** Application theme.
+ */
+ public static final int AppTheme=0x7f070001;
+ public static final int RobotoButtonStyle=0x7f070003;
+ public static final int RobotoTextViewStyle=0x7f070002;
+ }
+}
diff --git a/libs/android-support-v4.jar b/libs/android-support-v4.jar
new file mode 100644
index 0000000..f48d0da
Binary files /dev/null and b/libs/android-support-v4.jar differ
diff --git a/proguard-project.txt b/proguard-project.txt
new file mode 100644
index 0000000..f2fe155
--- /dev/null
+++ b/proguard-project.txt
@@ -0,0 +1,20 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/project.properties b/project.properties
new file mode 100644
index 0000000..3409f08
--- /dev/null
+++ b/project.properties
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-20
diff --git a/res/anim/scale.xml b/res/anim/scale.xml
new file mode 100644
index 0000000..30e3e34
--- /dev/null
+++ b/res/anim/scale.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/res/anim/scale_combo.xml b/res/anim/scale_combo.xml
new file mode 100644
index 0000000..ad86216
--- /dev/null
+++ b/res/anim/scale_combo.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/res/anim/transin.xml b/res/anim/transin.xml
new file mode 100644
index 0000000..0b646e2
--- /dev/null
+++ b/res/anim/transin.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/res/drawable-hdpi/ic_launcher.png b/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..96a442e
Binary files /dev/null and b/res/drawable-hdpi/ic_launcher.png differ
diff --git a/res/drawable-mdpi/ic_launcher.png b/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..359047d
Binary files /dev/null and b/res/drawable-mdpi/ic_launcher.png differ
diff --git a/res/drawable-xhdpi/button.png b/res/drawable-xhdpi/button.png
new file mode 100644
index 0000000..6d8d339
Binary files /dev/null and b/res/drawable-xhdpi/button.png differ
diff --git a/res/drawable-xhdpi/buttonclicked.png b/res/drawable-xhdpi/buttonclicked.png
new file mode 100644
index 0000000..bebea9a
Binary files /dev/null and b/res/drawable-xhdpi/buttonclicked.png differ
diff --git a/res/drawable-xhdpi/combo.png b/res/drawable-xhdpi/combo.png
new file mode 100644
index 0000000..3896d0d
Binary files /dev/null and b/res/drawable-xhdpi/combo.png differ
diff --git a/res/drawable-xhdpi/ds.png b/res/drawable-xhdpi/ds.png
new file mode 100644
index 0000000..5e9ca4c
Binary files /dev/null and b/res/drawable-xhdpi/ds.png differ
diff --git a/res/drawable-xhdpi/fail.png b/res/drawable-xhdpi/fail.png
new file mode 100644
index 0000000..496cb2c
Binary files /dev/null and b/res/drawable-xhdpi/fail.png differ
diff --git a/res/drawable-xhdpi/h.png b/res/drawable-xhdpi/h.png
new file mode 100644
index 0000000..0929ff5
Binary files /dev/null and b/res/drawable-xhdpi/h.png differ
diff --git a/res/drawable-xhdpi/header_game.png b/res/drawable-xhdpi/header_game.png
new file mode 100644
index 0000000..838f694
Binary files /dev/null and b/res/drawable-xhdpi/header_game.png differ
diff --git a/res/drawable-xhdpi/ic_launcher.png b/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..71c6d76
Binary files /dev/null and b/res/drawable-xhdpi/ic_launcher.png differ
diff --git a/res/drawable-xhdpi/main_menu.png b/res/drawable-xhdpi/main_menu.png
new file mode 100644
index 0000000..ea3849a
Binary files /dev/null and b/res/drawable-xhdpi/main_menu.png differ
diff --git a/res/drawable-xhdpi/manual1.png b/res/drawable-xhdpi/manual1.png
new file mode 100644
index 0000000..fc0b294
Binary files /dev/null and b/res/drawable-xhdpi/manual1.png differ
diff --git a/res/drawable-xhdpi/manual2.png b/res/drawable-xhdpi/manual2.png
new file mode 100644
index 0000000..fce27fc
Binary files /dev/null and b/res/drawable-xhdpi/manual2.png differ
diff --git a/res/drawable-xhdpi/menu.png b/res/drawable-xhdpi/menu.png
new file mode 100644
index 0000000..94a64aa
Binary files /dev/null and b/res/drawable-xhdpi/menu.png differ
diff --git a/res/drawable-xhdpi/menu_clicked.png b/res/drawable-xhdpi/menu_clicked.png
new file mode 100644
index 0000000..d299455
Binary files /dev/null and b/res/drawable-xhdpi/menu_clicked.png differ
diff --git a/res/drawable-xhdpi/o.png b/res/drawable-xhdpi/o.png
new file mode 100644
index 0000000..3fb3553
Binary files /dev/null and b/res/drawable-xhdpi/o.png differ
diff --git a/res/drawable-xhdpi/pause.png b/res/drawable-xhdpi/pause.png
new file mode 100644
index 0000000..cc8f02a
Binary files /dev/null and b/res/drawable-xhdpi/pause.png differ
diff --git a/res/drawable-xhdpi/r.png b/res/drawable-xhdpi/r.png
new file mode 100644
index 0000000..87a0606
Binary files /dev/null and b/res/drawable-xhdpi/r.png differ
diff --git a/res/drawable-xhdpi/records_title.png b/res/drawable-xhdpi/records_title.png
new file mode 100644
index 0000000..9b9cb44
Binary files /dev/null and b/res/drawable-xhdpi/records_title.png differ
diff --git a/res/drawable-xhdpi/success.png b/res/drawable-xhdpi/success.png
new file mode 100644
index 0000000..ca72feb
Binary files /dev/null and b/res/drawable-xhdpi/success.png differ
diff --git a/res/drawable-xhdpi/text.png b/res/drawable-xhdpi/text.png
new file mode 100644
index 0000000..0cf6795
Binary files /dev/null and b/res/drawable-xhdpi/text.png differ
diff --git a/res/drawable-xhdpi/textclicked.png b/res/drawable-xhdpi/textclicked.png
new file mode 100644
index 0000000..a49ca9c
Binary files /dev/null and b/res/drawable-xhdpi/textclicked.png differ
diff --git a/res/drawable-xhdpi/x.png b/res/drawable-xhdpi/x.png
new file mode 100644
index 0000000..ad1b637
Binary files /dev/null and b/res/drawable-xhdpi/x.png differ
diff --git a/res/layout/game.xml b/res/layout/game.xml
new file mode 100644
index 0000000..5532288
--- /dev/null
+++ b/res/layout/game.xml
@@ -0,0 +1,300 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/layout/main.xml b/res/layout/main.xml
new file mode 100644
index 0000000..f6e5749
--- /dev/null
+++ b/res/layout/main.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/manual.xml b/res/layout/manual.xml
new file mode 100644
index 0000000..73965c9
--- /dev/null
+++ b/res/layout/manual.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/layout/records.xml b/res/layout/records.xml
new file mode 100644
index 0000000..021ab6b
--- /dev/null
+++ b/res/layout/records.xml
@@ -0,0 +1,160 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/menu/main_menu.xml b/res/menu/main_menu.xml
new file mode 100644
index 0000000..ccb2f78
--- /dev/null
+++ b/res/menu/main_menu.xml
@@ -0,0 +1,11 @@
+
diff --git a/res/values-v11/styles.xml b/res/values-v11/styles.xml
new file mode 100644
index 0000000..3c02242
--- /dev/null
+++ b/res/values-v11/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/res/values-v14/styles.xml b/res/values-v14/styles.xml
new file mode 100644
index 0000000..a91fd03
--- /dev/null
+++ b/res/values-v14/styles.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/res/values-w820dp/dimens.xml b/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..f3e7020
--- /dev/null
+++ b/res/values-w820dp/dimens.xml
@@ -0,0 +1,10 @@
+
+
+
+ 64dp
+
+
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
new file mode 100644
index 0000000..55c1e59
--- /dev/null
+++ b/res/values/dimens.xml
@@ -0,0 +1,7 @@
+
+
+
+ 16dp
+ 16dp
+
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
new file mode 100644
index 0000000..870c36a
--- /dev/null
+++ b/res/values/strings.xml
@@ -0,0 +1,8 @@
+
+
+
+ SpeedTrain
+ Hello world!
+ Settings
+
+
diff --git a/res/values/styles.xml b/res/values/styles.xml
new file mode 100644
index 0000000..372e88a
--- /dev/null
+++ b/res/values/styles.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/com/example/speedtrain/DBHelper.java b/src/com/example/speedtrain/DBHelper.java
new file mode 100644
index 0000000..c3a88cc
--- /dev/null
+++ b/src/com/example/speedtrain/DBHelper.java
@@ -0,0 +1,23 @@
+package com.example.speedtrain;
+
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+public class DBHelper extends SQLiteOpenHelper {
+
+ public DBHelper(Context context) {
+ super(context, "speedTrainDB", null, 1);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL("create table records (id integer primary key autoincrement,date long,score integer);");
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+
+ }
+
+}
diff --git a/src/com/example/speedtrain/Game.java b/src/com/example/speedtrain/Game.java
new file mode 100644
index 0000000..caefc31
--- /dev/null
+++ b/src/com/example/speedtrain/Game.java
@@ -0,0 +1,315 @@
+package com.example.speedtrain;
+
+import android.app.Activity;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.database.sqlite.SQLiteDatabase;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.SystemClock;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.animation.AnimationUtils;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+public class Game extends Activity implements OnClickListener{
+
+ private int score = 0;
+ private int[] carts = {R.drawable.h, R.drawable.o, R.drawable.x, R.drawable.ds, R.drawable.h};
+ private int prevCart;
+ private int actlCart;
+ private int combo = 0;
+ private final int roundTime = 30000;
+ private int algorithm = 0;
+ private int algorithmStep = 0;
+ private int[] algorithmList = new int[9];
+ private boolean algorithmOn = false;
+ private final int comboLimit = 10;
+ private TextView textTime;
+ private Button textRestart2;
+ private Button textFinish;
+ private Button btnStart;
+ private ImageView textPause;
+ private Button textResume;
+ private Button textRestart;
+ private Button textQuit;
+ private View shadow;
+ private View pause;
+ private View end;
+ private View game;
+ private View start;
+ private long endTime = 0L;
+ private Handler customHandler = new Handler();
+ private long timeInMilliseconds = 0L;
+ private long timePause = 0L;
+ private long timeResume = 0L;
+ private long updatedTime = 0L;
+ private Button btnYes;
+ private Button btnNo;
+ private ImageView cartView;
+ private DBHelper dbHelper;
+
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.game);
+
+ btnStart = (Button) findViewById(R.id.btnStart);
+ textTime = (TextView) findViewById(R.id.textTime);
+ textRestart2 = (Button) findViewById(R.id.textRestart2);
+ textFinish = (Button) findViewById(R.id.textFinish);
+ textTime = (TextView) findViewById(R.id.textTime);
+ shadow = (View) findViewById(R.id.shadow);
+ pause = (View) findViewById(R.id.pause);
+ end = (View) findViewById(R.id.end);
+ game = (View) findViewById(R.id.game);
+ start = (View) findViewById(R.id.start);
+
+ textPause = (ImageView) findViewById(R.id.textPause);
+ btnYes = (Button) findViewById(R.id.btnYes);
+ btnNo = (Button) findViewById(R.id.btnNo);
+ cartView = (ImageView) findViewById(R.id.cart);
+ textResume = (Button) findViewById(R.id.textResume);
+ textRestart = (Button) findViewById(R.id.textRestart);
+ textQuit = (Button) findViewById(R.id.textQuit);
+
+ //DataBase
+ dbHelper = new DBHelper(this);
+
+ //Setting Listeners
+ btnNo.setOnClickListener(this);
+ btnYes.setOnClickListener(this);
+ textPause.setOnClickListener(this);
+ textResume.setOnClickListener(this);
+ textRestart.setOnClickListener(this);
+ textQuit.setOnClickListener(this);
+ textRestart2.setOnClickListener(this);
+ textFinish.setOnClickListener(this);
+ btnStart.setOnClickListener(this);
+
+ //Start of game
+ textPause.setClickable(false);
+ btnYes.setClickable(false);
+ btnNo.setClickable(false);
+ prevCart = carts[(int)(Math.random()*((long)carts.length - 0.001))];
+ cartView.setImageResource(prevCart);
+ }
+
+ @Override
+ public void onClick(View v) {
+ // TODO Auto-generated method stub
+
+ SQLiteDatabase db = dbHelper.getWritableDatabase();
+
+ // object for data
+ ContentValues cv = new ContentValues();
+
+ switch (v.getId()){
+ case R.id.btnStart:
+ start();
+ break;
+ case R.id.btnNo:
+ clickedButton(v.getId());
+ break;
+ case R.id.btnYes:
+ clickedButton(v.getId());
+ break;
+ case R.id.textPause:
+ pause();
+ pause.setVisibility(View.VISIBLE);
+ pause.setClickable(true);
+ break;
+ case R.id.textResume:
+ textResume.setBackgroundResource(R.drawable.textclicked);
+ pause.setVisibility(View.INVISIBLE);
+ backToGame();
+ break;
+ case R.id.textRestart:
+ textRestart.setBackgroundResource(R.drawable.textclicked);
+ restart();
+ break;
+ case R.id.textQuit:
+ textQuit.setBackgroundResource(R.drawable.textclicked);
+ finish();
+ break;
+ case R.id.textFinish:
+ textFinish.setBackgroundResource(R.drawable.textclicked);
+ cv.put("date", SystemClock.uptimeMillis());
+ cv.put("score", score);
+ db.insert("records", null, cv);
+ finish();
+ break;
+ case R.id.textRestart2:
+ textRestart2.setBackgroundResource(R.drawable.textclicked);
+ restart();
+ break;
+ }
+ dbHelper.close();
+ }
+
+ private void start(){
+ start.setVisibility(View.INVISIBLE);
+ endTime += roundTime;
+ backToGame();
+ btnStart.setClickable(false);
+ actlCart = carts[(int)(Math.random()*((long)carts.length - 0.001))];
+ cartView.setImageResource(actlCart);
+ cartView.startAnimation(AnimationUtils.loadAnimation(this, R.anim.transin));
+ }
+
+ private void restart(){
+ Intent intentRestart = new Intent(this, Game.class);
+ startActivity(intentRestart);
+ finish();
+ }
+
+ private void backToGame(){
+ shadow.setVisibility(View.INVISIBLE);
+ game.setClickable(true);
+ btnYes.setClickable(true);
+ btnNo.setClickable(true);
+ textPause.setClickable(true);
+ timeResume = SystemClock.uptimeMillis();
+ endTime = endTime + timeResume - timePause;
+ customHandler.postDelayed(updateTimerThread, 0);
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ if(!(start.isShown()) && !(end.isShown())){
+ pause();
+ pause.setVisibility(View.VISIBLE);
+ pause.setClickable(true);
+ }
+ }
+
+ public void clickedButton(int btn) {
+ View success = (View) findViewById(R.id.success);
+ View comboImg = (View) findViewById(R.id.combo);
+ View fail = (View) findViewById(R.id.fail);
+ ImageView cartView = (ImageView) findViewById(R.id.cart);
+ TextView textScore = (TextView) findViewById(R.id.textScore);
+
+ if ((btn == R.id.btnNo && prevCart != actlCart) || (btn == R.id.btnYes && prevCart == actlCart)){
+ success.startAnimation(AnimationUtils.loadAnimation(this, R.anim.scale));
+ //success.setVisibility(View.VISIBLE);
+ score++;
+ combo++;
+ textScore.setText(Integer.toString(score));
+ }else{
+ fail.startAnimation(AnimationUtils.loadAnimation(this, R.anim.scale));
+ //fail.setVisibility(View.VISIBLE);
+ combo = 0;
+ }
+ if (combo == comboLimit){
+ comboImg.startAnimation(AnimationUtils.loadAnimation(this, R.anim.scale_combo));
+ combo = 0;
+ score += 5;
+ endTime += 3000;
+ }
+ prevCart = actlCart;
+ actlCart = nextCart();
+ cartView.setImageResource(actlCart);
+ cartView.startAnimation(AnimationUtils.loadAnimation(this, R.anim.transin));
+ success.setVisibility(View.INVISIBLE);
+ fail.setVisibility(View.INVISIBLE);
+ }
+
+ private int nextCart(){
+ int cart = 0;
+ int cartI;
+ if (!algorithmOn){
+ algorithm = (int)(Math.random()*3.99);
+ int algorithmCart;
+ switch (algorithm){
+ case 0:
+ cart = carts[(int)(Math.random()*((long)carts.length - 0.001))];
+ break;
+ // yes-yes-yes algorithm
+ case 1:
+ algorithmCart = carts[(int)(Math.random()*((long)carts.length - 0.001))];
+ for(int i = 0; i < 9; i++){
+ algorithmList[i] = algorithmCart;
+ }
+ cart = algorithmList[0];
+ algorithmOn = true;
+ break;
+ // no-no-no algorithm
+ case 2:
+ algorithmList[0] = carts[(int)(Math.random()*((long)carts.length - 0.001))];
+ for (int i = 1; i < 9; i++){
+ do{
+ cartI = carts[(int)(Math.random()*((long)carts.length - 0.001))];
+ }while(cart == algorithmList[i-1]);
+ algorithmList[i] = cartI;
+ }
+ cart = algorithmList[0];
+ algorithmOn = true;
+ break;
+ // yes-no-yes algorithm
+ case 3:
+ algorithmList[0] = carts[(int)(Math.random()*((long)carts.length - 0.001))];
+ for (int i = 1; i < 9; i++){
+ if(i%2==0){
+ algorithmList[i] = algorithmList[i-1];
+ }else{
+ do{
+ cartI = carts[(int)(Math.random()*((long)carts.length - 0.001))];
+ }while(cart == algorithmList[i-1]);
+ algorithmList[i] = cartI;
+ }
+ }
+ cart = algorithmList[0];
+ algorithmOn = true;
+ break;
+ }
+ }else{
+ cart = algorithmList[algorithmStep];
+ algorithmStep++;
+ }
+ if (algorithmStep == 9){
+ algorithmStep = 0;
+ algorithmOn = false;
+ }
+ return cart;
+ }
+
+ private void pause(){
+ timePause = SystemClock.uptimeMillis();
+ customHandler.removeCallbacks(updateTimerThread);
+ shadow.setVisibility(View.VISIBLE);
+ textRestart.setBackgroundResource(R.drawable.text);
+ textResume.setBackgroundResource(R.drawable.text);
+ game.setClickable(false);
+ textPause.setClickable(false);
+ btnYes.setClickable(false);
+ btnNo.setClickable(false);
+ }
+
+ private void end(){
+ TextView textEnd = (TextView) findViewById(R.id.textEnd3);
+ pause();
+ textEnd.setText(Integer.toString(score));
+ end.setVisibility(View.VISIBLE);
+ end.setClickable(true);
+ }
+
+ private Runnable updateTimerThread = new Runnable() {
+ public void run() {
+ timeInMilliseconds = endTime - SystemClock.uptimeMillis();
+ updatedTime = timeInMilliseconds;
+
+ if(updatedTime <= 0){
+ end();
+ }else{
+ int secs = (int) (updatedTime / 1000);
+ int mins = secs / 60;
+ secs = secs % 60;
+ textTime.setText("" + mins + ":" + String.format("%02d", secs));
+ customHandler.postDelayed(this, 0);
+ }
+ }
+ };
+}
diff --git a/src/com/example/speedtrain/MainMenu.java b/src/com/example/speedtrain/MainMenu.java
new file mode 100644
index 0000000..ab40dde
--- /dev/null
+++ b/src/com/example/speedtrain/MainMenu.java
@@ -0,0 +1,62 @@
+package com.example.speedtrain;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.TextView;
+
+
+public class MainMenu extends Activity implements OnClickListener{
+
+ private Button textQuit;
+ private Button textPlay;
+ private Button textRecords;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ textPlay = (Button) findViewById(R.id.train);
+ textPlay.setOnClickListener((OnClickListener) this);
+
+ textRecords = (Button) findViewById(R.id.records);
+ textRecords.setOnClickListener((OnClickListener) this);
+
+ textQuit = (Button) findViewById(R.id.quit);
+ textQuit.setOnClickListener((OnClickListener) this);
+ }
+
+ @Override
+ public void onClick(View v) {
+ switch (v.getId()){
+ case R.id.train:
+ textPlay.setBackgroundResource(R.drawable.menu_clicked);
+ Intent intentGame = new Intent(this, Game.class);
+ startActivity(intentGame);
+ break;
+ case R.id.records:
+ textRecords.setBackgroundResource(R.drawable.menu_clicked);
+ Intent intentRecords = new Intent(this, Records.class);
+ startActivity(intentRecords);
+ break;
+ case R.id.quit:
+ textQuit.setBackgroundResource(R.drawable.menu_clicked);
+ finish();
+ break;
+ }
+ }
+
+ @Override
+ public void onResume(){
+ super.onResume();
+ textPlay.setBackgroundResource(R.drawable.menu);
+ textRecords.setBackgroundResource(R.drawable.menu);
+ }
+}
diff --git a/src/com/example/speedtrain/Records.java b/src/com/example/speedtrain/Records.java
new file mode 100644
index 0000000..fd9b354
--- /dev/null
+++ b/src/com/example/speedtrain/Records.java
@@ -0,0 +1,56 @@
+package com.example.speedtrain;
+
+import android.app.Activity;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.TextView;
+
+public class Records extends Activity implements OnClickListener{
+
+ int[] fields = {R.id.textRecord1, R.id.textRecord2, R.id.textRecord3, R.id.textRecord4, R.id.textRecord5, R.id.textRecord6, R.id.textRecord7};
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.records);
+
+ Button btnBack = (Button) findViewById(R.id.btnBack );
+ TextView textRecord = null;
+
+ btnBack.setOnClickListener((OnClickListener) this);
+
+ //DataBase
+ DBHelper dbHelper = new DBHelper(this);
+ SQLiteDatabase db = dbHelper.getWritableDatabase();
+ Cursor c = db.query("records", new String[] {"score"}, null, null, null, null, "score DESC");
+
+ if (c.moveToFirst()) {
+
+ int i = 0;
+ do {
+ int scoreColIndex = c.getColumnIndex("score");
+ textRecord = (TextView) findViewById(fields[i]);
+ textRecord.setText(Integer.toString(c.getInt(scoreColIndex)));
+ i++;
+ if (i >= fields.length){break;}
+ } while (c.moveToNext());
+ }
+ c.close();
+ dbHelper.close();
+ }
+
+ @Override
+ public void onClick(View v) {
+ // TODO Auto-generated method stub
+ switch (v.getId()) {
+ case R.id.btnBack :
+ finish();
+ break;
+ }
+ }
+
+}