俄羅斯方塊Tetris是一款很經(jīng)典的益智游戲,之前就做了一款桌面版的java俄羅斯方塊,這次就嘗試著寫了一款適用于Android平臺的俄羅斯方塊。

整個(gè)程序設(shè)計(jì)十分簡潔,只是運(yùn)用了兩個(gè)類而已,最終做出的效果圖如下所示:
首先,要考慮的自然是游戲應(yīng)該如何布局的問題了。我的想法是將手機(jī)屏幕分為上下兩部分,上邊用來顯示游戲者的名稱、所得分?jǐn)?shù)以及下一個(gè)方塊,稱為“文字區(qū)域”,下邊自然就是游戲區(qū)域了。
如圖所示:
布局文件如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/linear" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/three" android:orientation="vertical" android:padding="25px" > <TextView android:id="@+id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/hh"/> <TextView android:id="@+id/text2" android:layout_width="match_parent" android:layout_height="wrap_content" android:height="30px" /> <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" > </FrameLayout> </LinearLayout>
當(dāng)前題目:一款適用于Android平臺的俄羅斯方塊-創(chuàng)新互聯(lián)
本文鏈接:http://chinadenli.net/article24/dsjpce.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站改版、全網(wǎng)營銷推廣、做網(wǎng)站、手機(jī)網(wǎng)站建設(shè)、響應(yīng)式網(wǎng)站、網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容