Змейка на Android: Пошаговое руководство по созданию классической игры - страница 2



Пример структуры XML для игрового интерфейса может выглядеть так:

```xml

android:layout_height="match_parent">

android:id="@+id/tvScore"


android:layout_width="wrap_content" android:layout_height="wrap_content"

android:text="Счет: 0"

android:textSize="24sp"

android:layout_alignParentTop="true" android:layout_centerHorizontal="true"/>

android:id="@+id/surfaceView"

android:layout_width="match_parent" android:layout_height="match_parent"

android:layout_below="@id/tvScore"/>

android:orientation="horizontal"

android:gravity="center">

android:id="@+id/btnLeft"

android:layout_width="wrap_content" android:layout_height="wrap_content"

android:text="Влево" />