Add game timer

This commit is contained in:
ItsDrike 2024-12-08 14:02:04 +01:00
parent 7ef0ade0b3
commit e46d153604
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -50,10 +50,19 @@ ApplicationWindow {
property real cardHeight: Math.min((app.height - Math.min(app.height * 0.08, 50)) / (maxCardsPerColumn * 0.2 + 2.65), (app.width / 8.05) * 1.4) property real cardHeight: Math.min((app.height - Math.min(app.height * 0.08, 50)) / (maxCardsPerColumn * 0.2 + 2.65), (app.width / 8.05) * 1.4)
property real cardWidth: cardHeight / 1.4 property real cardWidth: cardHeight / 1.4
Timer {
id: gameTimer
interval: 1000
running: true
repeat: true
onTriggered: scoreBar.time += 1
}
ScoreBar { ScoreBar {
id: scoreBar id: scoreBar
moves: GameState.moveAmount moves: GameState.moveAmount
time: 0
height: Math.max(parent.height * 0.08, 50) height: Math.max(parent.height * 0.08, 50)
anchors.top: parent.top anchors.top: parent.top