commit 59e2b2cb1a9448fa06f76afaafede6a799518b12 Author: Administrator Date: Sat Feb 15 09:17:59 2014 +0100 first commit 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..64c9b5a --- /dev/null +++ b/.project @@ -0,0 +1,33 @@ + + + Tetris + + + + + + 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..fe22374 --- /dev/null +++ b/AndroidManifest.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/AndroidManifest.xml b/bin/AndroidManifest.xml new file mode 100644 index 0000000..fe22374 --- /dev/null +++ b/bin/AndroidManifest.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/R.txt b/bin/R.txt new file mode 100644 index 0000000..a56be14 --- /dev/null +++ b/bin/R.txt @@ -0,0 +1,148 @@ +int attr adSize 0x7f010000 +int attr adSizes 0x7f010001 +int attr adUnitId 0x7f010002 +int attr cameraBearing 0x7f010004 +int attr cameraTargetLat 0x7f010005 +int attr cameraTargetLng 0x7f010006 +int attr cameraTilt 0x7f010007 +int attr cameraZoom 0x7f010008 +int attr mapType 0x7f010003 +int attr uiCompass 0x7f010009 +int attr uiRotateGestures 0x7f01000a +int attr uiScrollGestures 0x7f01000b +int attr uiTiltGestures 0x7f01000c +int attr uiZoomControls 0x7f01000d +int attr uiZoomGestures 0x7f01000e +int attr useViewLifecycle 0x7f01000f +int attr zOrderOnTop 0x7f010010 +int color common_action_bar_splitter 0x7f040009 +int color common_signin_btn_dark_text_default 0x7f040000 +int color common_signin_btn_dark_text_disabled 0x7f040002 +int color common_signin_btn_dark_text_focused 0x7f040003 +int color common_signin_btn_dark_text_pressed 0x7f040001 +int color common_signin_btn_default_background 0x7f040008 +int color common_signin_btn_light_text_default 0x7f040004 +int color common_signin_btn_light_text_disabled 0x7f040006 +int color common_signin_btn_light_text_focused 0x7f040007 +int color common_signin_btn_light_text_pressed 0x7f040005 +int color common_signin_btn_text_dark 0x7f04000a +int color common_signin_btn_text_light 0x7f04000b +int dimen activity_horizontal_margin 0x7f080000 +int dimen activity_vertical_margin 0x7f080001 +int drawable common_signin_btn_icon_dark 0x7f020000 +int drawable common_signin_btn_icon_disabled_dark 0x7f020001 +int drawable common_signin_btn_icon_disabled_focus_dark 0x7f020002 +int drawable common_signin_btn_icon_disabled_focus_light 0x7f020003 +int drawable common_signin_btn_icon_disabled_light 0x7f020004 +int drawable common_signin_btn_icon_focus_dark 0x7f020005 +int drawable common_signin_btn_icon_focus_light 0x7f020006 +int drawable common_signin_btn_icon_light 0x7f020007 +int drawable common_signin_btn_icon_normal_dark 0x7f020008 +int drawable common_signin_btn_icon_normal_light 0x7f020009 +int drawable common_signin_btn_icon_pressed_dark 0x7f02000a +int drawable common_signin_btn_icon_pressed_light 0x7f02000b +int drawable common_signin_btn_text_dark 0x7f02000c +int drawable common_signin_btn_text_disabled_dark 0x7f02000d +int drawable common_signin_btn_text_disabled_focus_dark 0x7f02000e +int drawable common_signin_btn_text_disabled_focus_light 0x7f02000f +int drawable common_signin_btn_text_disabled_light 0x7f020010 +int drawable common_signin_btn_text_focus_dark 0x7f020011 +int drawable common_signin_btn_text_focus_light 0x7f020012 +int drawable common_signin_btn_text_light 0x7f020013 +int drawable common_signin_btn_text_normal_dark 0x7f020014 +int drawable common_signin_btn_text_normal_light 0x7f020015 +int drawable common_signin_btn_text_pressed_dark 0x7f020016 +int drawable common_signin_btn_text_pressed_light 0x7f020017 +int drawable f0 0x7f020018 +int drawable f1 0x7f020019 +int drawable f2 0x7f02001a +int drawable f3 0x7f02001b +int drawable f4 0x7f02001c +int drawable f5 0x7f02001d +int drawable f6 0x7f02001e +int drawable f7 0x7f02001f +int drawable f8 0x7f020020 +int drawable f9 0x7f020021 +int drawable ic_launcher 0x7f020022 +int drawable ic_plusone_medium_off_client 0x7f020023 +int drawable ic_plusone_small_off_client 0x7f020024 +int drawable ic_plusone_standard_off_client 0x7f020025 +int drawable ic_plusone_tall_off_client 0x7f020026 +int drawable sprite_b 0x7f020027 +int drawable sprite_blockline 0x7f020028 +int drawable sprite_controler 0x7f020029 +int drawable sprite_freeversion 0x7f02002a +int drawable sprite_gameover 0x7f02002b +int drawable sprite_i1 0x7f02002c +int drawable sprite_i1r 0x7f02002d +int drawable sprite_i2 0x7f02002e +int drawable sprite_i2r 0x7f02002f +int drawable sprite_i3 0x7f020030 +int drawable sprite_i3r 0x7f020031 +int drawable sprite_i4 0x7f020032 +int drawable sprite_i4r 0x7f020033 +int drawable sprite_l1 0x7f020034 +int drawable sprite_l2 0x7f020035 +int drawable sprite_s 0x7f020036 +int drawable sprite_score 0x7f020037 +int drawable sprite_t 0x7f020038 +int drawable sprite_z 0x7f020039 +int id action_settings 0x7f050005 +int id hybrid 0x7f050004 +int id none 0x7f050000 +int id normal 0x7f050001 +int id satellite 0x7f050002 +int id terrain 0x7f050003 +int integer google_play_services_version 0x7f070000 +int menu main 0x7f0a0000 +int raw tetris_a 0x7f030000 +int string action_settings 0x7f06001b +int string app_name 0x7f06001a +int string auth_client_needs_enabling_title 0x7f060015 +int string auth_client_needs_installation_title 0x7f060016 +int string auth_client_needs_update_title 0x7f060017 +int string auth_client_play_services_err_notification_msg 0x7f060018 +int string auth_client_requested_by_msg 0x7f060019 +int string auth_client_using_bad_version_title 0x7f060014 +int string common_google_play_services_enable_button 0x7f060006 +int string common_google_play_services_enable_text 0x7f060005 +int string common_google_play_services_enable_title 0x7f060004 +int string common_google_play_services_install_button 0x7f060003 +int string common_google_play_services_install_text_phone 0x7f060001 +int string common_google_play_services_install_text_tablet 0x7f060002 +int string common_google_play_services_install_title 0x7f060000 +int string common_google_play_services_invalid_account_text 0x7f06000c +int string common_google_play_services_invalid_account_title 0x7f06000b +int string common_google_play_services_network_error_text 0x7f06000a +int string common_google_play_services_network_error_title 0x7f060009 +int string common_google_play_services_unknown_issue 0x7f06000d +int string common_google_play_services_unsupported_date_text 0x7f060010 +int string common_google_play_services_unsupported_text 0x7f06000f +int string common_google_play_services_unsupported_title 0x7f06000e +int string common_google_play_services_update_button 0x7f060011 +int string common_google_play_services_update_text 0x7f060008 +int string common_google_play_services_update_title 0x7f060007 +int string common_signin_button_text 0x7f060012 +int string common_signin_button_text_long 0x7f060013 +int string hello_world 0x7f06001c +int style AppBaseTheme 0x7f090000 +int style AppTheme 0x7f090001 +int[] styleable AdsAttrs { 0x7f010000, 0x7f010001, 0x7f010002 } +int styleable AdsAttrs_adSize 0 +int styleable AdsAttrs_adSizes 1 +int styleable AdsAttrs_adUnitId 2 +int[] styleable MapAttrs { 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010 } +int styleable MapAttrs_cameraBearing 1 +int styleable MapAttrs_cameraTargetLat 2 +int styleable MapAttrs_cameraTargetLng 3 +int styleable MapAttrs_cameraTilt 4 +int styleable MapAttrs_cameraZoom 5 +int styleable MapAttrs_mapType 0 +int styleable MapAttrs_uiCompass 6 +int styleable MapAttrs_uiRotateGestures 7 +int styleable MapAttrs_uiScrollGestures 8 +int styleable MapAttrs_uiTiltGestures 9 +int styleable MapAttrs_uiZoomControls 10 +int styleable MapAttrs_uiZoomGestures 11 +int styleable MapAttrs_useViewLifecycle 12 +int styleable MapAttrs_zOrderOnTop 13 diff --git a/bin/Tetris.apk b/bin/Tetris.apk new file mode 100644 index 0000000..65e5cf6 Binary files /dev/null and b/bin/Tetris.apk differ diff --git a/bin/classes.dex b/bin/classes.dex new file mode 100644 index 0000000..68c8ccf Binary files /dev/null and b/bin/classes.dex differ diff --git a/bin/classes/com/google/android/gms/R$attr.class b/bin/classes/com/google/android/gms/R$attr.class new file mode 100644 index 0000000..e52e59a Binary files /dev/null and b/bin/classes/com/google/android/gms/R$attr.class differ diff --git a/bin/classes/com/google/android/gms/R$color.class b/bin/classes/com/google/android/gms/R$color.class new file mode 100644 index 0000000..5ca3be6 Binary files /dev/null and b/bin/classes/com/google/android/gms/R$color.class differ diff --git a/bin/classes/com/google/android/gms/R$drawable.class b/bin/classes/com/google/android/gms/R$drawable.class new file mode 100644 index 0000000..2d0848c Binary files /dev/null and b/bin/classes/com/google/android/gms/R$drawable.class differ diff --git a/bin/classes/com/google/android/gms/R$id.class b/bin/classes/com/google/android/gms/R$id.class new file mode 100644 index 0000000..880a0bd Binary files /dev/null and b/bin/classes/com/google/android/gms/R$id.class differ diff --git a/bin/classes/com/google/android/gms/R$integer.class b/bin/classes/com/google/android/gms/R$integer.class new file mode 100644 index 0000000..addeaf7 Binary files /dev/null and b/bin/classes/com/google/android/gms/R$integer.class differ diff --git a/bin/classes/com/google/android/gms/R$string.class b/bin/classes/com/google/android/gms/R$string.class new file mode 100644 index 0000000..47150ba Binary files /dev/null and b/bin/classes/com/google/android/gms/R$string.class differ diff --git a/bin/classes/com/google/android/gms/R$styleable.class b/bin/classes/com/google/android/gms/R$styleable.class new file mode 100644 index 0000000..0eb8070 Binary files /dev/null and b/bin/classes/com/google/android/gms/R$styleable.class differ diff --git a/bin/classes/com/google/android/gms/R.class b/bin/classes/com/google/android/gms/R.class new file mode 100644 index 0000000..6176364 Binary files /dev/null and b/bin/classes/com/google/android/gms/R.class differ diff --git a/bin/classes/mangavalk/tetris/BuildConfig.class b/bin/classes/mangavalk/tetris/BuildConfig.class new file mode 100644 index 0000000..626a080 Binary files /dev/null and b/bin/classes/mangavalk/tetris/BuildConfig.class differ diff --git a/bin/classes/mangavalk/tetris/CanvasView$1.class b/bin/classes/mangavalk/tetris/CanvasView$1.class new file mode 100644 index 0000000..9ce8dd6 Binary files /dev/null and b/bin/classes/mangavalk/tetris/CanvasView$1.class differ diff --git a/bin/classes/mangavalk/tetris/CanvasView$2.class b/bin/classes/mangavalk/tetris/CanvasView$2.class new file mode 100644 index 0000000..2efaea8 Binary files /dev/null and b/bin/classes/mangavalk/tetris/CanvasView$2.class differ diff --git a/bin/classes/mangavalk/tetris/CanvasView.class b/bin/classes/mangavalk/tetris/CanvasView.class new file mode 100644 index 0000000..34d4cda Binary files /dev/null and b/bin/classes/mangavalk/tetris/CanvasView.class differ diff --git a/bin/classes/mangavalk/tetris/MainActivity.class b/bin/classes/mangavalk/tetris/MainActivity.class new file mode 100644 index 0000000..c5015cd Binary files /dev/null and b/bin/classes/mangavalk/tetris/MainActivity.class differ diff --git a/bin/classes/mangavalk/tetris/R$attr.class b/bin/classes/mangavalk/tetris/R$attr.class new file mode 100644 index 0000000..29e8227 Binary files /dev/null and b/bin/classes/mangavalk/tetris/R$attr.class differ diff --git a/bin/classes/mangavalk/tetris/R$color.class b/bin/classes/mangavalk/tetris/R$color.class new file mode 100644 index 0000000..5ab881d Binary files /dev/null and b/bin/classes/mangavalk/tetris/R$color.class differ diff --git a/bin/classes/mangavalk/tetris/R$dimen.class b/bin/classes/mangavalk/tetris/R$dimen.class new file mode 100644 index 0000000..fd94a93 Binary files /dev/null and b/bin/classes/mangavalk/tetris/R$dimen.class differ diff --git a/bin/classes/mangavalk/tetris/R$drawable.class b/bin/classes/mangavalk/tetris/R$drawable.class new file mode 100644 index 0000000..fa42f90 Binary files /dev/null and b/bin/classes/mangavalk/tetris/R$drawable.class differ diff --git a/bin/classes/mangavalk/tetris/R$id.class b/bin/classes/mangavalk/tetris/R$id.class new file mode 100644 index 0000000..f462ed1 Binary files /dev/null and b/bin/classes/mangavalk/tetris/R$id.class differ diff --git a/bin/classes/mangavalk/tetris/R$integer.class b/bin/classes/mangavalk/tetris/R$integer.class new file mode 100644 index 0000000..5c896f2 Binary files /dev/null and b/bin/classes/mangavalk/tetris/R$integer.class differ diff --git a/bin/classes/mangavalk/tetris/R$menu.class b/bin/classes/mangavalk/tetris/R$menu.class new file mode 100644 index 0000000..e9596cf Binary files /dev/null and b/bin/classes/mangavalk/tetris/R$menu.class differ diff --git a/bin/classes/mangavalk/tetris/R$raw.class b/bin/classes/mangavalk/tetris/R$raw.class new file mode 100644 index 0000000..c5aa7d5 Binary files /dev/null and b/bin/classes/mangavalk/tetris/R$raw.class differ diff --git a/bin/classes/mangavalk/tetris/R$string.class b/bin/classes/mangavalk/tetris/R$string.class new file mode 100644 index 0000000..a1c1ea1 Binary files /dev/null and b/bin/classes/mangavalk/tetris/R$string.class differ diff --git a/bin/classes/mangavalk/tetris/R$style.class b/bin/classes/mangavalk/tetris/R$style.class new file mode 100644 index 0000000..ee08e5e Binary files /dev/null and b/bin/classes/mangavalk/tetris/R$style.class differ diff --git a/bin/classes/mangavalk/tetris/R$styleable.class b/bin/classes/mangavalk/tetris/R$styleable.class new file mode 100644 index 0000000..a14a043 Binary files /dev/null and b/bin/classes/mangavalk/tetris/R$styleable.class differ diff --git a/bin/classes/mangavalk/tetris/R.class b/bin/classes/mangavalk/tetris/R.class new file mode 100644 index 0000000..bb26378 Binary files /dev/null and b/bin/classes/mangavalk/tetris/R.class differ diff --git a/bin/dexedLibs/android-support-v4-e38fb59a248717f31affd60bf7493905.jar b/bin/dexedLibs/android-support-v4-e38fb59a248717f31affd60bf7493905.jar new file mode 100644 index 0000000..1ea53e2 Binary files /dev/null and b/bin/dexedLibs/android-support-v4-e38fb59a248717f31affd60bf7493905.jar differ diff --git a/bin/dexedLibs/google-play-services-86f775ed0e8e6e5cbc00ac77edae487f.jar b/bin/dexedLibs/google-play-services-86f775ed0e8e6e5cbc00ac77edae487f.jar new file mode 100644 index 0000000..d8b7b15 Binary files /dev/null and b/bin/dexedLibs/google-play-services-86f775ed0e8e6e5cbc00ac77edae487f.jar differ diff --git a/bin/dexedLibs/google-play-services_lib-0f09ee896a674b9292f9df3250c11de4.jar b/bin/dexedLibs/google-play-services_lib-0f09ee896a674b9292f9df3250c11de4.jar new file mode 100644 index 0000000..81dc944 Binary files /dev/null and b/bin/dexedLibs/google-play-services_lib-0f09ee896a674b9292f9df3250c11de4.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..4add5a5 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..e48e369 Binary files /dev/null and b/bin/res/crunch/drawable-mdpi/ic_launcher.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..3abc07a Binary files /dev/null and b/bin/res/crunch/drawable-xhdpi/ic_launcher.png differ diff --git a/bin/res/crunch/drawable-xxhdpi/ic_launcher.png b/bin/res/crunch/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..a466bd4 Binary files /dev/null and b/bin/res/crunch/drawable-xxhdpi/ic_launcher.png differ diff --git a/bin/resources.ap_ b/bin/resources.ap_ new file mode 100644 index 0000000..f8b33d9 Binary files /dev/null and b/bin/resources.ap_ differ diff --git a/gen/com/google/android/gms/R.java b/gen/com/google/android/gms/R.java new file mode 100644 index 0000000..e036d83 --- /dev/null +++ b/gen/com/google/android/gms/R.java @@ -0,0 +1,132 @@ +/* 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.google.android.gms; + +public final class R { + public static final class attr { + public static final int adSize = 0x7f010000; + public static final int adSizes = 0x7f010001; + public static final int adUnitId = 0x7f010002; + public static final int cameraBearing = 0x7f010004; + public static final int cameraTargetLat = 0x7f010005; + public static final int cameraTargetLng = 0x7f010006; + public static final int cameraTilt = 0x7f010007; + public static final int cameraZoom = 0x7f010008; + public static final int mapType = 0x7f010003; + public static final int uiCompass = 0x7f010009; + public static final int uiRotateGestures = 0x7f01000a; + public static final int uiScrollGestures = 0x7f01000b; + public static final int uiTiltGestures = 0x7f01000c; + public static final int uiZoomControls = 0x7f01000d; + public static final int uiZoomGestures = 0x7f01000e; + public static final int useViewLifecycle = 0x7f01000f; + public static final int zOrderOnTop = 0x7f010010; + } + public static final class color { + public static final int common_action_bar_splitter = 0x7f040009; + public static final int common_signin_btn_dark_text_default = 0x7f040000; + public static final int common_signin_btn_dark_text_disabled = 0x7f040002; + public static final int common_signin_btn_dark_text_focused = 0x7f040003; + public static final int common_signin_btn_dark_text_pressed = 0x7f040001; + public static final int common_signin_btn_default_background = 0x7f040008; + public static final int common_signin_btn_light_text_default = 0x7f040004; + public static final int common_signin_btn_light_text_disabled = 0x7f040006; + public static final int common_signin_btn_light_text_focused = 0x7f040007; + public static final int common_signin_btn_light_text_pressed = 0x7f040005; + public static final int common_signin_btn_text_dark = 0x7f04000a; + public static final int common_signin_btn_text_light = 0x7f04000b; + } + public static final class drawable { + public static final int common_signin_btn_icon_dark = 0x7f020000; + public static final int common_signin_btn_icon_disabled_dark = 0x7f020001; + public static final int common_signin_btn_icon_disabled_focus_dark = 0x7f020002; + public static final int common_signin_btn_icon_disabled_focus_light = 0x7f020003; + public static final int common_signin_btn_icon_disabled_light = 0x7f020004; + public static final int common_signin_btn_icon_focus_dark = 0x7f020005; + public static final int common_signin_btn_icon_focus_light = 0x7f020006; + public static final int common_signin_btn_icon_light = 0x7f020007; + public static final int common_signin_btn_icon_normal_dark = 0x7f020008; + public static final int common_signin_btn_icon_normal_light = 0x7f020009; + public static final int common_signin_btn_icon_pressed_dark = 0x7f02000a; + public static final int common_signin_btn_icon_pressed_light = 0x7f02000b; + public static final int common_signin_btn_text_dark = 0x7f02000c; + public static final int common_signin_btn_text_disabled_dark = 0x7f02000d; + public static final int common_signin_btn_text_disabled_focus_dark = 0x7f02000e; + public static final int common_signin_btn_text_disabled_focus_light = 0x7f02000f; + public static final int common_signin_btn_text_disabled_light = 0x7f020010; + public static final int common_signin_btn_text_focus_dark = 0x7f020011; + public static final int common_signin_btn_text_focus_light = 0x7f020012; + public static final int common_signin_btn_text_light = 0x7f020013; + public static final int common_signin_btn_text_normal_dark = 0x7f020014; + public static final int common_signin_btn_text_normal_light = 0x7f020015; + public static final int common_signin_btn_text_pressed_dark = 0x7f020016; + public static final int common_signin_btn_text_pressed_light = 0x7f020017; + public static final int ic_plusone_medium_off_client = 0x7f020023; + public static final int ic_plusone_small_off_client = 0x7f020024; + public static final int ic_plusone_standard_off_client = 0x7f020025; + public static final int ic_plusone_tall_off_client = 0x7f020026; + } + public static final class id { + public static final int hybrid = 0x7f050004; + public static final int none = 0x7f050000; + public static final int normal = 0x7f050001; + public static final int satellite = 0x7f050002; + public static final int terrain = 0x7f050003; + } + public static final class integer { + public static final int google_play_services_version = 0x7f070000; + } + public static final class string { + public static final int auth_client_needs_enabling_title = 0x7f060015; + public static final int auth_client_needs_installation_title = 0x7f060016; + public static final int auth_client_needs_update_title = 0x7f060017; + public static final int auth_client_play_services_err_notification_msg = 0x7f060018; + public static final int auth_client_requested_by_msg = 0x7f060019; + public static final int auth_client_using_bad_version_title = 0x7f060014; + public static final int common_google_play_services_enable_button = 0x7f060006; + public static final int common_google_play_services_enable_text = 0x7f060005; + public static final int common_google_play_services_enable_title = 0x7f060004; + public static final int common_google_play_services_install_button = 0x7f060003; + public static final int common_google_play_services_install_text_phone = 0x7f060001; + public static final int common_google_play_services_install_text_tablet = 0x7f060002; + public static final int common_google_play_services_install_title = 0x7f060000; + public static final int common_google_play_services_invalid_account_text = 0x7f06000c; + public static final int common_google_play_services_invalid_account_title = 0x7f06000b; + public static final int common_google_play_services_network_error_text = 0x7f06000a; + public static final int common_google_play_services_network_error_title = 0x7f060009; + public static final int common_google_play_services_unknown_issue = 0x7f06000d; + public static final int common_google_play_services_unsupported_date_text = 0x7f060010; + public static final int common_google_play_services_unsupported_text = 0x7f06000f; + public static final int common_google_play_services_unsupported_title = 0x7f06000e; + public static final int common_google_play_services_update_button = 0x7f060011; + public static final int common_google_play_services_update_text = 0x7f060008; + public static final int common_google_play_services_update_title = 0x7f060007; + public static final int common_signin_button_text = 0x7f060012; + public static final int common_signin_button_text_long = 0x7f060013; + } + public static final class styleable { + public static final int[] AdsAttrs = { 0x7f010000, 0x7f010001, 0x7f010002 }; + public static final int AdsAttrs_adSize = 0; + public static final int AdsAttrs_adSizes = 1; + public static final int AdsAttrs_adUnitId = 2; + public static final int[] MapAttrs = { 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010 }; + public static final int MapAttrs_cameraBearing = 1; + public static final int MapAttrs_cameraTargetLat = 2; + public static final int MapAttrs_cameraTargetLng = 3; + public static final int MapAttrs_cameraTilt = 4; + public static final int MapAttrs_cameraZoom = 5; + public static final int MapAttrs_mapType = 0; + public static final int MapAttrs_uiCompass = 6; + public static final int MapAttrs_uiRotateGestures = 7; + public static final int MapAttrs_uiScrollGestures = 8; + public static final int MapAttrs_uiTiltGestures = 9; + public static final int MapAttrs_uiZoomControls = 10; + public static final int MapAttrs_uiZoomGestures = 11; + public static final int MapAttrs_useViewLifecycle = 12; + public static final int MapAttrs_zOrderOnTop = 13; + } +} diff --git a/gen/mangavalk/tetris/BuildConfig.java b/gen/mangavalk/tetris/BuildConfig.java new file mode 100644 index 0000000..58b076c --- /dev/null +++ b/gen/mangavalk/tetris/BuildConfig.java @@ -0,0 +1,6 @@ +/** Automatically generated file. DO NOT MODIFY */ +package mangavalk.tetris; + +public final class BuildConfig { + public final static boolean DEBUG = true; +} \ No newline at end of file diff --git a/gen/mangavalk/tetris/R.java b/gen/mangavalk/tetris/R.java new file mode 100644 index 0000000..0b9436e --- /dev/null +++ b/gen/mangavalk/tetris/R.java @@ -0,0 +1,717 @@ +/* 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 mangavalk.tetris; + +public final class R { + public static final class attr { + /** + The size of the ad. It must be one of BANNER, FULL_BANNER, LEADERBOARD, + MEDIUM_RECTANGLE, SMART_BANNER, WIDE_SKYSCRAPER, or + <width>x<height>. + +

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int adSize=0x7f010000; + /** + A comma-separated list of the supported ad sizes. The sizes must be one of + BANNER, FULL_BANNER, LEADERBOARD, MEDIUM_RECTANGLE, SMART_BANNER, + WIDE_SKYSCRAPER, or <width>x<height>. + +

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int adSizes=0x7f010001; + /** The ad unit ID. +

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int adUnitId=0x7f010002; + /**

Must be a floating point value, such as "1.2". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int cameraBearing=0x7f010004; + /**

Must be a floating point value, such as "1.2". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int cameraTargetLat=0x7f010005; + /**

Must be a floating point value, such as "1.2". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int cameraTargetLng=0x7f010006; + /**

Must be a floating point value, such as "1.2". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int cameraTilt=0x7f010007; + /**

Must be a floating point value, such as "1.2". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int cameraZoom=0x7f010008; + /**

Must be one of the following constant values.

+ ++++ + + + + + +
ConstantValueDescription
none0
normal1
satellite2
terrain3
hybrid4
+ */ + public static final int mapType=0x7f010003; + /**

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int uiCompass=0x7f010009; + /**

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int uiRotateGestures=0x7f01000a; + /**

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int uiScrollGestures=0x7f01000b; + /**

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int uiTiltGestures=0x7f01000c; + /**

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int uiZoomControls=0x7f01000d; + /**

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int uiZoomGestures=0x7f01000e; + /**

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int useViewLifecycle=0x7f01000f; + /**

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + */ + public static final int zOrderOnTop=0x7f010010; + } + public static final class color { + public static final int common_action_bar_splitter=0x7f040009; + /** Sign-in Button Colors + */ + public static final int common_signin_btn_dark_text_default=0x7f040000; + public static final int common_signin_btn_dark_text_disabled=0x7f040002; + public static final int common_signin_btn_dark_text_focused=0x7f040003; + public static final int common_signin_btn_dark_text_pressed=0x7f040001; + public static final int common_signin_btn_default_background=0x7f040008; + public static final int common_signin_btn_light_text_default=0x7f040004; + public static final int common_signin_btn_light_text_disabled=0x7f040006; + public static final int common_signin_btn_light_text_focused=0x7f040007; + public static final int common_signin_btn_light_text_pressed=0x7f040005; + public static final int common_signin_btn_text_dark=0x7f04000a; + public static final int common_signin_btn_text_light=0x7f04000b; + } + public static final class dimen { + /** Default screen margins, per the Android Design guidelines. + + Customize dimensions originally defined in res/values/dimens.xml (such as + screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. + + */ + public static final int activity_horizontal_margin=0x7f080000; + public static final int activity_vertical_margin=0x7f080001; + } + public static final class drawable { + public static final int common_signin_btn_icon_dark=0x7f020000; + public static final int common_signin_btn_icon_disabled_dark=0x7f020001; + public static final int common_signin_btn_icon_disabled_focus_dark=0x7f020002; + public static final int common_signin_btn_icon_disabled_focus_light=0x7f020003; + public static final int common_signin_btn_icon_disabled_light=0x7f020004; + public static final int common_signin_btn_icon_focus_dark=0x7f020005; + public static final int common_signin_btn_icon_focus_light=0x7f020006; + public static final int common_signin_btn_icon_light=0x7f020007; + public static final int common_signin_btn_icon_normal_dark=0x7f020008; + public static final int common_signin_btn_icon_normal_light=0x7f020009; + public static final int common_signin_btn_icon_pressed_dark=0x7f02000a; + public static final int common_signin_btn_icon_pressed_light=0x7f02000b; + public static final int common_signin_btn_text_dark=0x7f02000c; + public static final int common_signin_btn_text_disabled_dark=0x7f02000d; + public static final int common_signin_btn_text_disabled_focus_dark=0x7f02000e; + public static final int common_signin_btn_text_disabled_focus_light=0x7f02000f; + public static final int common_signin_btn_text_disabled_light=0x7f020010; + public static final int common_signin_btn_text_focus_dark=0x7f020011; + public static final int common_signin_btn_text_focus_light=0x7f020012; + public static final int common_signin_btn_text_light=0x7f020013; + public static final int common_signin_btn_text_normal_dark=0x7f020014; + public static final int common_signin_btn_text_normal_light=0x7f020015; + public static final int common_signin_btn_text_pressed_dark=0x7f020016; + public static final int common_signin_btn_text_pressed_light=0x7f020017; + public static final int f0=0x7f020018; + public static final int f1=0x7f020019; + public static final int f2=0x7f02001a; + public static final int f3=0x7f02001b; + public static final int f4=0x7f02001c; + public static final int f5=0x7f02001d; + public static final int f6=0x7f02001e; + public static final int f7=0x7f02001f; + public static final int f8=0x7f020020; + public static final int f9=0x7f020021; + public static final int ic_launcher=0x7f020022; + public static final int ic_plusone_medium_off_client=0x7f020023; + public static final int ic_plusone_small_off_client=0x7f020024; + public static final int ic_plusone_standard_off_client=0x7f020025; + public static final int ic_plusone_tall_off_client=0x7f020026; + public static final int sprite_b=0x7f020027; + public static final int sprite_blockline=0x7f020028; + public static final int sprite_controler=0x7f020029; + public static final int sprite_freeversion=0x7f02002a; + public static final int sprite_gameover=0x7f02002b; + public static final int sprite_i1=0x7f02002c; + public static final int sprite_i1r=0x7f02002d; + public static final int sprite_i2=0x7f02002e; + public static final int sprite_i2r=0x7f02002f; + public static final int sprite_i3=0x7f020030; + public static final int sprite_i3r=0x7f020031; + public static final int sprite_i4=0x7f020032; + public static final int sprite_i4r=0x7f020033; + public static final int sprite_l1=0x7f020034; + public static final int sprite_l2=0x7f020035; + public static final int sprite_s=0x7f020036; + public static final int sprite_score=0x7f020037; + public static final int sprite_t=0x7f020038; + public static final int sprite_z=0x7f020039; + } + public static final class id { + public static final int action_settings=0x7f050005; + public static final int hybrid=0x7f050004; + public static final int none=0x7f050000; + public static final int normal=0x7f050001; + public static final int satellite=0x7f050002; + public static final int terrain=0x7f050003; + } + public static final class integer { + public static final int google_play_services_version=0x7f070000; + } + public static final class menu { + public static final int main=0x7f0a0000; + } + public static final class raw { + public static final int tetris_a=0x7f030000; + } + public static final class string { + public static final int action_settings=0x7f06001b; + public static final int app_name=0x7f06001a; + /** Title for notification shown when GooglePlayServices needs to be + enabled for a application to work. [CHAR LIMIT=70] + */ + public static final int auth_client_needs_enabling_title=0x7f060015; + /** Title for notification shown when GooglePlayServices needs to be + installed for a application to work. [CHAR LIMIT=70] + */ + public static final int auth_client_needs_installation_title=0x7f060016; + /** Title for notification shown when GooglePlayServices needs to be + udpated for a application to work. [CHAR LIMIT=70] + */ + public static final int auth_client_needs_update_title=0x7f060017; + /** Title for notification shown when GooglePlayServices is unavailable [CHAR LIMIT=42] + */ + public static final int auth_client_play_services_err_notification_msg=0x7f060018; + /** Requested by string saying which app requested the notification. [CHAR LIMIT=42] + */ + public static final int auth_client_requested_by_msg=0x7f060019; + /** Title for notification shown when a bad version of GooglePlayServices + has been installed and needs correction for an application to work. + [CHAR LIMIT=70] + */ + public static final int auth_client_using_bad_version_title=0x7f060014; + /** Button in confirmation dialog to enable Google Play services. Clicking it + will direct user to application settings of Google Play services where they + can enable it [CHAR LIMIT=40] + */ + public static final int common_google_play_services_enable_button=0x7f060006; + /** Message in confirmation dialog informing user they need to enable + Google Play services in application settings [CHAR LIMIT=NONE] + */ + public static final int common_google_play_services_enable_text=0x7f060005; + /** Title of confirmation dialog informing user they need to enable + Google Play services in application settings [CHAR LIMIT=40] + */ + public static final int common_google_play_services_enable_title=0x7f060004; + /** Button in confirmation dialog for installing Google Play services [CHAR LIMIT=40] + */ + public static final int common_google_play_services_install_button=0x7f060003; + /** (For phones) Message in confirmation dialog informing user that + they need to install Google Play services (from Play Store) [CHAR LIMIT=NONE] + */ + public static final int common_google_play_services_install_text_phone=0x7f060001; + /** (For tablets) Message in confirmation dialog informing user that + they need to install Google Play services (from Play Store) [CHAR LIMIT=NONE] + */ + public static final int common_google_play_services_install_text_tablet=0x7f060002; + /** Title of confirmation dialog informing user that they need to install + Google Play services (from Play Store) [CHAR LIMIT=40] + */ + public static final int common_google_play_services_install_title=0x7f060000; + /** Message in confirmation dialog informing the user that they provided an invalid account. [CHAR LIMIT=NONE] + */ + public static final int common_google_play_services_invalid_account_text=0x7f06000c; + /** Title of confirmation dialog informing the user that they provided an invalid account. [CHAR LIMIT=40] + */ + public static final int common_google_play_services_invalid_account_title=0x7f06000b; + /** Message in confirmation dialog informing the user that a network error occurred. [CHAR LIMIT=NONE] + */ + public static final int common_google_play_services_network_error_text=0x7f06000a; + /** Title of confirmation dialog informing the user that a network error occurred. [CHAR LIMIT=40] + */ + public static final int common_google_play_services_network_error_title=0x7f060009; + /** Message in confirmation dialog informing user there is an unknown issue in Google Play + services [CHAR LIMIT=NONE] + */ + public static final int common_google_play_services_unknown_issue=0x7f06000d; + /** Message in confirmation dialog informing user that date on the device is not correct, + causing certificate checks to fail. [CHAR LIMIT=NONE] + */ + public static final int common_google_play_services_unsupported_date_text=0x7f060010; + /** Message in confirmation dialog informing user that Google Play services is not supported on their device [CHAR LIMIT=NONE] + */ + public static final int common_google_play_services_unsupported_text=0x7f06000f; + /** Title of confirmation dialog informing user that Google Play services is not supported on their device [CHAR LIMIT=40] + */ + public static final int common_google_play_services_unsupported_title=0x7f06000e; + /** Button in confirmation dialog for updating Google Play services [CHAR LIMIT=40] + */ + public static final int common_google_play_services_update_button=0x7f060011; + /** Message in confirmation dialog informing user that they need to update + Google Play services (from Play Store) [CHAR LIMIT=NONE] + */ + public static final int common_google_play_services_update_text=0x7f060008; + /** Title of confirmation dialog informing user that they need to update + Google Play services (from Play Store) [CHAR LIMIT=40] + */ + public static final int common_google_play_services_update_title=0x7f060007; + /** Sign-in button text [CHAR LIMIT=15] + */ + public static final int common_signin_button_text=0x7f060012; + /** Long form sign-in button text [CHAR LIMIT=30] + */ + public static final int common_signin_button_text_long=0x7f060013; + public static final int hello_world=0x7f06001c; + } + 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=0x7f090000; + /** Application theme. + All customizations that are NOT specific to a particular API-level can go here. + */ + public static final int AppTheme=0x7f090001; + } + public static final class styleable { + /** Attributes that can be used with a AdsAttrs. +

Includes the following attributes:

+ + + + + + + +
AttributeDescription
{@link #AdsAttrs_adSize mangavalk.tetris:adSize} + The size of the ad.
{@link #AdsAttrs_adSizes mangavalk.tetris:adSizes} + A comma-separated list of the supported ad sizes.
{@link #AdsAttrs_adUnitId mangavalk.tetris:adUnitId} The ad unit ID.
+ @see #AdsAttrs_adSize + @see #AdsAttrs_adSizes + @see #AdsAttrs_adUnitId + */ + public static final int[] AdsAttrs = { + 0x7f010000, 0x7f010001, 0x7f010002 + }; + /** +

+ @attr description + + The size of the ad. It must be one of BANNER, FULL_BANNER, LEADERBOARD, + MEDIUM_RECTANGLE, SMART_BANNER, WIDE_SKYSCRAPER, or + <width>x<height>. + + + +

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name mangavalk.tetris:adSize + */ + public static final int AdsAttrs_adSize = 0; + /** +

+ @attr description + + A comma-separated list of the supported ad sizes. The sizes must be one of + BANNER, FULL_BANNER, LEADERBOARD, MEDIUM_RECTANGLE, SMART_BANNER, + WIDE_SKYSCRAPER, or <width>x<height>. + + + +

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name mangavalk.tetris:adSizes + */ + public static final int AdsAttrs_adSizes = 1; + /** +

+ @attr description + The ad unit ID. + + +

Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character. +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. +

This is a private symbol. + @attr name mangavalk.tetris:adUnitId + */ + public static final int AdsAttrs_adUnitId = 2; + /** Attributes that can be used with a MapAttrs. +

Includes the following attributes:

+ + + + + + + + + + + + + + + + + + +
AttributeDescription
{@link #MapAttrs_cameraBearing mangavalk.tetris:cameraBearing}
{@link #MapAttrs_cameraTargetLat mangavalk.tetris:cameraTargetLat}
{@link #MapAttrs_cameraTargetLng mangavalk.tetris:cameraTargetLng}
{@link #MapAttrs_cameraTilt mangavalk.tetris:cameraTilt}
{@link #MapAttrs_cameraZoom mangavalk.tetris:cameraZoom}
{@link #MapAttrs_mapType mangavalk.tetris:mapType}
{@link #MapAttrs_uiCompass mangavalk.tetris:uiCompass}
{@link #MapAttrs_uiRotateGestures mangavalk.tetris:uiRotateGestures}
{@link #MapAttrs_uiScrollGestures mangavalk.tetris:uiScrollGestures}
{@link #MapAttrs_uiTiltGestures mangavalk.tetris:uiTiltGestures}
{@link #MapAttrs_uiZoomControls mangavalk.tetris:uiZoomControls}
{@link #MapAttrs_uiZoomGestures mangavalk.tetris:uiZoomGestures}
{@link #MapAttrs_useViewLifecycle mangavalk.tetris:useViewLifecycle}
{@link #MapAttrs_zOrderOnTop mangavalk.tetris:zOrderOnTop}
+ @see #MapAttrs_cameraBearing + @see #MapAttrs_cameraTargetLat + @see #MapAttrs_cameraTargetLng + @see #MapAttrs_cameraTilt + @see #MapAttrs_cameraZoom + @see #MapAttrs_mapType + @see #MapAttrs_uiCompass + @see #MapAttrs_uiRotateGestures + @see #MapAttrs_uiScrollGestures + @see #MapAttrs_uiTiltGestures + @see #MapAttrs_uiZoomControls + @see #MapAttrs_uiZoomGestures + @see #MapAttrs_useViewLifecycle + @see #MapAttrs_zOrderOnTop + */ + public static final int[] MapAttrs = { + 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, + 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, + 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, + 0x7f01000f, 0x7f010010 + }; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#cameraBearing} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a floating point value, such as "1.2". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:cameraBearing + */ + public static final int MapAttrs_cameraBearing = 1; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#cameraTargetLat} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a floating point value, such as "1.2". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:cameraTargetLat + */ + public static final int MapAttrs_cameraTargetLat = 2; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#cameraTargetLng} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a floating point value, such as "1.2". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:cameraTargetLng + */ + public static final int MapAttrs_cameraTargetLng = 3; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#cameraTilt} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a floating point value, such as "1.2". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:cameraTilt + */ + public static final int MapAttrs_cameraTilt = 4; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#cameraZoom} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a floating point value, such as "1.2". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:cameraZoom + */ + public static final int MapAttrs_cameraZoom = 5; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#mapType} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be one of the following constant values.

+ ++++ + + + + + +
ConstantValueDescription
none0
normal1
satellite2
terrain3
hybrid4
+ @attr name mangavalk.tetris:mapType + */ + public static final int MapAttrs_mapType = 0; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#uiCompass} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:uiCompass + */ + public static final int MapAttrs_uiCompass = 6; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#uiRotateGestures} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:uiRotateGestures + */ + public static final int MapAttrs_uiRotateGestures = 7; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#uiScrollGestures} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:uiScrollGestures + */ + public static final int MapAttrs_uiScrollGestures = 8; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#uiTiltGestures} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:uiTiltGestures + */ + public static final int MapAttrs_uiTiltGestures = 9; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#uiZoomControls} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:uiZoomControls + */ + public static final int MapAttrs_uiZoomControls = 10; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#uiZoomGestures} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:uiZoomGestures + */ + public static final int MapAttrs_uiZoomGestures = 11; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#useViewLifecycle} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:useViewLifecycle + */ + public static final int MapAttrs_useViewLifecycle = 12; + /** +

This symbol is the offset where the {@link mangavalk.tetris.R.attr#zOrderOnTop} + attribute's value can be found in the {@link #MapAttrs} array. + + +

Must be a boolean value, either "true" or "false". +

This may also be a reference to a resource (in the form +"@[package:]type:name") or +theme attribute (in the form +"?[package:][type:]name") +containing a value of this type. + @attr name mangavalk.tetris:zOrderOnTop + */ + public static final int MapAttrs_zOrderOnTop = 13; + }; +} diff --git a/ic_launcher-web.png b/ic_launcher-web.png new file mode 100644 index 0000000..485e62b Binary files /dev/null and b/ic_launcher-web.png differ diff --git a/libs/android-support-v4.jar b/libs/android-support-v4.jar new file mode 100644 index 0000000..96644ed 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..3a09501 --- /dev/null +++ b/project.properties @@ -0,0 +1,15 @@ +# 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-19 +android.library.reference.1=../../../../Desktop/adt-bundle-windows-x86_64-20131030/adt-bundle-windows-x86_64-20131030/sdk/extras/google/google_play_services/libproject/google-play-services_lib diff --git a/res/drawable-hdpi/f0.gif b/res/drawable-hdpi/f0.gif new file mode 100644 index 0000000..cd99b31 Binary files /dev/null and b/res/drawable-hdpi/f0.gif differ diff --git a/res/drawable-hdpi/f1.jpg b/res/drawable-hdpi/f1.jpg new file mode 100644 index 0000000..f259a3c Binary files /dev/null and b/res/drawable-hdpi/f1.jpg differ diff --git a/res/drawable-hdpi/f2.jpg b/res/drawable-hdpi/f2.jpg new file mode 100644 index 0000000..bd07502 Binary files /dev/null and b/res/drawable-hdpi/f2.jpg differ diff --git a/res/drawable-hdpi/f3.gif b/res/drawable-hdpi/f3.gif new file mode 100644 index 0000000..4c67b86 Binary files /dev/null and b/res/drawable-hdpi/f3.gif differ diff --git a/res/drawable-hdpi/f4.jpg b/res/drawable-hdpi/f4.jpg new file mode 100644 index 0000000..d2a59a9 Binary files /dev/null and b/res/drawable-hdpi/f4.jpg differ diff --git a/res/drawable-hdpi/f5.jpg b/res/drawable-hdpi/f5.jpg new file mode 100644 index 0000000..cb7f0bc Binary files /dev/null and b/res/drawable-hdpi/f5.jpg differ diff --git a/res/drawable-hdpi/f6.gif b/res/drawable-hdpi/f6.gif new file mode 100644 index 0000000..79d86e4 Binary files /dev/null and b/res/drawable-hdpi/f6.gif differ diff --git a/res/drawable-hdpi/f7.jpg b/res/drawable-hdpi/f7.jpg new file mode 100644 index 0000000..98ec498 Binary files /dev/null and b/res/drawable-hdpi/f7.jpg differ diff --git a/res/drawable-hdpi/f8.jpg b/res/drawable-hdpi/f8.jpg new file mode 100644 index 0000000..3ffab84 Binary files /dev/null and b/res/drawable-hdpi/f8.jpg differ diff --git a/res/drawable-hdpi/f9.gif b/res/drawable-hdpi/f9.gif new file mode 100644 index 0000000..b8665d3 Binary files /dev/null and b/res/drawable-hdpi/f9.gif differ diff --git a/res/drawable-hdpi/ic_launcher.png b/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..d9d1fca Binary files /dev/null and b/res/drawable-hdpi/ic_launcher.png differ diff --git a/res/drawable-hdpi/sprite_b.gif b/res/drawable-hdpi/sprite_b.gif new file mode 100644 index 0000000..1b686f1 Binary files /dev/null and b/res/drawable-hdpi/sprite_b.gif differ diff --git a/res/drawable-hdpi/sprite_blockline.jpg b/res/drawable-hdpi/sprite_blockline.jpg new file mode 100644 index 0000000..437addc Binary files /dev/null and b/res/drawable-hdpi/sprite_blockline.jpg differ diff --git a/res/drawable-hdpi/sprite_controler.jpg b/res/drawable-hdpi/sprite_controler.jpg new file mode 100644 index 0000000..c54c520 Binary files /dev/null and b/res/drawable-hdpi/sprite_controler.jpg differ diff --git a/res/drawable-hdpi/sprite_freeversion.jpg b/res/drawable-hdpi/sprite_freeversion.jpg new file mode 100644 index 0000000..4740662 Binary files /dev/null and b/res/drawable-hdpi/sprite_freeversion.jpg differ diff --git a/res/drawable-hdpi/sprite_gameover.jpg b/res/drawable-hdpi/sprite_gameover.jpg new file mode 100644 index 0000000..fac91db Binary files /dev/null and b/res/drawable-hdpi/sprite_gameover.jpg differ diff --git a/res/drawable-hdpi/sprite_i1.gif b/res/drawable-hdpi/sprite_i1.gif new file mode 100644 index 0000000..08f114e Binary files /dev/null and b/res/drawable-hdpi/sprite_i1.gif differ diff --git a/res/drawable-hdpi/sprite_i1r.gif b/res/drawable-hdpi/sprite_i1r.gif new file mode 100644 index 0000000..01f1adf Binary files /dev/null and b/res/drawable-hdpi/sprite_i1r.gif differ diff --git a/res/drawable-hdpi/sprite_i2.gif b/res/drawable-hdpi/sprite_i2.gif new file mode 100644 index 0000000..c25e2ce Binary files /dev/null and b/res/drawable-hdpi/sprite_i2.gif differ diff --git a/res/drawable-hdpi/sprite_i2r.gif b/res/drawable-hdpi/sprite_i2r.gif new file mode 100644 index 0000000..19c4e10 Binary files /dev/null and b/res/drawable-hdpi/sprite_i2r.gif differ diff --git a/res/drawable-hdpi/sprite_i3.gif b/res/drawable-hdpi/sprite_i3.gif new file mode 100644 index 0000000..ab650e2 Binary files /dev/null and b/res/drawable-hdpi/sprite_i3.gif differ diff --git a/res/drawable-hdpi/sprite_i3r.gif b/res/drawable-hdpi/sprite_i3r.gif new file mode 100644 index 0000000..b9ef2e8 Binary files /dev/null and b/res/drawable-hdpi/sprite_i3r.gif differ diff --git a/res/drawable-hdpi/sprite_i4.gif b/res/drawable-hdpi/sprite_i4.gif new file mode 100644 index 0000000..a838569 Binary files /dev/null and b/res/drawable-hdpi/sprite_i4.gif differ diff --git a/res/drawable-hdpi/sprite_i4r.gif b/res/drawable-hdpi/sprite_i4r.gif new file mode 100644 index 0000000..db6fc51 Binary files /dev/null and b/res/drawable-hdpi/sprite_i4r.gif differ diff --git a/res/drawable-hdpi/sprite_l1.gif b/res/drawable-hdpi/sprite_l1.gif new file mode 100644 index 0000000..f00f72a Binary files /dev/null and b/res/drawable-hdpi/sprite_l1.gif differ diff --git a/res/drawable-hdpi/sprite_l2.gif b/res/drawable-hdpi/sprite_l2.gif new file mode 100644 index 0000000..b1d03b3 Binary files /dev/null and b/res/drawable-hdpi/sprite_l2.gif differ diff --git a/res/drawable-hdpi/sprite_s.gif b/res/drawable-hdpi/sprite_s.gif new file mode 100644 index 0000000..d54b556 Binary files /dev/null and b/res/drawable-hdpi/sprite_s.gif differ diff --git a/res/drawable-hdpi/sprite_score.jpg b/res/drawable-hdpi/sprite_score.jpg new file mode 100644 index 0000000..f118d83 Binary files /dev/null and b/res/drawable-hdpi/sprite_score.jpg differ diff --git a/res/drawable-hdpi/sprite_t.gif b/res/drawable-hdpi/sprite_t.gif new file mode 100644 index 0000000..0c74959 Binary files /dev/null and b/res/drawable-hdpi/sprite_t.gif differ diff --git a/res/drawable-hdpi/sprite_z.gif b/res/drawable-hdpi/sprite_z.gif new file mode 100644 index 0000000..3e01fbe Binary files /dev/null and b/res/drawable-hdpi/sprite_z.gif differ diff --git a/res/drawable-mdpi/ic_launcher.png b/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..99dc372 Binary files /dev/null and b/res/drawable-mdpi/ic_launcher.png differ diff --git a/res/drawable-xhdpi/ic_launcher.png b/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000..22e0d4e Binary files /dev/null and b/res/drawable-xhdpi/ic_launcher.png differ diff --git a/res/drawable-xxhdpi/ic_launcher.png b/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..59cefe8 Binary files /dev/null and b/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/res/menu/main.xml b/res/menu/main.xml new file mode 100644 index 0000000..c002028 --- /dev/null +++ b/res/menu/main.xml @@ -0,0 +1,9 @@ +

+ + + + diff --git a/res/raw/tetris_a.mp3 b/res/raw/tetris_a.mp3 new file mode 100644 index 0000000..0f04f67 Binary files /dev/null and b/res/raw/tetris_a.mp3 differ diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml new file mode 100644 index 0000000..44f01db --- /dev/null +++ b/res/values-sw600dp/dimens.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/res/values-sw720dp-land/dimens.xml b/res/values-sw720dp-land/dimens.xml new file mode 100644 index 0000000..61e3fa8 --- /dev/null +++ b/res/values-sw720dp-land/dimens.xml @@ -0,0 +1,9 @@ + + + + 128dp + + 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/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..ccada8e --- /dev/null +++ b/res/values/strings.xml @@ -0,0 +1,8 @@ + + + + Tetris + Settings + Hello world! + + diff --git a/res/values/styles.xml b/res/values/styles.xml new file mode 100644 index 0000000..6ce89c7 --- /dev/null +++ b/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/src/mangavalk/tetris/CanvasView.java b/src/mangavalk/tetris/CanvasView.java new file mode 100644 index 0000000..8aff5f1 --- /dev/null +++ b/src/mangavalk/tetris/CanvasView.java @@ -0,0 +1,1871 @@ +package mangavalk.tetris; + +import android.app.Activity; +import android.content.Context; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.graphics.Paint.Style; +import android.media.MediaPlayer; +import android.os.Handler; +import android.util.DisplayMetrics; +import android.util.TypedValue; +import android.view.Display; +import android.view.View; + +import java.util.ArrayList; +import java.util.TimerTask; + +public class CanvasView extends View +{ + //region variabelen + Resources r; + + // Sizes + float dpHeight; + float dpWidth; + + float Height; + float Width; + + // Block Array + int[][] blockArray = new int[][]{ + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + }; + + // Draw Array + int[][] drawArray = new int[][]{ + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + }; + + int[][][][] drawBlocks = new int[][][][]{ + { + { + {0, 0, 0, 0}, + {8, 9, 10, 11}, + {0, 0, 0, 0}, + {0, 0, 0, 0} + }, + { + {0, 0, 12, 0}, + {0, 0, 13, 0}, + {0, 0, 14, 0}, + {0, 0, 15, 0} + }, + { + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {8, 9, 10, 11}, + {0, 0, 0, 0} + }, + { + {0, 12, 0, 0}, + {0, 13, 0, 0}, + {0, 14, 0, 0}, + {0, 15, 0, 0} + } + }, + { + { + {7, 0, 0, 0}, + {7, 7, 7, 0}, + {0, 0, 0, 0}, + {0, 0, 0, -1} + }, + { + {0, 7, 7, 0}, + {0, 7, 0, 0}, + {0, 7, 0, 0}, + {0, 0, 0, -1} + }, + { + {0, 0, 0, 0}, + {7, 7, 7, 0}, + {0, 0, 7, 0}, + {0, 0, 0, -1} + }, + { + {0, 7, 0, 0}, + {0, 7, 0, 0}, + {7, 7, 0, 0}, + {0, 0, 0, -1} + } + }, + { + { + {0, 0, 6, 0}, + {6, 6, 6, 0}, + {0, 0, 0, 0}, + {0, 0, 0, -1} + }, + { + {0, 6, 0, 0}, + {0, 6, 0, 0}, + {0, 6, 6, 0}, + {0, 0, 0, -1} + }, + { + {0, 0, 0, 0}, + {6, 6, 6, 0}, + {6, 0, 0, 0}, + {0, 0, 0, -1} + }, + { + {6, 6, 0, 0}, + {0, 6, 0, 0}, + {0, 6, 0, 0}, + {0, 0, 0, -1} + } + }, + { + { + {0, 1, 1, 0}, + {0, 1, 1, 0}, + {0, 0, 0, 0}, + {0, 0, 0, -1} + }, + { + {0, 1, 1, 0}, + {0, 1, 1, 0}, + {0, 0, 0, 0}, + {0, 0, 0, -1} + }, + { + {0, 1, 1, 0}, + {0, 1, 1, 0}, + {0, 0, 0, 0}, + {0, 0, 0, -1} + }, + { + {0, 1, 1, 0}, + {0, 1, 1, 0}, + {0, 0, 0, 0}, + {0, 0, 0, -1} + } + }, + { + { + {0, 3, 3, 0}, + {3, 3, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, -1} + }, + { + {0, 3, 0, 0}, + {0, 3, 3, 0}, + {0, 0, 3, 0}, + {0, 0, 0, -1} + }, + { + {0, 0, 0, 0}, + {0, 3, 3, 0}, + {3, 3, 0, 0}, + {0, 0, 0, -1} + }, + { + {3, 0, 0, 0}, + {3, 3, 0, 0}, + {0, 3, 0, 0}, + {0, 0, 0, -1} + } + }, + { + { + {0, 2, 0, 0}, + {2, 2, 2, 0}, + {0, 0, 0, 0}, + {0, 0, 0, -1} + }, + { + {0, 2, 0, 0}, + {0, 2, 2, 0}, + {0, 2, 0, 0}, + {0, 0, 0, -1} + }, + { + {0, 0, 0, 0}, + {2, 2, 2, 0}, + {0, 2, 0, 0}, + {0, 0, 0, -1} + }, + { + {0, 2, 0, 0}, + {2, 2, 0, 0}, + {0, 2, 0, 0}, + {0, 0, 0, -1} + } + }, + { + { + {5, 5, 0, 0}, + {0, 5, 5, 0}, + {0, 0, 0, 0}, + {0, 0, 0, -1} + }, + { + {0, 0, 5, 0}, + {0, 5, 5, 0}, + {0, 5, 0, 0}, + {0, 0, 0, -1} + }, + { + {0, 0, 0, 0}, + {5, 5, 0, 0}, + {0, 5, 5, 0}, + {0, 0, 0, -1} + }, + { + {0, 5, 0, 0}, + {5, 5, 0, 0}, + {5, 0, 0, 0}, + {0, 0, 0, -1} + } + } + }; + + int[] LevelSpeed = { 53, 49, 45, 41, 37, 33, 28, 22, 17, 11, 10, 9, 8, 7, 6, 6, 5, 5, 4, 4, 3}; + + int GameSpaceLeft = 4; + int GameSpaceTop = 0; + int GameSpaceRight = 53; + int GameSpaceBottom = 115;//125 + + int CurrentBlock = 0; + int CurrentBlockPossition = 0; + + int NewBlock = 0; + int NewBlockPossition = 0; + + boolean goingDown = false; + boolean NextWillLock = false; + + Bitmap bitmapl1, bitmapl2, bitmapt, bitmapb, bitmaps, bitmapz, bitmapi1, bitmapi2, bitmapi3, bitmapi4, + bitmapi1r, bitmapi2r, bitmapi3r, bitmapi4r, bitmapblockline, bitmapscore, bitmapcontroller, bitmapgameover; + + Bitmap Font0, Font1, Font2, Font3, Font4, Font5, Font6, Font7, Font8, Font9; + + + public int startLevel = 0; + int level = 0; + + int lines = 0; + int score = 0; + + boolean GamePlaying = false; + boolean GameOver = false; + public boolean PayedVersion; + + TimerTask MoveEvent = new TimerTask() { + @Override + public void run() { + GoDown(); + } + }; + + private Handler handler = new Handler(); + private Runnable runnable = new Runnable() { + @Override + public void run() { + level = ( (startLevel + lines)<=200 ? startLevel + (lines / 10) : 20 ); + int newSpeed = (int)((1000 / 59.73) * LevelSpeed[level]); + handler.postDelayed(this, newSpeed); + GoDown(); + } + }; + + /*private Runnable TimeoutDown = new Runnable() { + @Override + public void run() { + NextWillLock = true; + GoDown(); + } + };*/ + + MediaPlayer mp; + + //endregion variabelen + + /// Init functions + + public CanvasView(Context context) + { + super(context); + + super.setBackgroundColor(Color.BLACK); + + SpawnBlock(); + + this.postInvalidate(); + } + + public void SetActivity(Activity activity) + { + Display display = activity.getWindowManager().getDefaultDisplay(); + DisplayMetrics outMetrics = new DisplayMetrics (); + display.getMetrics(outMetrics); + + r = getResources(); + + float density = getResources().getDisplayMetrics().density; + + dpHeight = outMetrics.heightPixels / density; + dpWidth = outMetrics.widthPixels / density; + + Height = outMetrics.heightPixels; + Width = outMetrics.widthPixels; + + // Sprites + + bitmapl1 = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_l1); + + bitmapl1 = Bitmap.createScaledBitmap(bitmapl1, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmapl2 = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_l2); + + bitmapl2 = Bitmap.createScaledBitmap(bitmapl2, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmapt = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_t); + + bitmapt = Bitmap.createScaledBitmap(bitmapt, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmapb = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_b); + + bitmapb = Bitmap.createScaledBitmap(bitmapb, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmaps = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_s); + + bitmaps= Bitmap.createScaledBitmap(bitmaps, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmapz = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_z); + + bitmapz = Bitmap.createScaledBitmap(bitmapz, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmapi1 = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_i1); + + bitmapi1 = Bitmap.createScaledBitmap(bitmapi1, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmapi2 = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_i2); + + bitmapi2 = Bitmap.createScaledBitmap(bitmapi2, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmapi3 = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_i3); + + bitmapi3 = Bitmap.createScaledBitmap(bitmapi3, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmapi4 = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_i4); + + bitmapi4 = Bitmap.createScaledBitmap(bitmapi4, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmapi1r = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_i1r); + + bitmapi1r = Bitmap.createScaledBitmap(bitmapi1r, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmapi2r = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_i2r); + + bitmapi2r = Bitmap.createScaledBitmap(bitmapi2r, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmapi3r = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_i3r); + + bitmapi3r = Bitmap.createScaledBitmap(bitmapi3r, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + bitmapi4r = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_i4r); + + bitmapi4r = Bitmap.createScaledBitmap(bitmapi4r, + (int)GetRealPixelSize(DIP_W, dpWidth, 0.1f + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight))), + (int)GetRealPixelSize(DIP_H, dpHeight, 0.1f + (map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom))), false); + + + bitmapblockline = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_blockline); + + bitmapblockline = Bitmap.createScaledBitmap(bitmapblockline, + (int)GetRealPixelSize(DIP_W, dpWidth, 4), + (int)GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom-GameSpaceTop), false); + + if (PayedVersion) + { + bitmapscore = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_score); + } + else + { + bitmapscore = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_freeversion); + } + + bitmapscore = Bitmap.createScaledBitmap(bitmapscore, + (int)GetRealPixelSize(DIP_W, dpWidth, 90-GameSpaceRight-4), + (int)GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom-GameSpaceTop), false); + + bitmapcontroller = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_controler); + + bitmapcontroller = Bitmap.createScaledBitmap(bitmapcontroller, + (int)GetRealPixelSize(DIP_W, dpWidth, 90), + (int)GetRealPixelSize(DIP_H, dpHeight, (160 - GameSpaceBottom)), false); + + bitmapgameover = BitmapFactory.decodeResource(getResources(), + R.drawable.sprite_gameover); + + bitmapgameover = Bitmap.createScaledBitmap(bitmapgameover, + (int)GetRealPixelSize(DIP_W, dpWidth, (GameSpaceRight - GameSpaceLeft)), + (int)GetRealPixelSize(DIP_H, dpHeight, (GameSpaceBottom - GameSpaceTop)), false); + + Font0 = BitmapFactory.decodeResource(getResources(), + R.drawable.f0); + + Font0 = Bitmap.createScaledBitmap(Font0, + (int)GetRealPixelSize(DIP_W, dpWidth, 5), + (int)GetRealPixelSize(DIP_H, dpHeight, 6), false); + + Font1 = BitmapFactory.decodeResource(getResources(), + R.drawable.f1); + + Font1 = Bitmap.createScaledBitmap(Font1, + (int)GetRealPixelSize(DIP_W, dpWidth, 5), + (int)GetRealPixelSize(DIP_H, dpHeight, 6), false); + + Font2 = BitmapFactory.decodeResource(getResources(), + R.drawable.f2); + + Font2 = Bitmap.createScaledBitmap(Font2, + (int)GetRealPixelSize(DIP_W, dpWidth, 5), + (int)GetRealPixelSize(DIP_H, dpHeight, 6), false); + + Font3 = BitmapFactory.decodeResource(getResources(), + R.drawable.f3); + + Font3 = Bitmap.createScaledBitmap(Font3, + (int)GetRealPixelSize(DIP_W, dpWidth, 5), + (int)GetRealPixelSize(DIP_H, dpHeight, 6), false); + + Font4 = BitmapFactory.decodeResource(getResources(), + R.drawable.f4); + + Font4 = Bitmap.createScaledBitmap(Font4, + (int)GetRealPixelSize(DIP_W, dpWidth, 5), + (int)GetRealPixelSize(DIP_H, dpHeight, 6), false); + + Font5 = BitmapFactory.decodeResource(getResources(), + R.drawable.f5); + + Font5 = Bitmap.createScaledBitmap(Font5, + (int)GetRealPixelSize(DIP_W, dpWidth, 5), + (int)GetRealPixelSize(DIP_H, dpHeight, 6), false); + + Font6 = BitmapFactory.decodeResource(getResources(), + R.drawable.f6); + + Font6 = Bitmap.createScaledBitmap(Font6, + (int)GetRealPixelSize(DIP_W, dpWidth, 5), + (int)GetRealPixelSize(DIP_H, dpHeight, 6), false); + + Font7 = BitmapFactory.decodeResource(getResources(), + R.drawable.f7); + + Font7 = Bitmap.createScaledBitmap(Font7, + (int)GetRealPixelSize(DIP_W, dpWidth, 5), + (int)GetRealPixelSize(DIP_H, dpHeight, 6), false); + + Font8 = BitmapFactory.decodeResource(getResources(), + R.drawable.f8); + + Font8 = Bitmap.createScaledBitmap(Font8, + (int)GetRealPixelSize(DIP_W, dpWidth, 5), + (int)GetRealPixelSize(DIP_H, dpHeight, 6), false); + + Font9 = BitmapFactory.decodeResource(getResources(), + R.drawable.f9); + + Font9 = Bitmap.createScaledBitmap(Font9, + (int)GetRealPixelSize(DIP_W, dpWidth, 5), + (int)GetRealPixelSize(DIP_H, dpHeight, 6), false); + + + NewBlock = (int)(Math.random() * (7)); + + NewBlock = Tetrimino.get(0); + Tetrimino.remove(0); + NewBlockPossition = 0; + + // Audio + mp = MediaPlayer.create(activity, R.raw.tetris_a); + mp.setLooping(true); + mp.start(); + + GamePlaying = true; + + handler.removeCallbacksAndMessages(null); + handler.postDelayed(runnable, 100); + } + + /// Draw functions + + @Override + protected void onDraw(Canvas canvas) + { + DrawGameSpace(canvas); + } + + public void onPause() + { + mp.pause(); + GamePlaying = false; + } + + public void onResume() + { + /*mp.start(); + GamePlaying = true;*/ + } + + // 10 squares width + // 18 heigh + + private void DrawGameSpace(Canvas canvas) + { + // Background + //Rect(canvas, GameSpaceTop, GameSpaceBottom, GameSpaceLeft, GameSpaceRight, Color.GRAY); + + // Sides + canvas.drawBitmap(bitmapblockline, GetRealPixelSize(DIP_W, dpWidth, 0), GetRealPixelSize(DIP_H, dpHeight, GameSpaceTop), null); + canvas.drawBitmap(bitmapblockline, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight), GetRealPixelSize(DIP_H, dpHeight, GameSpaceTop), null); + + canvas.drawBitmap(bitmapcontroller, GetRealPixelSize(DIP_W, dpWidth, 0), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom), null); + + // Score + canvas.drawBitmap(bitmapscore, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4), GetRealPixelSize(DIP_H, dpHeight, GameSpaceTop), null); + + if (PayedVersion) + { + DrawLines(canvas, lines); + DrawLevel(canvas, startLevel + level); + DrawScore(canvas, score); + + int top = 32; + + for (int x=0; x<4; x++) + { + for (int y=0; y<4; y++) + { + switch(drawBlocks[NewBlock][NewBlockPossition][y][x]) + { + case 1: + canvas.drawBitmap(bitmapb, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 2: + canvas.drawBitmap(bitmapt, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 3: + canvas.drawBitmap(bitmapz, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 5: + canvas.drawBitmap(bitmaps, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 6: + canvas.drawBitmap(bitmapl2, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 7: + canvas.drawBitmap(bitmapl1, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 8: + canvas.drawBitmap(bitmapi1, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 9: + canvas.drawBitmap(bitmapi2, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 10: + canvas.drawBitmap(bitmapi3, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 11: + canvas.drawBitmap(bitmapi4, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 12: + canvas.drawBitmap(bitmapi1r, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 13: + canvas.drawBitmap(bitmapi2r, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 14: + canvas.drawBitmap(bitmapi3r, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + case 15: + canvas.drawBitmap(bitmapi4r, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 4, GameSpaceRight + 4 + 9, GameSpaceRight + 4 + 9 + (map(1, 0, 10, GameSpaceLeft, GameSpaceRight) - map(0, 0, 10, GameSpaceLeft, GameSpaceRight)) * 4)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 4, (GameSpaceBottom - top), (GameSpaceBottom - top) + ((map(1, 0, 18, GameSpaceTop, GameSpaceBottom) - map(0, 0, 18, GameSpaceTop, GameSpaceBottom)) * 4))), null); + break; + } + } + } + } + + for (int x=0; x<10; x++) + { + for (int y=0; y<18; y++) + { + switch (drawArray[y][x] + (blockArray[y][x] >= 0 ? blockArray[y][x] : 0)) + { + case 0: + break; + case 1: + { + canvas.drawBitmap(bitmapb, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 2: + { + canvas.drawBitmap(bitmapt, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 3: + { + canvas.drawBitmap(bitmapz, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 5: + { + canvas.drawBitmap(bitmaps, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 6: + { + canvas.drawBitmap(bitmapl2, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 7: + { + canvas.drawBitmap(bitmapl1, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 8: + { + canvas.drawBitmap(bitmapi1, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 9: + { + canvas.drawBitmap(bitmapi2, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 10: + { + canvas.drawBitmap(bitmapi3, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 11: + { + canvas.drawBitmap(bitmapi4, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 12: // Rotated + { + canvas.drawBitmap(bitmapi1r, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 13: + { + canvas.drawBitmap(bitmapi2r, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 14: + { + canvas.drawBitmap(bitmapi3r, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + case 15: + { + canvas.drawBitmap(bitmapi4r, (int)GetRealPixelSize(DIP_W, dpWidth, map(x, 0, 10, GameSpaceLeft, GameSpaceRight)), + (int)GetRealPixelSize(DIP_H, dpHeight, map(y, 0, 18, GameSpaceTop, GameSpaceBottom)), null); + break; + } + default: + { + + Rect(canvas, map(y, 0, 18, GameSpaceTop, GameSpaceBottom), map(y+1, 0, 18, GameSpaceTop, GameSpaceBottom), + map(x, 0, 10, GameSpaceLeft, GameSpaceRight), map(x+1, 0, 10, GameSpaceLeft, GameSpaceRight), + Color.RED); + break; + } + } + } + } + + if (GameOver) + { + canvas.drawBitmap(bitmapgameover, (int)GetRealPixelSize(DIP_W, dpWidth, GameSpaceLeft), + (int)GetRealPixelSize(DIP_H, dpHeight, GameSpaceTop), null); + } + + /* + Rect(canvas, 122, 133, 1, 11, Color.BLUE); // Left + Rect(canvas, 122, 133, 21, 33, Color.BLUE); // Right + + Rect(canvas, 122, 137, 55, 70, Color.BLUE); // Rotate Left + Rect(canvas, 115, 137, 74, 88, Color.BLUE); // Rotate Right + + Rect(canvas, 143, 155, 28, 55, Color.BLUE); // Menu + + Rect(canvas, 133, 144, 11, 21, Color.BLUE); // Down + */ + } + + private void DrawScore(Canvas canvas, int Score) + { + int height = 104-8; + switch ((Score / 100000) % 10) + { + case 0: + canvas.drawBitmap(Font0, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6-5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 1: + canvas.drawBitmap(Font1, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6-5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 2: + canvas.drawBitmap(Font2, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6-5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 3: + canvas.drawBitmap(Font3, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6-5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 4: + canvas.drawBitmap(Font4, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6-5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 5: + canvas.drawBitmap(Font5, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6-5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 6: + canvas.drawBitmap(Font6, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6-5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 7: + canvas.drawBitmap(Font7, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6-5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 8: + canvas.drawBitmap(Font8, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6-5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 9: + canvas.drawBitmap(Font9, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6-5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + } + switch ((Score / 10000) % 10) + { + case 0: + canvas.drawBitmap(Font0, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 1: + canvas.drawBitmap(Font1, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 2: + canvas.drawBitmap(Font2, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 3: + canvas.drawBitmap(Font3, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 4: + canvas.drawBitmap(Font4, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 5: + canvas.drawBitmap(Font5, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 6: + canvas.drawBitmap(Font6, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 7: + canvas.drawBitmap(Font7, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 8: + canvas.drawBitmap(Font8, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 9: + canvas.drawBitmap(Font9, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + } + switch ((Score / 1000) % 10) + { + case 0: + canvas.drawBitmap(Font0, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 1: + canvas.drawBitmap(Font1, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 2: + canvas.drawBitmap(Font2, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 3: + canvas.drawBitmap(Font3, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 4: + canvas.drawBitmap(Font4, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 5: + canvas.drawBitmap(Font5, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 6: + canvas.drawBitmap(Font6, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 7: + canvas.drawBitmap(Font7, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 8: + canvas.drawBitmap(Font8, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 9: + canvas.drawBitmap(Font9, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + } + switch ((Score / 100) % 10) + { + case 0: + canvas.drawBitmap(Font0, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 1: + canvas.drawBitmap(Font1, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 2: + canvas.drawBitmap(Font2, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 3: + canvas.drawBitmap(Font3, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 4: + canvas.drawBitmap(Font4, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 5: + canvas.drawBitmap(Font5, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 6: + canvas.drawBitmap(Font6, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 7: + canvas.drawBitmap(Font7, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 8: + canvas.drawBitmap(Font8, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 9: + canvas.drawBitmap(Font9, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + } + switch ((Score / 10) % 10) + { + case 0: + canvas.drawBitmap(Font0, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 1: + canvas.drawBitmap(Font1, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 2: + canvas.drawBitmap(Font2, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 3: + canvas.drawBitmap(Font3, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 4: + canvas.drawBitmap(Font4, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 5: + canvas.drawBitmap(Font5, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 6: + canvas.drawBitmap(Font6, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 7: + canvas.drawBitmap(Font7, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 8: + canvas.drawBitmap(Font8, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 9: + canvas.drawBitmap(Font9, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + } + switch (Score % 10) + { + case 0: + canvas.drawBitmap(Font0, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 1: + canvas.drawBitmap(Font1, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 2: + canvas.drawBitmap(Font2, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 3: + canvas.drawBitmap(Font3, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 4: + canvas.drawBitmap(Font4, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 5: + canvas.drawBitmap(Font5, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 6: + canvas.drawBitmap(Font6, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 7: + canvas.drawBitmap(Font7, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 8: + canvas.drawBitmap(Font8, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 9: + canvas.drawBitmap(Font9, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + } + } + + private void DrawLines(Canvas canvas, int Lines) + { + int height = 55-4; + switch ((Lines / 1000) % 10) + { + case 0: + canvas.drawBitmap(Font0, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 1: + canvas.drawBitmap(Font1, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 2: + canvas.drawBitmap(Font2, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 3: + canvas.drawBitmap(Font3, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 4: + canvas.drawBitmap(Font4, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 5: + canvas.drawBitmap(Font5, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 6: + canvas.drawBitmap(Font6, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 7: + canvas.drawBitmap(Font7, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 8: + canvas.drawBitmap(Font8, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 9: + canvas.drawBitmap(Font9, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + } + switch ((Lines / 100) % 10) + { + case 0: + canvas.drawBitmap(Font0, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 1: + canvas.drawBitmap(Font1, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 2: + canvas.drawBitmap(Font2, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 3: + canvas.drawBitmap(Font3, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 4: + canvas.drawBitmap(Font4, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 5: + canvas.drawBitmap(Font5, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 6: + canvas.drawBitmap(Font6, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 7: + canvas.drawBitmap(Font7, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 8: + canvas.drawBitmap(Font8, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 9: + canvas.drawBitmap(Font9, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + } + switch ((Lines / 10) % 10) + { + case 0: + canvas.drawBitmap(Font0, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 1: + canvas.drawBitmap(Font1, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 2: + canvas.drawBitmap(Font2, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 3: + canvas.drawBitmap(Font3, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 4: + canvas.drawBitmap(Font4, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 5: + canvas.drawBitmap(Font5, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 6: + canvas.drawBitmap(Font6, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 7: + canvas.drawBitmap(Font7, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 8: + canvas.drawBitmap(Font8, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 9: + canvas.drawBitmap(Font9, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + } + switch (Lines % 10) + { + case 0: + canvas.drawBitmap(Font0, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 1: + canvas.drawBitmap(Font1, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 2: + canvas.drawBitmap(Font2, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 3: + canvas.drawBitmap(Font3, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 4: + canvas.drawBitmap(Font4, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 5: + canvas.drawBitmap(Font5, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 6: + canvas.drawBitmap(Font6, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 7: + canvas.drawBitmap(Font7, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 8: + canvas.drawBitmap(Font8, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 9: + canvas.drawBitmap(Font9, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + } + } + + private void DrawLevel(Canvas canvas, int Level) + { + int height = 76-6; + switch ((Level / 10) % 10) + { + case 0: + canvas.drawBitmap(Font0, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 1: + canvas.drawBitmap(Font1, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 2: + canvas.drawBitmap(Font2, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 3: + canvas.drawBitmap(Font3, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 4: + canvas.drawBitmap(Font4, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 5: + canvas.drawBitmap(Font5, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 6: + canvas.drawBitmap(Font6, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 7: + canvas.drawBitmap(Font7, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 8: + canvas.drawBitmap(Font8, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 9: + canvas.drawBitmap(Font9, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + } + switch (Level % 10) + { + case 0: + canvas.drawBitmap(Font0, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 1: + canvas.drawBitmap(Font1, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 2: + canvas.drawBitmap(Font2, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 3: + canvas.drawBitmap(Font3, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 4: + canvas.drawBitmap(Font4, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 5: + canvas.drawBitmap(Font5, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 6: + canvas.drawBitmap(Font6, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 7: + canvas.drawBitmap(Font7, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 8: + canvas.drawBitmap(Font8, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + case 9: + canvas.drawBitmap(Font9, GetRealPixelSize(DIP_W, dpWidth, GameSpaceRight+4+6+5+5+5), GetRealPixelSize(DIP_H, dpHeight, GameSpaceBottom - height), null); + break; + } + } + + int OldInputTime=0; + + /// Input + public void sendMove(float x, float y, boolean Released) + { + int moveX = (int)((x / Width) * 90); + int moveY = (int)((y / Height) * 160); + + if (!Released) + { + if (!GameOver) + { + if (moveX >= 28 && moveX <= 55 && moveY >= 143 && moveY <= 155) // Menu + { + //GamePlaying = !GamePlaying; + if (GamePlaying) + onPause(); + else + { + mp.start(); + GamePlaying = true; + } + } + } + } + + if (!goingDown) + { + // Infinite swing + /*if (NextWillLock) + { + handler.removeCallbacksAndMessages(null); + int newSpeed = (int)((1000 / 59.73) * LevelSpeed[_level]); + handler.postDelayed(runnable, newSpeed); + NextWillLock = false; + }*/ + + if (GamePlaying) + { + if (!GameOver) + { + if (!Released) + { + if (moveX >= 1 && moveX <= 11 && moveY >= 122 && moveY <= 133) // Left + { + if(CanBlockGoLeft()) + { + MoveBlockLeft(); + this.postInvalidate(); + } + } + else if (moveX >= 55 && moveX <= 70 && moveY >= 122 && moveY <= 137) // Rotate Left + { + RotateBlockLeft(); + this.postInvalidate(); + } + else if (moveX >= 74 && moveX <= 88 && moveY >= 115 && moveY <= 137) // Rotate Right + { + RotateBlockRight(); + this.postInvalidate(); + } + else if (moveX >= 21 && moveX <= 33 && moveY >= 122 && moveY <= 133) // Right + { + if(CanBlockGoRight()) + { + MoveBlockRight(); + this.postInvalidate(); + } + } + } + if (moveX >= 11 && moveX <= 21 && moveY >= 133 && moveY <= 144) // Down + { + if (!Released) + { + // Soft Drop + if (CanBlockGoDown()) + { + MoveBlockDown(); + this.postInvalidate(); + } + OldInputTime = (int)System.currentTimeMillis(); + } + else + { + int CurrentTime = (int)System.currentTimeMillis(); + if ((CurrentTime - OldInputTime) >= 250) + { + // Hard Drop + while (CanBlockGoDown()) + { + MoveBlockDown(); + } + this.postInvalidate(); + } + } + } + } + } + } + } + + /// Game Logic + private void GoDown() + { + if (GamePlaying) + { + if (!GameOver) + { + goingDown = true; + + /// Can the Block go down? + if (CanBlockGoDown()) + { + MoveBlockDown(); + this.postInvalidate(); + } + else + { + /*if (NextWillLock) + {*/ + /*int newSpeed = (int)((1000 / 59.73) * LevelSpeed[level]); + handler.postDelayed(runnable, newSpeed);*/ + + NextWillLock = false; + + ParseBlockArrayToDrawArray(); + + CheckForCompletedRows(); + + //spawn new block + if (!SpawnBlock()) + { + // GameOver + GameOver = true; + GamePlaying = false; + mp.stop(); + this.postInvalidate(); + } + else + { + this.postInvalidate(); + } + /*} + else + { + NextWillLock = true; + handler.removeCallbacksAndMessages(null); + handler.postDelayed(TimeoutDown, 3000); + }*/ + } + + goingDown = false; + } + } + } + + private boolean CanBlockGoDown() + { + //blockArray + for (int x=0; x<10; x++) + { + for (int y=0; y<18; y++) + { + if (blockArray[y][x] != 0) + { + if (y + 1 == 18) + return false; + else if (drawArray[y+1][x] != 0) + return false; + } + } + } + + return true; + } + + private boolean CanBlockGoLeft() + { + //blockArray + for (int y=0; y<18; y++) + { + for (int x=1; x<10; x++) + { + if (blockArray[y][x] >= 1) + { + if (drawArray[y][x-1] != 0) + return false; + } + if (blockArray[y][0] >= 1) + return false; + } + } + + return true; + } + + private boolean CanBlockGoRight() + { + //blockArray + for (int y=0; y<18; y++) + { + for (int x=0; x<9; x++) + { + if (blockArray[y][x] >= 1) + { + if (drawArray[y][x+1] != 0) + return false; + } + if (blockArray[y][9] >= 1) + return false; + } + } + + return true; + } + + private void MoveBlockDown() + { + for (int x=0; x<10; x++) + { + for (int y=17; y>0; y--) + { + /*if (blockArray[y-1][x] != 0) + {*/ + blockArray[y][x] = blockArray[y-1][x]; + blockArray[y-1][x] = 0; + //} + } + } + } + + private void MoveBlockLeft() + { + for (int y=0; y<18; y++) + { + for (int x=1; x<10; x++) + { + /*if (blockArray[y][x-1] == 0) + {*/ + blockArray[y][x-1] = blockArray[y][x]; + blockArray[y][x] = 0; + //} + } + } + } + + private void MoveBlockRight() + { + for (int y=0; y<18; y++) + { + for (int x=8; x>=0; x--) + { + /*if (blockArray[y][x-1] == 0) + {*/ + blockArray[y][x+1] = blockArray[y][x]; + blockArray[y][x] = 0; + //} + } + } + } + + private void RotateBlockRight() + { + if (drawBlocks[CurrentBlock][CurrentBlockPossition][3][3] != -1) + { + for (int y=0; y<18-3; y++) + { + for (int x=0; x<10-3; x++) + { + boolean foundPossition = true; + + for (int i=0; i<4; i++) + { + for (int i2=0; i2<4; i2++) + { + if (!(blockArray[y+i][x+i2] == drawBlocks[CurrentBlock][CurrentBlockPossition][i][i2])) + { + foundPossition = false; + } + } + } + + + if (foundPossition) + { + if (CurrentBlockPossition < 3) + CurrentBlockPossition++; + else + CurrentBlockPossition = 0; + } + + // Test for collision !!! + boolean Collision = false; + + for (int i=0; i<4; i++) + { + for (int i2=0; i2<4; i2++) + { + if (drawBlocks[CurrentBlock][CurrentBlockPossition][i][i2] >= 1) + { + if (drawArray[y+i][x+i2] != 0) + { + Collision = true; + } + } + } + } + + if (!Collision) + { + if (foundPossition) + { + for (int i=0; i<4; i++) + { + for (int i2=0; i2<4; i2++) + { + blockArray[y+i][x+i2] = drawBlocks[CurrentBlock][CurrentBlockPossition][i][i2]; + } + } + } + } + } + } + } + else + { + for (int y=0; y<18-2; y++) + { + for (int x=0; x<10-2; x++) + { + boolean foundPossition = true; + + for (int i=0; i<3; i++) + { + for (int i2=0; i2<3; i2++) + { + if (!(blockArray[y+i][x+i2] == drawBlocks[CurrentBlock][CurrentBlockPossition][i][i2])) + { + foundPossition = false; + } + } + } + + if (foundPossition) + { + if (CurrentBlockPossition < 3) + CurrentBlockPossition++; + else + CurrentBlockPossition = 0; + } + + // Test for collision !!! + boolean Collision = false; + + for (int i=0; i<3; i++) + { + for (int i2=0; i2<3; i2++) + { + if (drawBlocks[CurrentBlock][CurrentBlockPossition][i][i2] >= 1) + { + if (drawArray[y+i][x+i2] != 0) + { + Collision = true; + } + } + } + } + + if (!Collision) + { + if (foundPossition) + { + for (int i=0; i<3; i++) + { + for (int i2=0; i2<3; i2++) + { + blockArray[y+i][x+i2] = drawBlocks[CurrentBlock][CurrentBlockPossition][i][i2]; + } + } + } + } + } + } + } + } + + private void RotateBlockLeft() + { + if (drawBlocks[CurrentBlock][CurrentBlockPossition][3][3] != -1) + { + for (int y=0; y<18-3; y++) + { + for (int x=0; x<10-3; x++) + { + boolean foundPossition = true; + + for (int i=0; i<4; i++) + { + for (int i2=0; i2<4; i2++) + { + if (!(blockArray[y+i][x+i2] == drawBlocks[CurrentBlock][CurrentBlockPossition][i][i2])) + { + foundPossition = false; + } + } + } + + // Test for collision !!! + boolean Collision = false; + + if (foundPossition) + { + if (CurrentBlockPossition > 0) + CurrentBlockPossition--; + else + CurrentBlockPossition = 3; + } + + for (int i=0; i<4; i++) + { + for (int i2=0; i2<4; i2++) + { + if (drawBlocks[CurrentBlock][CurrentBlockPossition][i][i2] != 0) + { + if (drawArray[y+i][x+i2] != 0) + { + Collision = true; + } + } + } + } + + if (!Collision) + { + if (foundPossition) + { + for (int i=0; i<4; i++) + { + for (int i2=0; i2<4; i2++) + { + blockArray[y+i][x+i2] = drawBlocks[CurrentBlock][CurrentBlockPossition][i][i2]; + } + } + } + } + } + } + } + else + { + for (int y=0; y<18-2; y++) + { + for (int x=0; x<10-2; x++) + { + boolean foundPossition = true; + + for (int i=0; i<3; i++) + { + for (int i2=0; i2<3; i2++) + { + if (!(blockArray[y+i][x+i2] == drawBlocks[CurrentBlock][CurrentBlockPossition][i][i2])) + { + foundPossition = false; + } + } + } + + // Test for collision !!! + boolean Collision = false; + + if (foundPossition) + { + if (CurrentBlockPossition > 0) + CurrentBlockPossition--; + else + CurrentBlockPossition = 3; + } + + for (int i=0; i<3; i++) + { + for (int i2=0; i2<3; i2++) + { + if (drawBlocks[CurrentBlock][CurrentBlockPossition][i][i2] != 0) + { + if (drawArray[y+i][x+i2] != 0) + { + Collision = true; + } + } + } + } + + if (!Collision) + { + if (foundPossition) + { + for (int i=0; i<3; i++) + { + for (int i2=0; i2<3; i2++) + { + blockArray[y+i][x+i2] = drawBlocks[CurrentBlock][CurrentBlockPossition][i][i2]; + } + } + } + } + } + } + } + } + + private void ParseBlockArrayToDrawArray() + { + for (int x=0; x<10; x++) + { + for (int y=0; y<18; y++) + { + drawArray[y][x] += blockArray[y][x]; + blockArray[y][x] = 0; + } + } + } + + private void CheckForCompletedRows() + { + int LinesCleared = 0; + //drawArray + for (int y=17; y>1; y--) + { + boolean isComplete = true; + + for (int x=0; x<10; x++) + { + if (drawArray[y][x] == 0) + isComplete = false; + } + + if (isComplete) + { + for (int i=y; i>1; i--) + for (int x=0; x<10; x++) + { + drawArray[i][x] = drawArray[i-1][x]; + } + LinesCleared++; + lines++; + level = ( (startLevel + lines)<=200 ? startLevel + (lines / 10) : 20 ); + y++; + } + } + // Do Score here + switch (LinesCleared) + { + case 1: + score += 40 * ( level + 1 ); + break; + case 2: + score += 100 * ( level + 1 ); + break; + case 3: + score += 300 * ( level + 1 ); + break; + case 4: + score += 1200 * ( level + 1 ); + break; + } + } + + ArrayList Tetrimino; + + private boolean SpawnBlock() + { + // Pseudo random + if (Tetrimino == null || Tetrimino.size() <= 0) + { + Tetrimino = new ArrayList(); + do{ + int newTetrimino = (int)(Math.random() * (7)); + if (!Tetrimino.contains(newTetrimino)) + Tetrimino.add(newTetrimino); + }while (Tetrimino.size() < 7); + } + + CurrentBlock = NewBlock; + CurrentBlockPossition = NewBlockPossition; + + NewBlock = Tetrimino.get(0); + Tetrimino.remove(0); + NewBlockPossition = 0; + + for (int x=0; x<4; x++) + { + for (int y=0; y<4; y++) + { + if (drawBlocks[CurrentBlock][CurrentBlockPossition][y][x] != 0) + if (drawArray[y][x+3] != 0) + return false; + } + } + + for (int x=0; x<4; x++) + { + for (int y=0; y<4; y++) + { + if (drawBlocks[CurrentBlock][CurrentBlockPossition][y][x] >= 0) + blockArray[y][x+3] = drawBlocks[CurrentBlock][CurrentBlockPossition][y][x]; + } + } + + return true; + } + + /// other logic + + private void Rect(Canvas canvas, float Top, float Bottom, float Left, float Right, int Color) + { + Paint paint = new Paint(); + paint.setAntiAlias(true); + paint.setColor(Color); + paint.setStyle(Style.FILL); + + // Style Square + canvas.drawRect( + GetRealPixelSize(DIP_W, dpWidth, Left), + GetRealPixelSize(DIP_H, dpHeight, Top), + GetRealPixelSize(DIP_W, dpWidth, Right), + GetRealPixelSize(DIP_H, dpHeight, Bottom), paint); + } + + final static int DIP_H = 0; + final static int DIP_W = 1; + + private float GetRealPixelSize(int wH, float dpWH, double DIP) + { + if (wH == DIP_H) + return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, (float)(dpWH * ( DIP / 160 )), r.getDisplayMetrics()); + else if (wH == DIP_W) + return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, (float)(dpWH * ( DIP / 90 )), r.getDisplayMetrics()); + else + return 0; + } + + float map(float x, float in_min, float in_max, float out_min, float out_max) + { + return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; + } + +} diff --git a/src/mangavalk/tetris/MainActivity.java b/src/mangavalk/tetris/MainActivity.java new file mode 100644 index 0000000..25c80c9 --- /dev/null +++ b/src/mangavalk/tetris/MainActivity.java @@ -0,0 +1,137 @@ + +package mangavalk.tetris; + +import com.google.android.gms.ads.AdRequest; +import com.google.android.gms.ads.AdSize; +import com.google.android.gms.ads.AdView; + +import android.app.Activity; +import android.graphics.PointF; +import android.os.Bundle; +import android.util.SparseArray; +import android.view.MotionEvent; +import android.widget.FrameLayout; + +public class MainActivity extends Activity +{ + CanvasView canvasClass; + private AdView adView; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + FrameLayout ll; + + ll = new FrameLayout(this); + + // Create the adView. + adView = new AdView(this); + adView.setAdUnitId("ca-app-pub-2360519718191877/5428392148"); + adView.setAdSize(AdSize.BANNER); + + // Initiate a generic request. + AdRequest adRequest = new AdRequest.Builder() + .addTestDevice("D23CD70B20EE4AF169D112010B8DC97E") // Htc One X + .addTestDevice("029011F06A23EB6FFF862E44CC792EF2") // Nexus 7 tablet + .build(); + + canvasClass = new CanvasView(this); + + canvasClass.PayedVersion = true; // Set payment status + + canvasClass.startLevel = 0; + + if (!canvasClass.PayedVersion) + { + // Load the adView with the ad request. + adView.loadAd(adRequest); + } + + ll.addView(canvasClass); + + // Add the adView to it. + FrameLayout.LayoutParams adsParams =new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, + FrameLayout.LayoutParams.WRAP_CONTENT, android.view.Gravity.TOP|android.view.Gravity.CENTER_HORIZONTAL); + ll.addView(adView, adsParams); + + setContentView(ll); + + mActivePointers = new SparseArray(); + + canvasClass.SetActivity(this); + } + + @Override + public void onPause() { + super.onPause(); + canvasClass.onPause(); + } + + @Override + public void onResume() { + super.onResume(); + canvasClass.onResume(); + } + + @Override + public void onBackPressed() + { + super.onBackPressed(); + canvasClass.onPause(); + } + + private SparseArray mActivePointers; + + @Override + public boolean onTouchEvent(MotionEvent e) { + // MotionEvent reports input details from the touch screen + // and other input controls. In this case, you are only + // interested in events where the touch position changed. + + // get pointer index from the event object + int pointerIndex = e.getActionIndex(); + + // get pointer ID + int pointerId = e.getPointerId(pointerIndex); + + // get masked (not specific to a pointer) action + int maskedAction = e.getActionMasked(); + + switch (maskedAction) { + + case MotionEvent.ACTION_DOWN: + case MotionEvent.ACTION_POINTER_DOWN: { + // We have a new pointer. Lets add it to the list of pointers + + PointF f = new PointF(); + f.x = e.getX(pointerIndex); + f.y = e.getY(pointerIndex); + canvasClass.sendMove(f.x, f.y, false); + mActivePointers.put(pointerId, f); + break; + } + case MotionEvent.ACTION_MOVE: { // a pointer was moved + + break; + } + case MotionEvent.ACTION_UP: + for (int size = e.getPointerCount(), i = 0; i < size; i++) { + PointF point = mActivePointers.get(e.getPointerId(i)); + if (point != null) { + point.x = e.getX(i); + point.y = e.getY(i); + canvasClass.sendMove(point.x, point.y, true); + } + } + break; + case MotionEvent.ACTION_POINTER_UP: + break; + case MotionEvent.ACTION_CANCEL: { + // TODO use data + break; + } + } + return true; + } +}