俄羅斯方塊Tetris是一款很經典的益智游戲,之前就做了一款桌面版的java俄羅斯方塊,這次就嘗試著寫了一款適用于Android平臺的俄羅斯方塊。
整個程序設計十分簡潔,只是運用了兩個類而已,最終做出的效果圖如下所示:
首先,要考慮的自然是游戲應該如何布局的問題了。我的想法是將手機屏幕分為上下兩部分,上邊用來顯示游戲者的名稱、所得分數以及下一個方塊,稱為“文字區(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>
當前題目:一款適用于Android平臺的俄羅斯方塊-創(chuàng)新互聯(lián)
本文鏈接:http://chinadenli.net/article24/dsjpce.html
成都網站建設公司_創(chuàng)新互聯(lián),為您提供網站改版、全網營銷推廣、做網站、手機網站建設、響應式網站、網站建設
聲明:本網站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內容