Anda di halaman 1dari 54

PEMROGRAMAN GAME MOBILE

GAME TETRIS
Oleh :
Kelompok 5
Michael Nugraha (1104505055)
Fajar Firmansyah (1104505061)
I Putu Agus Anryatna (110450506!)
I Putu Ae Am"ara Putra (1104505064)
#resnantara (1104505100)
UNIVERSITAS UDAYANA
BUKIT JIMBARAN
2014
Se!"!# Te$"%&
$etris aalah %ermainan te&a'te&i "angunan yang %ertama &alinya iesain (leh Ale)ey
Pajitn(* %aa "ulan +uni 1,-5. saat itu. ia masih "e&erja i Pusat #(m%uter /(r(nicyn i
A&aemi 0ains 1ni 0(*iet i M(s&(2. nama tetris seniri iam"il ari "ahasa numeri& yunani.
yaitu tetra yang artinya em%at3 4m%at seniri aalah jumah susunan "al(& yang "isa iu"ah'u"ah
&e alam "er"agai "entu& untu& selanjutnya isusun (leh si %emain untu& a%at saling ter&unci3
Paa asarnya. aa 5 jenis 6(rmasi "al(& yang aa i alam game tetris. yaitu "al(& I. +.
7. O. 0. $. an 83 "al(&'"al(& terse"ut i"eri nama emi&ian &arena memang "entu&nya miri%
engan huru% terse"ut. untu& le"ih jelasnya. silah&an lihat gam"ar i "a2ah ini3
9am"ar 1 :al(& $etris
Permainan tetris ini su&ses setelah irilis (leh gameboy %aa tahun 1,-,. setelah itu.
%ermainan ini mulai irilis ulang (leh "er"agai %erusahaan game unia se%erti ninten(.
%laystati(n. (66ice game. an %erusahaan'%erusahaan game ternama lainya3 2alau%un suah
"erusia sangat lama. ta%i %ermainan ini teta% menjai %rima(na i mata gamers unia. menurut
mere&a. game ini aalah game yang "anya& menguras (ta& an mengasah cara %anang ruang
(ta& sese(rang3 ma&in lama. %(la %ermainan game ini ma&in "eragam. ji&a %aa *ersi a2alnya.
game ini hanya mengguna&an sistem %enilaian "erasar&an "angun ruang yang isusun. ta%i
lama &elamaan. mulai "anya& *ersi tetris yang juga mengguna&an %enilaian "erasar&an
&eserasian 2arna3
Pe"'o(!!) Te$"%& *o" A)+"o%+ P!+! Em,l!$o"
#ali ini %enulis menc("a mem"uat se"uah game tetris engan %lat6(rm Anr(i an
mengguna&an game engine An4ngine3 Perc("aan %ertama menc("a engan mengguna&an
emulat(r :lue0tac&s
9am"ar !3 Instalasi game tetris %aa 4mulat(r :lue0tac&s
0etelah teristal. %enulis menc("a menjalan&an game tetris3 :eri&ut tam%ilan a2al ari 9ame
$etris3
9am"ar ; $am%ilan a2al 9ame $etris
#emuian menc("a %ermainan engan memilih menu Ne2 9ame3 :eri&ut tam%ilan saat
alam %ermainan3
9am"ar 4 in-game %aa game tetris
Pe"'o(!!) Te$"%& *o" A)+"o%+ p!+! De-%'e
9ame tetris ini a&an iuji engan mengguna&an e*ice secara langsung3 /e*ice yang
i%a&an aalah 0amsung 9ala)y $a" ! 530 P;1003 :eri&ut hasil %erc("aan %aa e*ice3
T!mp%l!) A.!l G!me
:eri&ut ini aalah tam%ilan a2an ari 9ame $etris yang iuji c("a %aa %erang&at Anr(i
9ala)y $a" ! 5303
9am"ar 53 $am%ilan a2al game %aa device
T!mp%l!) in-game G!me Te$"%&
0ama halnya %aa emulat(r. in-game game ini a%at "erjalan engan n(rmal tan%a
&enala3 Paa tam%ilan ini. terlihat "e"era%a element terlihat %aa in-game se%erti board untu&
"ermain. t(m"(l na*igasi. tam%ilan piece. score. an t(m"(l pause/resume3
9am"ar 63 $am%ilan in-game %aa device
A%a"ila Piece %ertama masu& &e alam Board. Piece selanjutnya a&an tam%il %aa box
yang "eraa %aa ujung &anan %aa %ermainan3 Piece yang tam%il %aa &(ta& a&an itam%il&an
secara aca& an setelah piece "eraa %aa "agian ter"a2ah board. piece yang a&an tam%il %aa
board selanjutnya aalah piece aca& yang tam%il %aa box an seterusnya hingga game selesai
atau game over3
9am"ar 53 $am%ilan piece &e'! setelah piece %ertama
Permainan ini menyeia&an t(m"(l na*igasi untu& mengu"ah %(sisi gera& an r(tasi
piece3 $era%at ; t(m"(l untu& mengu"ah %(sisi gera& piece. yaitu t(m"(l left. down. an right3
$(m"(l't("(l ini "er6ungsi untu& mengu"ah %(sisi %ergera&an piece %aa saat piece "eraa %aa
board3 /an tera%at ! t(m"(l r(tasi untu& memutar piece yang "eraa %aa board. yaitu t(m"(l
rotate left an rotate right3 Fungsinya untu& memutar piece yang "ergera& %aa board3
9am"ar -3 Meru"ah %(sisi piece 7 :iru

9am"ar ,3 meru"ah r(tasi piece
Fungsi t(m"(l pause aalah untu& menghenti&an gera& atau %ermainan untu& sementara
2a&tu3 $(m"(l pause %aa game ini telah a%at "er6ungsi engan "ai& se"agaimana mestinya3

9am"ar 103 $(m"(l pause
#eti&a satu eret h(ris(ntal %enuh engan piece yang telah i&um%ul&an. ma&a piece
%aa satu eret h(ri<(ntal a&an menghilang an menghasil&an score3 Penilaian score
"erasar&an "anya&nya eret h(ri<(ntal yang terjai %aa game ini3 A%a"ila hal ini terjai
secara "eruntun ma&a score strea& a&an terus "ertam"ah hingga &eli%atan 163
G!m(!" 11 sc(ring
Score tertinggi alam suatu %ermainan a&an tercatat alam menu High Score3 /alam
menu High Score a&an tera%at ; catatan score tertinggi3 1rutan High Score ini "erasar&an nilai
tertinggi %ertama hingga nilai tertinggi &etiga3 A%a"ila alam satu %ermainan. satu %emain tia&
a%at mele2ati catatan high score. ma&a score yang imili&i %emain terse"ut tia& a&an masu&
&e alam catatan high score
G!m(!" 12 $am%ilan High Score
A"(ut3ja*a
package android.tetris;
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
public class About extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreateBundle saved!nstance"tate# {
super.onCreatesaved!nstance"tate#;
re$uestWindow%eatureWindow.FEATURE_NO_TITLE#;
setContent&iew'.layout.about#;
(
(
:(ar=ie23ja*a
pac)a*e android.tetris;
i+port android.content.Conte,t;
i+port android.*raphics.Canvas;
i+port android.*raphics.'ect;
i+port android.*raphics.drawable.-rawable;
i+port android.util.Attribute"et;
i+port android.view.&iew;
//.he *a+e board
public class Board&iew e,tends &iew{
public -rawable/0/0 bloc) 1 new -rawable/230/430;
public -rawable/0 wall 1 new -rawable/4320;
Conte,t conte,t;
Canvas c;
public Board&iewConte,t cont5 Attribute"et attrs# {
supercont5 attrs#;
conte,t 1 cont;
(
//-efines a position in the board for a bo,
public void initiali6eint i5 int 75 int left5 int top5 int side#{
bloc)/i0/70 1
conte,t.*et'esources#.*et-rawable'.drawable.alpha#;
bloc)/i0/70.setBoundsleft5 top5 left 8 side5 top 8 side#;
(
//A +ethod to draw the walls. 9eeds the top and the left of the first
bo, and the side of each bo,
public void createWallint left5 int top5 int side#{
int i 1 35 ,5 y;
, 1 left : side / 2;
y 1 top;
//.he left wall
while i ; <3#{
wall/i0 1
conte,t.*et'esources#.*et-rawable'.drawable.bric)#;
wall/i0.setBounds,5 y5 , 8 side / 25 y 8 side / 2#;
y 1 y 8 side / 2;
i 1 i 8 4;
(
, 1 left 8 side * 43;
y 1 top;
//.he ri*ht wall
while i ; =3#{
wall/i0 1
conte,t.*et'esources#.*et-rawable'.drawable.bric)#;
wall/i0.setBounds,5 y5 , 8 side / 25 y 8 side / 2#;
y 1 y 8 side / 2;
i 1 i 8 4;
(
, 1 left : side / 2;
//.he floor
while i ; 432#{
wall/i0 1
conte,t.*et'esources#.*et-rawable'.drawable.bric)#;
wall/i0.setBounds,5 y5 , 8 side / 25 y 8 side / 2#;
, 1 , 8 side / 2;
i 1 i 8 4;
(
(
@Override
protected void on-rawCanvas canvas# {
c 1 canvas;
super.on-rawcanvas#;
for int i 1 3; i ; 432; i88#
wall/i0.drawc#;
for int i 1 3; i ; 23; i88#
for int 7 1 3; 7 ; 43; 788#{
//>o*.e?i5 7?5 !nte*er.to"trin*i# 8 ?5 ? 8
!nte*er.to"trin*7##;
bloc)/i0/70.drawcanvas#;
(
invalidate#;
(
public Canvas *etCanvas#{
return c;
(
//Color a bo, coordinates /i0/70
public void setColorint i5 int 75 byte c#{
'ect rect;
rect 1 bloc)/i0/70.*etBounds#;
switch c#{
case &alues.CO>O'@9O9AB
bloc)/i0/70 1
conte,t.*et'esources#.*et-rawable'.drawable.alpha#;;
brea);
case &alues.CO>O'@'A-B
bloc)/i0/70 1
conte,t.*et'esources#.*et-rawable'.drawable.bloc)@red#;
brea);
case &alues.CO>O'@C'AA9B
bloc)/i0/70 1
conte,t.*et'esources#.*et-rawable'.drawable.bloc)@*reen#;
brea);
case &alues.CO>O'@B>DAB
bloc)/i0/70 1
conte,t.*et'esources#.*et-rawable'.drawable.bloc)@blue#;
brea);
case &alues.CO>O'@EA>>OWB
bloc)/i0/70 1
conte,t.*et'esources#.*et-rawable'.drawable.bloc)@yellow#;
brea);
case &alues.CO>O'@F!9GB
bloc)/i0/70 1
conte,t.*et'esources#.*et-rawable'.drawable.bloc)@pin)#;
brea);
case &alues.CO>O'@FD'F>AB
bloc)/i0/70 1
conte,t.*et'esources#.*et-rawable'.drawable.bloc)@purple#;
brea);
case &alues.CO>O'@WH!.AB
bloc)/i0/70 1
conte,t.*et'esources#.*et-rawable'.drawable.bloc)@white#;
brea);
(
bloc)/i0/70.setBoundsrect#;
(
(
:()3ja*a
package android.tetris;
import android.*raphics.drawable.-rawable;
//A bo, is each one of the positions in the board 233#
public class Bo, {
private int top5 left5 side5 color;
-rawable i+*;
//.he color5 is also indicates if the bo, is free color 3 +eans itIs
free#
public int *etColor# {
return color;
(
public void setColorint color# {
this.color 1 color;
(
//Cetters for the position
public int *et.op# {
return top;
(
public int *et>eft# {
return left;
(
public int *et"ide# {
return side;
(
public Bo,int @top5 int @left5 int @side#{
top 1 @top;
left 1 @left;
side 1 @side;
color 1 &alues.COLOR_NONE;
(
(
9ame3ja*a
pac)a*e android.tetris;
i+port 7ava.util.Calendar;
i+port 7ava.util.-ate;
i+port android.app.Activity;
i+port android.content.Conte,t;
i+port android.content."haredFreferences;
i+port android.os.Bundle;
i+port android.os.Count-own.i+er;
i+port android.os.&ibrator;
i+port android.view.-isplay;
i+port android.view.&iew;
i+port android.view.&iew.OnClic)>istener;
i+port android.view.Window;
i+port android.wid*et.Button;
i+port android.wid*et.!+a*e&iew;
i+port android.wid*et..e,t&iew;
public class Ca+e e,tends Activity {
Board&iew *a+eBoard;
int d; // .he side of a bo,
public Bo,/0/0 bo,;
int ,5 y;
Board&iew board&iew;
-isplay display;
Count-own.i+er ti+er;
Fiece currentFiece;
Fiece ne,tFiece;
boolean pieceOnCa+e;
Button btnJove'i*ht5 btnJove>eft5 btnJove-own5 btn'otate'i*ht5
btn'otate>eft5 btnFause;
!+a*e&iew ne,tFiece!+*;
//"core and co+bo
.e,t&iew te,t"core;
!+a*e&iew i+a*eCo+bo;
int score 1 3;
int co+bo 1 4;
&ibrator vibrator;
//.he pause indicator
boolean *a+e;
/** Called when the activity is first created. */
@Override
public void onCreateBundle saved!nstance"tate# {
//Assi*n layouts
super.onCreatesaved!nstance"tate#;
re$uestWindow%eatureWindow.%AA.D'A@9O@.!.>A#;
setContent&iew'.layout.*a+e#;

//Assi*n buttons
btnJove'i*ht 1 Button# find&iewBy!d'.id.ButtonJove'#;
btnJove>eft 1 Button# find&iewBy!d'.id.ButtonJove>#;
btnJove-own 1 Button# find&iewBy!d'.id.ButtonJove-#;
btn'otate'i*ht 1 Button# find&iewBy!d'.id.button'otate'#;
btn'otate>eft 1 Button# find&iewBy!d'.id.Button'otate>#;
btnFause 1 Button# find&iewBy!d'.id.buttonFause#;

//Cet +easures for the board
display 1 *etWindowJana*er#.*et-efault-isplay#;
int width 1 int# display.*etWidth# * 3.K#;
int hei*ht 1 int# display.*etHei*ht# * 3.L#;
*a+eBoard 1 Board&iew# find&iewBy!d'.id.Ca+e&iew#;
d 1 int# width * 3.=M / 43#;

//Asi*n score and co+bo resources
te,t"core 1 .e,t&iew# find&iewBy!d'.id..e,t&iew"core#;
i+a*eCo+bo 1 !+a*e&iew# find&iewBy!d'.id.i+a*e&iewCo+bo#;

//!nitiali6e bo,es and draw the wall
bo, 1 new Bo,/230/430;
, 1 int# width * 3.3M#;
y 1 int# hei*ht * 3.3M#;
*a+eBoard.createWall,5 y5 d#;
for int i 1 3; i ; 23; i88#{
, 1 int# width * 3.3M#;
for int 7 1 3; 7 ; 43; 788#{
bo,/i0/70 1 new Bo,, 8 d * 75 y 8 d * i5 d#;
*a+eBoard.initiali6ei5 75 ,5 y5 d#;
, 1 , 8 d;
(
y 1 y 8 d;
(;


//initiali6e vibrator
vibrator 1 &ibrator# *et"yste+"erviceConte,t.&!B'A.O'@"A'&!CA#;

//!nitiali6e pieces
currentFiece 1 new Fiece#;
ne,tFiece 1 new Fiece#;
ne,tFiece!+* 1 !+a*e&iew# find&iewBy!d'.id.i+a*e&iew9e,t#;

//"tart the ti+e bucle
*a+e 1 true;
ti+er 1 new Count-own.i+er4M33335 4333# {
public void on.ic)lon* +illisDntil%inished# {
*a+eAction#;
(
public void on%inish# {
*a+eAction#;
start#;
(
(.start#;

//Assi*n buttons action
btnJove'i*ht.setOnClic)>istenernew OnClic)>istener#{
public void onClic)&iew v# {
un-raw#;
currentFiece.+ove'i*ht#;
vibrator.vibrateN3#;
re-raw#;
(
(#;
btnJove>eft.setOnClic)>istenernew OnClic)>istener#{
public void onClic)&iew v# {
un-raw#;
currentFiece.+ove>eft#;
vibrator.vibrateN3#;
re-raw#;
(
(#;
//.O-OB On lon* clic)
btnJove-own.setOnClic)>istenernew OnClic)>istener#{
public void onClic)&iew v# {
un-raw#;
currentFiece.+ove-own#;
vibrator.vibrateN3#;
re-raw#;
(
(#;
btn'otate'i*ht.setOnClic)>istenernew OnClic)>istener#{
public void onClic)&iew v# {
un-raw#;
currentFiece.rotate'i*ht#;
vibrator.vibrateN3#;
re-raw#;
(
(#;
btn'otate>eft.setOnClic)>istenernew OnClic)>istener#{
public void onClic)&iew v# {
un-raw#;
currentFiece.rotate>eft#;
vibrator.vibrateN3#;
re-raw#;
(
(#;
btnFause.setOnClic)>istenernew OnClic)>istener#{
public void onClic)&iew v# {
if *a+e 11 true#{
*a+e 1 false;
btnFause.set.e,t'.strin*.resu+e#;
(
else{
*a+e 1 true;
btnFause.set.e,t'.strin*.pause#;
(
vibrator.vibrateN3#;
(
(#;

//"tart the *a+e
te,t"core.set.e,t?3?#;
currentFiece.start#;

//"et i+a*e for ne,t piece
//Has to be done here5 or there is no ne,t piece i+a*e at the
be**inin*
switchne,tFiece.type#{
case &alues.F!ACA@3B
ne,tFiece!+*.set!+a*e'esource'.drawable.piece3#;
brea);
case &alues.F!ACA@4B
ne,tFiece!+*.set!+a*e'esource'.drawable.piece4#;
brea);
case &alues.F!ACA@2B
ne,tFiece!+*.set!+a*e'esource'.drawable.piece2#;
brea);
case &alues.F!ACA@NB
ne,tFiece!+*.set!+a*e'esource'.drawable.pieceN#;
brea);
case &alues.F!ACA@<B
ne,tFiece!+*.set!+a*e'esource'.drawable.piece<#;
brea);
case &alues.F!ACA@MB
ne,tFiece!+*.set!+a*e'esource'.drawable.pieceM#;
brea);
case &alues.F!ACA@OB
ne,tFiece!+*.set!+a*e'esource'.drawable.pieceO#;
brea);
(
(

//.he ti+e bucle
public void *a+eAction#{
if *a+e 11 true#{
//Dndraw the current piece
un-raw#;

//.ry to +ove down.
if currentFiece.+ove-own# 11 false#{
//!f couldnt +ove fi, the bloc)s currently
occupied...
for int i 1 3; i ; 23; i88#
for int 7 1 3; 7 ; 43; 788#{
if currentFiece.bo,/i0/70 11 true#{
bo,/i0
/70.setColorcurrentFiece.*etColor##;
*a+eBoard.setColori5 75
currentFiece.*etColor##;
(
(
/// ...chec) if there is any full row...
if loo)%or'ows# 11 false#{
co+bo 1 4; //!f nothin* has been re+oved5 set
co+bo to 4
i+a*eCo+bo.set!+a*e'esource'.drawable.alpha#;
(
//... chec) if the *a+e is loose...
if *a+e>oose# 11 true#
finish#;
// ... and start a new piece
currentFiece 1 ne,tFiece;
currentFiece.start#;
ne,tFiece 1 new Fiece#;
//"et the ne,t piece i+a*e
switchne,tFiece.type#{
case &alues.F!ACA@3B
ne,tFiece!+*.set!+a*e'esource'.drawable.piece3#;
brea);
case &alues.F!ACA@4B
ne,tFiece!+*.set!+a*e'esource'.drawable.piece4#;
brea);
case &alues.F!ACA@2B
ne,tFiece!+*.set!+a*e'esource'.drawable.piece2#;
brea);
case &alues.F!ACA@NB
ne,tFiece!+*.set!+a*e'esource'.drawable.pieceN#;
brea);
case &alues.F!ACA@<B
ne,tFiece!+*.set!+a*e'esource'.drawable.piece<#;
brea);
case &alues.F!ACA@MB
ne,tFiece!+*.set!+a*e'esource'.drawable.pieceM#;
brea);
case &alues.F!ACA@OB
ne,tFiece!+*.set!+a*e'esource'.drawable.pieceO#;
brea);
(
(
//Copy the board info to the piece
currentFiece.readBoardbo,#;
re-raw#;
(
(

//!f there is so+ethin* in the two first rows before startin* a new
piece5 the *a+e is loose
private boolean *a+e>oose# {
int h"core45 h"core25 h"coreN5 au,;
"trin* h"core4-ate5 h"core2-ate5 h"coreN-ate5 au,-ate;
boolean loose 1 false;
for int 7 1 3; 7 ; 43; 788#
if bo,/40/70.*etColor# P1 &alues.CO>O'@9O9A#
loose 1 true;
if loose 11 false#
return false;
//What to do on *a+e overQ
//9otify the user .O-OB Jaybe deactivate buttonsQ#
*a+e 1 false;
vibrator.vibrate4333#;
//Add hi*h scores if needed
"haredFreferences hi*h"cores 1
*et"haredFreferences?hi*h"cores?5 3#;
h"core4 1 hi*h"cores.*et!nt?h"core4?5 3#;
h"core2 1 hi*h"cores.*et!nt?h"core2?5 3#;
h"coreN 1 hi*h"cores.*et!nt?h"coreN?5 3#;
h"core4-ate 1 hi*h"cores.*et"trin*?h"core4-ate?5 ?3?#;
h"core2-ate 1 hi*h"cores.*et"trin*?h"core2-ate?5 ?3?#;
h"coreN-ate 1 hi*h"cores.*et"trin*?h"coreN-ate?5 ?3?#;
Calendar current-ate 1 Calendar.*et!nstance#;
-ate date9ow 1 current-ate.*et.i+e#;
ifscore R h"coreN#{
h"coreN 1 score;
h"coreN-ate 1 date9ow.to"trin*#;
(
ifh"coreN R h"core2#{
au, 1 h"core2;
au,-ate 1 h"core2-ate;
h"core2 1 h"coreN;
h"core2-ate 1 h"coreN-ate;
h"coreN 1 au,;
h"coreN-ate 1 au,-ate;
(
ifh"core2 R h"core4#{
au, 1 h"core4;
au,-ate 1 h"core4-ate;
h"core4 1 h"core2;
h"core4-ate 1 h"core2-ate;
h"core2 1 au,;
h"core2-ate 1 au,-ate;
(
"haredFreferences.Aditor editor 1 hi*h"cores.edit#;
editor.put!nt?h"core4?5 h"core4#;
editor.put!nt?h"core2?5 h"core2#;
editor.put!nt?h"coreN?5 h"coreN#;
editor.put"trin*?h"core4-ate?5 h"core4-ate#;
editor.put"trin*?h"core2-ate?5 h"core4-ate#;
editor.put"trin*?h"coreN-ate?5 h"core4-ate#;
editor.co++it#;
return true;
(
//>oo) for co+plete rows
public boolean loo)%or'ows#{
boolean so+ethin*'e+oved 1 false; //.o deter+ine if so+e row has been
re+oved to )eep the co+bo
boolean full 1 true;
for int i 1 4; i ; 23; i88#{
full 1 true;
for int 7 1 3; 7 ; 43; 788#{
if bo,/i0/70.*etColor# 11 &alues.CO>O'@9O9A#
full 1 false;
(
if full 11 true#{
so+ethin*'e+oved 1 true;
re+ove'owi#;
(
(
return so+ethin*'e+oved;
(


//'e+ove row and score
public void re+ove'owint row#{
score 1 score 8 &alues."CO'A@FA'@'OW * co+bo;
te,t"core.set.e,t!nte*er.to"trin*score##;
//"etco+bo +ultiplier
co+bo 1 co+bo * 2;
if co+bo 11 N2#
co+bo 1 4O;
switch co+bo#{
case 2B
i+a*eCo+bo.set!+a*e'esource'.drawable.,2#;
brea);
case <B
i+a*eCo+bo.set!+a*e'esource'.drawable.,<#;
brea);
case =B
i+a*eCo+bo.set!+a*e'esource'.drawable.,=#;
brea);
case 4OB
i+a*eCo+bo.set!+a*e'esource'.drawable.,4O#;
brea);
(
for int i 1 row; i R 4; i::#
for int 7 1 3; 7 ; 43; 788#{
bo,/i0/70.setColorbo,/i : 40/70.*etColor##;
*a+eBoard.setColori5 75 byte# bo,/i : 40/70.*etColor##;
(
(
//'edraw the screen
public void re-raw#{
//'ead where the piece is and colori6e
for int i 1 3; i ; 23; i88#
for int 7 1 3; 7 ; 43; 788#{
if currentFiece.bo,/i0/70 11 true#{
bo,/i0/70.setColorcurrentFiece.*etColor##;
*a+eBoard.setColori5 75 currentFiece.*etColor##;
(
(
(

//Dndraw the current piece before +ovin*
public void un-raw#{
for int i 1 3; i ; 23; i88#
for int 7 1 3; 7 ; 43; 788#{
if currentFiece.bo,/i0/70 11 true#{
bo,/i0/70.setColor3#;
*a+eBoard.setColori5 75 byte# 3#;
(
(
(
(
>igh0c(re3ja*a
pac)a*e android.tetris;
i+port android.app.Activity;
i+port android.content."haredFreferences;
i+port android.os.Bundle;
i+port android.view.Window;
i+port android.wid*et..e,t&iew;
public class Hi*h"cores e,tends Activity{
public void onCreateBundle saved!nstance"tate# {
//.e,t&iews
.e,t&iew hs45 hs25 hsN5 hs4d5 hs2d5 hsNd;
//"aved values
"haredFreferences hi*h"cores;
//Assi*n layouts
super.onCreatesaved!nstance"tate#;
re$uestWindow%eatureWindow.%AA.D'A@9O@.!.>A#;
setContent&iew'.layout.hi*hscores#;

//Assi*n te,t&iews
hs4 1 .e,t&iew# find&iewBy!d'.id.te,t&iewHi*h"core4#;
hs2 1 .e,t&iew# find&iewBy!d'.id.te,t&iewHi*h"core2#;
hsN 1 .e,t&iew# find&iewBy!d'.id.te,t&iewHi*h"coreN#;
hs4d 1 .e,t&iew# find&iewBy!d'.id.te,t&iewHi*h"core4-ate#;
hs2d 1 .e,t&iew# find&iewBy!d'.id.te,t&iewHi*h"core2-ate#;
hsNd 1 .e,t&iew# find&iewBy!d'.id.te,t&iewHi*h"coreN-ate#;

//>oad hi*h scores
hi*h"cores 1 *et"haredFreferences?hi*h"cores?5 3#;
if hi*h"cores.*et!nt?h"core4?5 3# R 3#{
hs4.set.e,t*et'esources#.*et"trin*'.strin*.first# 8 ?B
? 8 !nte*er.to"trin*hi*h"cores.*et!nt?h"core4?5 3###;
hs4d.set.e,thi*h"cores.*et"trin*?h"core4-ate?5 ? ?##;
(
if hi*h"cores.*et!nt?h"core2?5 3# R 3#{
hs2.set.e,t*et'esources#.*et"trin*'.strin*.second# 8 ?B
? 8 !nte*er.to"trin*hi*h"cores.*et!nt?h"core2?5 3###;
hs2d.set.e,thi*h"cores.*et"trin*?h"core2-ate?5 ? ?##;
(
if hi*h"cores.*et!nt?h"coreN?5 3# R 3#{
hsN.set.e,t*et'esources#.*et"trin*'.strin*.third# 8 ?B
? 8 !nte*er.to"trin*hi*h"cores.*et!nt?h"coreN?5 3###;
hsNd.set.e,thi*h"cores.*et"trin*?h"coreN-ate?5 ? ?##;
(
(
(
Piece3ja*a
package android.tetris;
import 7ava.util.'ando+;
public class Fiece {
'ando+ *enerator;
byte type;
byte color;
boolean/0/0 bo,;
boolean board/0/0;
boolean/0/0 au,;
byte rotation; //'otation state of the pieceB 3:R4:R2:RN:R3
public byte *etColor#{
return color;
(
Fiece#{
*enerator 1 new 'ando+#;
type 1 byte# *enerator.ne,t!ntK#;
//type 1 2;//.A".!9C5 chan*e to be all the sa+e piece
color 1 byte# type 8 4#;
rotation 1 3;
bo, 1 new boolean/230/430;
board 1 new boolean/230/430;
for int i 1 3; i ; 23; i88#
for int 7 1 3; 7 ; 43; 788#
bo,/i0/70 1 false;
(
//Futs the piece in the top of the board
public void start#{
switch type#{
//!n the &alues class there is a ?*raphical description?
of each piece
case &alues.PIECE_0B //.he bar
bo,/30/N0 1 true;
bo,/30/<0 1 true;
bo,/30/M0 1 true;
bo,/30/O0 1 true;
break;
case &alues.PIECE_1B //.he I>I:shaped
bo,/30/<0 1 true;
bo,/40/<0 1 true;
bo,/40/M0 1 true;
bo,/40/O0 1 true;
break;
case &alues.PIECE_2B //.he inverted I>I:shaped
bo,/30/M0 1 true;
bo,/40/N0 1 true;
bo,/40/<0 1 true;
bo,/40/M0 1 true;
break;
case &alues.PIECE_3B //.he cube
bo,/30/<0 1 true;
bo,/30/M0 1 true;
bo,/40/<0 1 true;
bo,/40/M0 1 true;
break;
case &alues.PIECE_4B //.he inverted ISI:shaped
bo,/30/<0 1 true;
bo,/30/M0 1 true;
bo,/40/N0 1 true;
bo,/40/<0 1 true;
break;
case &alues.PIECE_5B //.he ISI:shaped
bo,/30/<0 1 true;
bo,/30/M0 1 true;
bo,/40/M0 1 true;
bo,/40/O0 1 true;
break;
case &alues.PIECE_6B //.he inverted I.I
bo,/30/<0 1 true;
bo,/40/N0 1 true;
bo,/40/<0 1 true;
bo,/40/M0 1 true;
break;
(
(
//.his +ethod receives the array of bo,es fro+ the Ca+e class5 so the
piece have info about the state of the board
//Frobably there is a better way to do that
public void readBoardBo, a/0/0#{
for int i 1 3; i ; 23; i88#
for int 7 1 3; 7 ; 43; 788#
if a/i0/70.*etColor# 11 &alues.COLOR_NONE#
board/i0/70 1 false;
else
board/i0/70 1 true;
(
//Called when a piece is *oin* to be +oved. Also chec)s if the piece
can be +oved. 'eturns true and +oves the piece# if itIs possible
public boolean +ove-own#{
au, 1 new boolean/230/430; //9ew array. !n
the end5 if everythin* is OG5 it will be copied to the piece array
for int 7 1 3; 7 ; 43; 788#
if bo,/4L0/70 11 true# //!f any bo,
confor+in* the piece is in the 4Lth row...
return false; //...
donIt +ove
for int i 1 3; i ; 4L; i88# //A,a+ine all the
bo,es5 one by one
for int 7 1 3; 7 ; 43; 788#{
if bo,/i0/70 11 true#{ //!f the piece is
occupyin* a bo,
if board/i 8 40/70 11 true#//!f the bo, below is
already occupied...
return false; //... donIt +ove
au,/i 8 40/70 1 true; //!f the bo, below is
free5 +ar) as true in the au,iliary array
(
else
au,/i 8 40/70 1 false; //!f the bo, is not
occupied by the piece5 set to false in the au,iliary array
(
for int i 1 3; i ; 23; i88# //Copy the au,iliary
array to the piece array
for int 7 1 3; 7 ; 43; 788#
bo,/i0/70 1 au,/i0/70;
return true; //Fiece
+ovedP
(
//Called when a piece is *oin* to be +oved. Also chec)s if the piece
can be +oved. 'eturns true and +oves the piece# if itIs possible
public boolean +ove>eft#{
au, 1 new boolean/230/430; //9ew array. !n
the end5 if everythin* is OG5 it will be copied to the piece array
for int i 1 3; i ; 23; i88# //A,a+ine all the
bo,es5 one by one
for int 7 1 3; 7 ; 43; 788#{
if bo,/i0/70 11 true#{ //!f the piece is
occupyin* a bo,
if 7 11 3# //!f this bo, is
behind the left wall...
return false; //... donIt +ove
if board/i0/7 : 40 11 true#//!f the bo, in the left
is already occupied...
return false; //... donIt +ove
au,/i0/7 : 40 1 true; //!f the bo, in the
left is free and itIs not a wall5 +ar) as true in the au,iliary array
(
else
au,/i0/70 1 false; //!f the bo, is
not occupied by the piece5 set to false in the au,iliary array
(
for int i 1 3; i ; 23; i88# //Copy the au,iliary
array to the piece array
for int 7 1 3; 7 ; 43; 788#
bo,/i0/70 1 au,/i0/70;
return true; //Fiece
+ovedP
(
//Called when a piece is *oin* to be +oved. Also chec)s if the piece
can be +oved. 'eturns true and +oves the piece# if itIs possible
public boolean +ove'i*ht#{
au, 1 new boolean/230/430; //9ew array. !n
the end5 if everythin* is OG5 it will be copied to the piece array
for int i 1 4L; i R1 3; i::# //A,a+ine all the
bo,es5 one by one
for int 7 1 L; 7 R1 3; 7::#{
if bo,/i0/70 11 true#{ //!f the piece is
occupyin* a bo,
if 7 11 L# //!f this bo, is
behind the ri*ht wall...
return false; //... donIt +ove
if board/i0/7 8 40 11 true#//!f the bo, in the
ri*ht is already occupied...
return false; //... donIt +ove
au,/i0/7 8 40 1 true; //!f the bo, in the
left is free and itIs not a wall5 +ar) as true in the au,iliary array
(
else
au,/i0/70 1 false; //!f the bo, is
not occupied by the piece5 set to false in the au,iliary array
(
for int i 1 3; i ; 23; i88# //Copy the au,iliary
array to the piece array
for int 7 1 3; 7 ; 43; 788#
bo,/i0/70 1 au,/i0/70;
return true; //Fiece
+ovedP
(
//Called when a piece is *oin* to be rotated. Also chec)s if the piece
can be +oved. 'eturns true and +oves the piece# if itIs possible
//-!"C>A!JA'B
//&ery confusin* code. &A'E &A'E confusin*
//.he ne,t two +ethods are a succession of nested switch# that5
first5 identify the piece5 and5 ne,t5 rotates fro+ itIs previous position
//Aach case is treated separately5 as ! havenIt found any co++on
+ethod. Aach case is shortly co++ented5 but itIs not very clear.
//"orry about that
public boolean rotate'i*ht#{
int i 1 3;
int 7 1 3;
switch type#{
case &alues.PIECE_0B
//"witch ne,t rotation state
switch rotation 8 4#{
case 4B //%ro+ hori6ontal to vertical
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if i 11 4L#
return false;
if i 11 3#
return false;
if board/i : 40/7 8 20 11 true#
return false;
if board/i 8 40/7 8 20 11 true#
return false;
if board/i 8 20/7 8 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i : 40/7 8 20 1 true;
bo,/i 8 40/7 8 20 1 true;
bo,/i 8 20/7 8 20 1 true;
bo,/i0/70 1 false;
bo,/i0/7 8 40 1 false;
bo,/i0/7 8 N0 1 false;
break;
case 2B //%ro+ vertical to hori6ontal
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f is behind the left wall5 try to
+ove ri*ht twice5 on no one
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
if +ove'i*ht# 11 false#{
+ove>eft#;
return false;
(
7 1 7 8 2;
(
//!f is 4 distance the left wall5 try to
+ove ri*ht twice5 on no one
if 7 11 4#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//!f is behind the ri*ht wall5 try to
+ove left
if 7 11 L#{
if +ove>eft# 11 false#
return false;
7 1 7 : 4;
(
//Chec) availability
if board/i 8 40/7 : 20 11 true#
return false;
if board/i 8 40/7 : 40 11 true#
return false;
if board/i 8 40/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 : 20 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 40/7 8 40 1 true;
bo,/i0/70 1 false;
bo,/i 8 20/70 1 false;
bo,/i 8 N0/70 1 false;
break;
case NB //%ro+ hori6ontal to vertical
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if i 11 4L#
return false;
if i 11 3#
return false;
if board/i : 40/7 8 20 11 true#
return false;
if board/i 8 40/7 8 20 11 true#
return false;
if board/i 8 20/7 8 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i : 40/7 8 20 1 true;
bo,/i 8 40/7 8 20 1 true;
bo,/i 8 20/7 8 20 1 true;
bo,/i0/70 1 false;
bo,/i0/7 8 40 1 false;
bo,/i0/7 8 N0 1 false;
break;
case <B //%ro+ vertical to hori6ontal
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f is behind the left wall5 try to
+ove ri*ht twice5 on no one
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
if +ove'i*ht# 11 false#{
+ove>eft#;
return false;
(
7 1 7 8 2;
(
//!f is 4 distance the left wall5 try to
+ove ri*ht twice5 on no one
if 7 11 4#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//!f is behind the ri*ht wall5 try to
+ove left
if 7 11 L#{
if +ove>eft# 11 false#
return false;
7 1 7 : 4;
(
//Chec) availability
if board/i 8 40/7 : 20 11 true#
return false;
if board/i 8 40/7 : 40 11 true#
return false;
if board/i 8 40/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 : 20 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 40/7 8 40 1 true;
bo,/i0/70 1 false;
bo,/i 8 20/70 1 false;
bo,/i 8 N0/70 1 false;
break;
(
break;
case &alues.PIECE_1B
//"witch new rotation state
switch rotation 8 4#{
case 4B //%ro+ hori6ontal left:side:up to
vertical top:side:ri*ht
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if i 11 4L#
return false;
if board/i0/7 8 40 11 true#
return false;
if board/i0/7 8 20 11 true#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 8 40 1 true;
bo,/i0/7 8 20 1 true;
bo,/i 8 20/7 8 40 1 true;
bo,/i0/70 1 false;
bo,/i 8 40/70 1 false;
bo,/i 8 40/7 8 20 1 false;
break;
case 2B //%ro+ vertical top:side:ri*ht to
hori6ontal ri*ht:side:down
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//!f is behind the left wall5 try to
+ove ri*ht
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 : 40 11 true#
return false;
if board/i 8 40/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 : 40 1 true;
bo,/i 8 40/7 8 40 1 true;
bo,/i 8 40/70 1 false;
bo,/i 8 20/70 1 false;
break;
case NB //%ro+ hori6ontal left:side:down to
vertical down:side:left
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if i 11 4L#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
if board/i 8 20/7 8 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 20/7 8 40 1 true;
bo,/i 8 20/7 8 20 1 true;
bo,/i0/70 1 false;
bo,/i0/7 8 40 1 false;
break;
case <B //%ro+ vertical down:side:left to
hori6ontal left:side:up
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f is behind the left wall5 try to
+ove ri*ht
if 7 11 4#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 : 20 11 true#
return false;
if board/i 8 40/7 : 20 11 true#
return false;
if board/i 8 40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 : 20 1 true;
bo,/i 8 40/7 : 20 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i0/70 1 false;
bo,/i 8 20/7 : 40 1 false;
bo,/i 8 20/70 1 false;
break;
(
break;
case &alues.PIECE_2B
//"witch new rotation state
switch rotation 8 4#{
case 4B //%ro+ hori6ontal ri*ht:side:up to
vertical low:side:ri*ht
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if i 11 4L#
return false;
if board/i0/7 : 40 11 true#
return false;
if board/i 8 20/7 : 40 11 true#
return false;
if board/i 8 20/70 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 : 40 1 true;
bo,/i 8 20/7 : 40 1 true;
bo,/i 8 20/70 1 true;
bo,/i0/70 1 false;
bo,/i 8 40/7 : 20 1 false;
bo,/i 8 40/70 1 false;
break;
case 2B //%ro+ vertical botto+:side:ri*ht to
hori6ontal left:side:down
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
lri*ht
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 : 40 11 true#
return false;
if board/i0/7 8 40 11 true#
return false;
if board/i 8 40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 : 40 1 true;
bo,/i0/7 8 40 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 40/70 1 false;
bo,/i 8 20/70 1 false;
bo,/i 8 20/7 8 40 1 false;
break;
case NB //%ro+ hori6ontal ri*ht:side:down to
vertical top:side:left
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if i 11 4L#
return false;
if board/i 8 i0/7 8 20 11 true#
return false;
if board/i 8 20/7 8 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 8 20 1 true;
bo,/i 8 20/7 8 20 1 true;
bo,/i0/70 1 false;
bo,/i 8 40/70 1 false;
break;
case <B //%ro+ vertical top:side:left to
hori6ontal ri*ht:side:up
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
ri*ht
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i 8 40/7 : 40 11 true#
return false;
if board/i 8 40/70 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 40/70 1 true;
bo,/i0/70 1 false;
bo,/i 8 20/7 8 40 1 false;
break;
(
break;
case &alues.PIECE_3B
//!s the cube5 so5 do nothin*P
break;
case &alues.PIECE_4B // inverted ISI: shaped
//"witch new rotation state
switch rotation 8 4#{
case 4B //%ro+ upleft T downri*ht to leftup T
r*htdown
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if board/i 8 40/7 8 40 11 true#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 8 40 1 true;
bo,/i 8 20/7 8 40 1 true;
bo,/i0/7 8 40 1 false;
bo,/i 8 40/7 : 40 1 false;
break;
case 2B //%ro+ leftup T ri*htdown to upleft T
downri*ht
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
ri*ht
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 8 40 11 true#
return false;
if board/4 8 40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 8 40 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 40/7 8 40 1 false;
bo,/i 8 20/7 8 40 1 false;
break;
case NB //%ro+ upleft T downri*ht to leftup T
r*htdownB "a+e as case 4
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if board/i 8 40/7 8 40 11 true#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 8 40 1 true;
bo,/i 8 20/7 8 40 1 true;
bo,/i0/7 8 40 1 false;
bo,/i 8 40/7 : 40 1 false;
break;
case <B //%ro+ leftup T ri*htdown to upleft T
downri*ht // "a+e as case 2
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
ri*ht
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 8 40 11 true#
return false;
if board/4 8 40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 8 40 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 40/7 8 40 1 false;
bo,/i 8 20/7 8 40 1 false;
break;
(
break;
case &alues.PIECE_5B // ISI: shaped
//"witch new rotation state
switch rotation 8 4#{
case 4B //%ro+ downleft T upri*ht to ri*htup T
leftdown
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
if board/i0/7 8 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 20/7 8 40 1 true;
bo,/i0/7 8 20 1 true;
bo,/i0/70 1 false;
bo,/i0/7 8 40 1 false;
break;
case 2B //%ro+ ri*htup T leftdown to downleft
T upri*ht
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
ri*ht
if 7 11 4#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 :20 11 true#
return false;
if board/40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 : 20 1 true;
bo,/i0/7 : 40 1 true;
bo,/i0/70 1 false;
bo,/i 8 20/7 : 40 1 false;
break;
case NB //%ro+ downleft T upri*ht to ri*htup T
leftdownB "a+e as case 4
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
if board/i0/7 8 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 20/7 8 40 1 true;
bo,/i0/7 8 20 1 true;
bo,/i0/70 1 false;
bo,/i0/7 8 40 1 false;
break;
case <B //%ro+ ri*htup T leftdown to downleft
T upri*htB "A+e as case 2
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
ri*ht
if 7 11 4#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 :20 11 true#
return false;
if board/40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 : 20 1 true;
bo,/i0/7 : 40 1 true;
bo,/i0/70 1 false;
bo,/i 8 20/7 : 40 1 false;
break;
(
break;
case &alues.PIECE_6B // I.I: shaped
//"witch new rotation state
switch rotation 8 4#{
case 4B //%ro+ top faced to ri*ht faced
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if board/i 8 20/70 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 20/70 1 true;
bo,/i 8 40/7 : 40 1 false;
break;
case 2B //%ro+ ri*ht faced to botto+ faced
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
ri*ht
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i 8 40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 : 40 1 true;
bo,/i0/70 1 false;
break;
case NB //%ro+ botto+ faced to left faced
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 3#
return false;
if board/i : 40/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i : 40/7 8 40 1 true;
bo,/i0/7 8 20 1 false;
break;
case <B //%ro+ left faced to top faced
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove left
if 7 11 L#{
if +ove>eft# 11 false#
return false;
7 1 7 : 4;
(
//Chec) availability
if board/i 8 40/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 8 40 1 true;
bo,/i 8 20/70 1 false;
break;
(
break;
(
//Chan*e rotation state
rotation88;
if rotation 11 <#
rotation 1 3;
return true;
(
public boolean rotate>eft#{
int i 1 3;
int 7 1 3;
switch type#{
case &alues.PIECE_0B
//"witch ne,t rotation state
switch rotation : 4#{
case :4B //%ro+ hori6ontal to vertical
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if i 11 4L#
return false;
if i 11 3#
return false;
if board/i : 40/7 8 20 11 true#
return false;
if board/i 8 40/7 8 20 11 true#
return false;
if board/i 8 20/7 8 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i : 40/7 8 20 1 true;
bo,/i 8 40/7 8 20 1 true;
bo,/i 8 20/7 8 20 1 true;
bo,/i0/70 1 false;
bo,/i0/7 8 40 1 false;
bo,/i0/7 8 N0 1 false;
break;
case 3B //%ro+ vertical to hori6ontal
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f is behind the left wall5 try to
+ove ri*ht twice5 on no one
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
if +ove'i*ht# 11 false#{
+ove>eft#;
return false;
(
7 1 7 8 2;
(
//!f is 4 distance the left wall5 try to
+ove ri*ht twice5 on no one
if 7 11 4#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//!f is behind the ri*ht wall5 try to
+ove left
if 7 11 L#{
if +ove>eft# 11 false#
return false;
7 1 7 : 4;
(
//Chec) availability
if board/i 8 40/7 : 20 11 true#
return false;
if board/i 8 40/7 : 40 11 true#
return false;
if board/i 8 40/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 : 20 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 40/7 8 40 1 true;
bo,/i0/70 1 false;
bo,/i 8 20/70 1 false;
bo,/i 8 N0/70 1 false;
break;
case 4B //%ro+ hori6ontal to vertical
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if i 11 4L#
return false;
if i 11 3#
return false;
if board/i : 40/7 8 20 11 true#
return false;
if board/i 8 40/7 8 20 11 true#
return false;
if board/i 8 20/7 8 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i : 40/7 8 20 1 true;
bo,/i 8 40/7 8 20 1 true;
bo,/i 8 20/7 8 20 1 true;
bo,/i0/70 1 false;
bo,/i0/7 8 40 1 false;
bo,/i0/7 8 N0 1 false;
break;
case 2B //%ro+ vertical to hori6ontal
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f is behind the left wall5 try to
+ove ri*ht twice5 on no one
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
if +ove'i*ht# 11 false#{
+ove>eft#;
return false;
(
7 1 7 8 2;
(
//!f is 4 distance the left wall5 try to
+ove ri*ht twice5 on no one
if 7 11 4#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//!f is behind the ri*ht wall5 try to
+ove left
if 7 11 L#{
if +ove>eft# 11 false#
return false;
7 1 7 : 4;
(
//Chec) availability
if board/i 8 40/7 : 20 11 true#
return false;
if board/i 8 40/7 : 40 11 true#
return false;
if board/i 8 40/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 : 20 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 40/7 8 40 1 true;
bo,/i0/70 1 false;
bo,/i 8 20/70 1 false;
bo,/i 8 N0/70 1 false;
break;
(
break;
case &alues.PIECE_1B
//"witch new rotation state
switch rotation : 4#{
case :4B //%ro+ hori6ontal left:side:up to
vertical low:side:left
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if i 11 4L#
return false;
if board/i0/7 8 20 11 true#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
if board/i 8 20/7 8 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 8 20 1 true;
bo,/i 8 20/7 8 40 1 true;
bo,/i 8 20/7 8 20 1 true;
bo,/i0/70 1 false;
bo,/i 8 40/70 1 false;
bo,/i 8 40/7 8 40 1 false;
break;
case 3B //%ro+ vertical top:side:ri*ht to
hori6ontal left:side:up
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f is behind the left wall5 try to
+ove ri*ht
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 : 40 11 true#
return false;
if board/i 8 40/7 : 40 11 true#
return false;
if board/i 8 40/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 : 40 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 40/7 8 40 1 true;
bo,/i0/70 1 false;
bo,/i0/7 8 40 1 false;
bo,/i 8 20/70 1 false;
break;
case 4B //%ro+ hori6ontal ri*ht:side:down to
vertical low:side:ri*ht
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if i 11 4L#
return false;
if board/i 8 40/7 8 40 11 true#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 8 40 1 true;
bo,/i 8 20/7 8 40 1 true;
bo,/i0/70 1 false;
bo,/i 8 40/7 8 20 1 false;
break;
case 2B //%ro+ vertical top:side:ri*ht to
hori6ontal left:side:down
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f is behind the left wall5 try to
+ove ri*ht
if 7 11 4#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 : 40 11 true#
return false;
if board/i0/7 : 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 : 40 1 true;
bo,/i0/7 : 20 1 true;
bo,/i 8 20/70 1 false;
bo,/i 8 20/7 : 40 1 false;
break;
(
break;
case &alues.PIECE_2B
//"witch new rotation state
switch rotation : 4#{
case :4B //%ro+ hori6ontal ri*ht:side:up to
vertical top:side:left
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if i 11 4L#
return false;
if board/i0/7 : 40 11 true#
return false;
if board/i 8 20/70 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 : 40 1 true;
bo,/i 8 20/70 1 true;
bo,/i 8 40/7 : 40 1 false;
bo,/i 8 40/7 : 20 1 false;
break;
case 3B //%ro+ vertical botto+:side:ri*ht to
hori6ontal ri*ht:side:up
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
lri*ht
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 8 40 11 true#
return false;
if board/i 8 40/7 8 40 11 true#
return false;
if board/i 8 40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 8 40 1 true;
bo,/i 8 40/7 8 40 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i0/70 1 false;
bo,/i 8 20/70 1 false;
bo,/i 8 20/7 8 40 1 false;
break;
case 4B //%ro+ hori6ontal left:side:down to
vertical low:side:ri*ht
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if i 11 4L#
return false;
if board/i 8 i0/7 8 40 11 true#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
if board/i 8 20/7 8 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 8 40 1 true;
bo,/i 8 20/7 8 40 1 true;
bo,/i 8 20/7 8 20 1 true;
bo,/i0/70 1 false;
bo,/i 8 40/70 1 false;
bo,/i0/7 8 20 1 false;
break;
case 2B //%ro+ vertical top:side:left to
hori6ontal left:side:down
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
ri*ht
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 : 40 11 true#
return false;
if board/i 8 40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 : 40 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 40/7 8 40 1 false;
bo,/i 8 20/7 8 40 1 false;
break;
(
break;
case &alues.PIECE_3B
//!s the cube5 so5 do nothin*P
break;
case &alues.PIECE_4B // inverted ISI: shaped
//"witch new rotation state
switch rotation : 4#{
case :4B //%ro+ upleft T downri*ht to leftup T
r*htdown
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if board/i 8 40/7 8 40 11 true#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 8 40 1 true;
bo,/i 8 20/7 8 40 1 true;
bo,/i0/7 8 40 1 false;
bo,/i 8 40/7 : 40 1 false;
break;
case 3B //%ro+ leftup T ri*htdown to upleft T
downri*ht
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
ri*ht
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 8 40 11 true#
return false;
if board/4 8 40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 8 40 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 40/7 8 40 1 false;
bo,/i 8 20/7 8 40 1 false;
break;
case 4B //%ro+ upleft T downri*ht to leftup T
r*htdownB "a+e as case 4
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if board/i 8 40/7 8 40 11 true#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 8 40 1 true;
bo,/i 8 20/7 8 40 1 true;
bo,/i0/7 8 40 1 false;
bo,/i 8 40/7 : 40 1 false;
break;
case 2B //%ro+ leftup T ri*htdown to upleft T
downri*ht // "a+e as case 2
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
ri*ht
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 8 40 11 true#
return false;
if board/4 8 40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 8 40 1 true;
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 40/7 8 40 1 false;
bo,/i 8 20/7 8 40 1 false;
break;
(
break;
case &alues.PIECE_5B // ISI: shaped
//"witch new rotation state
switch rotation : 4#{
case :4B //%ro+ downleft T upri*ht to ri*htup
T leftdown
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
if board/i0/7 8 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 20/7 8 40 1 true;
bo,/i0/7 8 20 1 true;
bo,/i0/70 1 false;
bo,/i0/7 8 40 1 false;
break;
case 3B //%ro+ ri*htup T leftdown to downleft
T upri*ht
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
ri*ht
if 7 11 4#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 :20 11 true#
return false;
if board/40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 : 20 1 true;
bo,/i0/7 : 40 1 true;
bo,/i0/70 1 false;
bo,/i 8 20/7 : 40 1 false;
break;
case 4B //%ro+ downleft T upri*ht to ri*htup T
leftdownB "a+e as case 4
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if board/i 8 20/7 8 40 11 true#
return false;
if board/i0/7 8 20 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 20/7 8 40 1 true;
bo,/i0/7 8 20 1 true;
bo,/i0/70 1 false;
bo,/i0/7 8 40 1 false;
break;
case 2B //%ro+ ri*htup T leftdown to downleft
T upri*htB "A+e as case 2
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
ri*ht
if 7 11 4#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i0/7 :20 11 true#
return false;
if board/40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i0/7 : 20 1 true;
bo,/i0/7 : 40 1 true;
bo,/i0/70 1 false;
bo,/i 8 20/7 : 40 1 false;
break;
(
break;
case &alues.PIECE_6B // I.I: shaped
//"witch new rotation state
switch rotation : 4#{
case :4B //%ro+ top faced to ri*ht faced
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 4=#
return false;
if board/i 8 20/70 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 20/70 1 true;
bo,/i 8 40/7 8 40 1 false;
break;
case 3B //%ro+ ri*ht faced to botto+ faced
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove
ri*ht
if 7 11 3#{
if +ove'i*ht# 11 false#
return false;
7 1 7 8 4;
(
//Chec) availability
if board/i 8 40/7 : 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 : 40 1 true;
bo,/i 8 20/70 1 false;
break;
case 4B //%ro+ botto+ faced to left faced
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 L#{
7 1 3;
i88;
(
(
//Chec) availability
if i 11 3#
return false;
if board/i : 40/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i : 40/7 8 40 1 true;
bo,/i0/70 1 false;
break;
case 2B //%ro+ left faced to top faced
//%ind the first occupied bo,
while bo,/i0/70 11 false#{
788;
if 7 11 43#{
7 1 3;
i88;
(
(
//!f its behind a wall5 try to +ove left
if 7 11 L#{
if +ove>eft# 11 false#
return false;
7 1 7 : 4;
(
//Chec) availability
if board/i 8 40/7 8 40 11 true#
return false;
//Ferfor+ transfor+ation
bo,/i 8 40/7 8 40 1 true;
bo,/i0/70 1 false;
break;
(
break;
(
//Chan*e rotation state
rotation::;
if rotation 11 :4#
rotation 1 N;
return true;
(
(
$etris3ja*a
pac)a*e android.tetris;
i+port android.app.Activity;
i+port android.content.!ntent;
i+port android.os.Bundle;
i+port android.view.&iew;
i+port android.view.&iew.OnClic)>istener;
i+port android.view.Window;
i+port android.wid*et.Button;
public class .etris e,tends Activity {
private Button btn9ewCa+e5 btnHi*h"cores5 btnAbout5 btnA,it;
/** Called when the activity is first created. */
@Override
public void onCreateBundle saved!nstance"tate# {
//Assi*n layouts
super.onCreatesaved!nstance"tate#;
re$uestWindow%eatureWindow.%AA.D'A@9O@.!.>A#;
setContent&iew'.layout.+ain#;

//%ind and assi*n buttons
btn9ewCa+e 1 Button# find&iewBy!d'.id.button9ewCa+e#;
btn9ewCa+e.setOnClic)>istenernew OnClic)>istener#{
public void onClic)&iew v# {
!ntent intent 1 new !ntent.etris.this5 Ca+e.class#;
startActivityintent#;
(
(#;

btnHi*h"cores 1 Button# find&iewBy!d'.id.buttonHi*h"cores#;
btnHi*h"cores.setOnClic)>istenernew OnClic)>istener#{
public void onClic)&iew v# {
!ntent intent 1 new !ntent.etris.this5 Hi*h"cores.class#;
startActivityintent#;
(
(#;
btnAbout 1 Button# find&iewBy!d'.id.buttonAbout#;
//btn'esu+eCa+e.setAnabledfalse#; //-isabled uni+ple+ented
feature#
btnAbout.setOnClic)>istenernew OnClic)>istener#{
public void onClic)&iew v# {
!ntent intent 1 new !ntent.etris.this5 About.class#;
startActivityintent#;
(
(#;

btnA,it 1 Button# find&iewBy!d'.id.buttonA,it#;
btnA,it.setOnClic)>istenernew OnClic)>istener#{
public void onClic)&iew v# {
finish#;
(
(#;
(
(
=alues3ja*a
package android.tetris;
public final class &alues {
//"core codes
public static final int SCORE_PER_ROW 1 4333;
//Color codes
public static final byte COLOR_NONE 1 3;
public static final byte COLOR_RED 1 4;
public static final byte COLOR_GREEN 1 2;
public static final byte COLOR_BLUE 1 N;
public static final byte COLOR_YELLOW 1 <;
public static final byte COLOR_PIN 1 M;
public static final byte COLOR_PURPLE 1 O;
public static final byte COLOR_W!ITE 1 K;
//Fiece codes
//3333
//3333
//4444
//3333
public static final byte PIECE_0 1 3;
//3333
//3433
//3444
//3333
public static final byte PIECE_1 1 4;
//3333
//3334
//3444
//3333
public static final byte PIECE_2 1 2;
//3333
//3443
//3443
//3333
public static final byte PIECE_3 1 N;
//3333
//3344
//3443
//3333
public static final byte PIECE_4 1 <;
//3333
//3443
//3344
//3333
public static final byte PIECE_5 1 M;
//3333
//3343
//3444
//3333
public static final byte PIECE_6 1 O;
(
:uil?(n6ig3ja*a
/** Auto+atically *enerated file. -O 9O. JO-!%E */
package android.tetris;
public final class BuildConfi* {
public final static boolean DEBUG 1 true;
(