arkivanov / Minesweeper

Minesweeper game implemented in Kotlin and Compose Multiplatform
https://arkivanov.github.io/Minesweeper/
Apache License 2.0
74 stars 2 forks source link

Implementing counter of remaining mines #11

Closed b0r1ngx closed 7 months ago

b0r1ngx commented 7 months ago

Want to add some things to your repository, one of it counter of remaining bombs.

Can u check code (for correct usage, code-style) and approve to add these features

Reference (upper-left corner):

image
arkivanov commented 7 months ago

Could you please also attach a screenshot? I'm curious how it looks like?

b0r1ngx commented 7 months ago

Could you please also attach a screenshot? I'm curious how it looks like?

im thinking about how to do it right: 1) leave RestartButton at center, and place counter lefty from it 2) or make how i make it with Row, because in next iteration i'm also want to add a stopwatch

Screenshot how it looks now:

image
arkivanov commented 7 months ago

It would be nice to keep the reset button centered. Both counters can have weight=1 and horizontally centered text.

b0r1ngx commented 7 months ago

done, please check @arkivanov

b0r1ngx commented 7 months ago

It would be nice to keep the reset button centered. Both counters can have weight=1 and horizontally centered text.

not saw, this message, think to update for it, wait please:c

b0r1ngx commented 7 months ago

@arkivanov not so perfect, but its start looks like that (where "000", is reserved for stopwatch)

image
arkivanov commented 7 months ago

Thanks! I will add proper assets (images) a bit later and then we can update the design.

arkivanov commented 7 months ago

I've added digit icons, see #13.

b0r1ngx commented 7 months ago

I've added digit icons, see #13.

Yea, i've checked it out, it looks awesome, I want to try to use it too see how it would look.

When I tried this repo in the game and started implementing counter - I thought that it was good to add some fonts to stylise the app more as classic. Which approach is better (subjective, how do you think?):

I'd also like to use images in this case because we use only [0-9-]:)

arkivanov commented 7 months ago

Since this project resembles the original Win9x Minesweeper design, it would be good to use the digit images. We can convert numbers to strings padded with zeros (taking special care for negative numbers), and then just iterate through chars and render digit images.

b0r1ngx commented 7 months ago

Since this project resembles the original Win9x Minesweeper design, it would be good to use the digit images. We can convert numbers to strings padded with zeros (taking special care for negative numbers), and then just iterate through chars and render digit images.

Yea, I understand how to work in many ways, now trying to understand how implement it here as good as possible, first sketch looks like..

image

(trying to understand why Compose Images, increase their sizes like a square-shaped thing, even using .height instead of .size modifiers, but I think that I try to solve it myself)

arkivanov commented 7 months ago

I think we need to set width and height explicitly for every image. It should be the same as the actual size of the images.