From ab10ca174fb93270c7c61d780914f08740ca2aaa Mon Sep 17 00:00:00 2001 From: gumartinm Date: Wed, 2 May 2012 01:31:49 +0200 Subject: [PATCH] Improving my Android Simple Tetris. Now, with score and level. --- .../gen/de/android/androidtetris/R.java | 10 +++ Android/AndroidTetris/res/layout/main.xml | 88 ++++++++++++++++---- Android/AndroidTetris/res/values/strings.xml | 4 + .../androidtetris/AndroidTetrisActivity.java | 40 +++++++++ .../src/de/android/androidtetris/DrawView.java | 96 ++++++++++++++++++---- .../de/android/androidtetris/GestureListener.java | 27 +++++- 6 files changed, 233 insertions(+), 32 deletions(-) diff --git a/Android/AndroidTetris/gen/de/android/androidtetris/R.java b/Android/AndroidTetris/gen/de/android/androidtetris/R.java index 1a06597..0fa0822 100644 --- a/Android/AndroidTetris/gen/de/android/androidtetris/R.java +++ b/Android/AndroidTetris/gen/de/android/androidtetris/R.java @@ -17,6 +17,12 @@ public final class R { public static final int yellowstar=0x7f020003; } public static final class id { + public static final int button1=0x7f050003; + public static final int button2=0x7f050004; + public static final int button3=0x7f050006; + public static final int button4=0x7f050008; + public static final int frameLayout1=0x7f050005; + public static final int frameLayout2=0x7f050007; public static final int game_display=0x7f050002; public static final int level_display=0x7f050001; public static final int score_display=0x7f050000; @@ -25,7 +31,11 @@ public final class R { public static final int main=0x7f030000; } public static final class string { + public static final int down=0x7f040004; + public static final int left=0x7f040003; public static final int level=0x7f040001; + public static final int right=0x7f040002; + public static final int rotate=0x7f040005; public static final int score=0x7f040000; } } diff --git a/Android/AndroidTetris/res/layout/main.xml b/Android/AndroidTetris/res/layout/main.xml index 2b6b050..69b89ec 100644 --- a/Android/AndroidTetris/res/layout/main.xml +++ b/Android/AndroidTetris/res/layout/main.xml @@ -12,27 +12,85 @@ android:layout_height="wrap_content" > - + android:id="@+id/score_display" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/score" + android:textSize="20dip" + android:gravity="left" + android:typeface="monospace" /> + android:id="@+id/level_display" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/level" + android:textSize="20dip" + android:gravity="right" + android:typeface="monospace" /> + - + + +