mirror of
https://github.com/jlengrand/korge-samples.git
synced 2026-03-10 08:31:18 +00:00
Some minesweeper adjustments
This commit is contained in:
@@ -45,8 +45,8 @@ class Board(
|
||||
//timeText = Text("", 50, 50, Text.Align.center, Text.Align.middle, Color.white, Font.fromResource("font.ttf", 40));
|
||||
val FONT_HEIGHT = 32.0
|
||||
timeText = text("", textSize = FONT_HEIGHT).xy((bwidth * imageset.height) / 2, -FONT_HEIGHT).apply {
|
||||
//format = Html.Format(align = Html.Alignment.CENTER, size = FONT_HEIGHT.toInt())
|
||||
format = Html.Format(align = Html.Alignment.CENTER)
|
||||
format = Html.Format(align = Html.Alignment.CENTER, size = FONT_HEIGHT.toInt())
|
||||
//format = Html.Format(align = Html.Alignment.CENTER, face = defaultUIFont)
|
||||
}
|
||||
// Se pinta el contador como hijo del tablero
|
||||
//timeText.group.z = this;
|
||||
|
||||
@@ -148,8 +148,8 @@ class Key2(val views: Views) {
|
||||
class MouseV(val views: Views) {
|
||||
val left: Boolean get() = pressing[0]
|
||||
val right: Boolean get() = pressing[1] || pressing[2]
|
||||
val x: Int get() = (views.input.mouse.x / views.stage.scaleX).toInt()
|
||||
val y: Int get() = (views.input.mouse.y / views.stage.scaleY).toInt()
|
||||
val x: Int get() = (views.stage.localMouseX(views)).toInt()
|
||||
val y: Int get() = (views.stage.localMouseY(views)).toInt()
|
||||
val pressing = BooleanArray(8)
|
||||
val pressed = BooleanArray(8)
|
||||
val released = BooleanArray(8)
|
||||
@@ -224,4 +224,3 @@ fun <T : Bitmap> BitmapSlice<T>.split(width: Int, height: Int): List<BmpSlice> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,17 +15,17 @@ class MainProcess(parent: Container) : Process(parent) {
|
||||
val lights = arrayListOf<RandomLight>()
|
||||
|
||||
override suspend fun main() {
|
||||
val light = readImage("light.png")
|
||||
image(readImage("bg.jpg"))
|
||||
for (n in 0 until 20) {
|
||||
lights += RandomLight(this, light)
|
||||
}
|
||||
|
||||
val light = readImage("light.png")
|
||||
val imageset = readImage("buscaminas.png")
|
||||
val imagenes = imageset.split(imageset.height, imageset.height)
|
||||
val click = readSound("click.wav")
|
||||
val boom = readSound("boom.wav")
|
||||
|
||||
for (n in 0 until 20) {
|
||||
lights += RandomLight(this, light)
|
||||
}
|
||||
|
||||
val board = Board(this, imageset, imagenes, click, boom, 22, 15, 40)
|
||||
|
||||
while (true) {
|
||||
|
||||
Reference in New Issue
Block a user