george 1ccb52cfb5 Этап 1: Змейка на Jetpack Compose
Простое Android-приложение для студентов: классическая «Змейка»
на одном экране (Compose Canvas + игровой цикл на корутине).

- управление свайпами, тап для рестарта
- сетка 20x30, рост змейки, счёт и рекорд за сессию
- стек: Kotlin, Jetpack Compose, AGP 8.13.2 / Gradle 8.13

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 16:41:06 +03:00

18 lines
515 B
Kotlin
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.example.snake
import android.os.Bundle
import android.view.WindowManager
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Не гасим экран во время игры
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
setContent {
SnakeGame()
}
}
}