2022-06-03 11:26:02 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2018-06-26 13:53:07 +00:00
|
|
|
|
2020-12-01 12:57:32 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Particles
|
2018-06-26 13:53:07 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: gameOverScreen
|
|
|
|
width: 320
|
|
|
|
height: 400
|
|
|
|
property GameCanvas gameCanvas
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: img
|
|
|
|
source: "gfx/text-gameover.png"
|
|
|
|
anchors.centerIn: parent
|
|
|
|
}
|
|
|
|
|
|
|
|
ParticleSystem {
|
|
|
|
anchors.fill: parent
|
|
|
|
ImageParticle {
|
|
|
|
id: cloud
|
|
|
|
source: "gfx/cloud.png"
|
|
|
|
alphaVariation: 0.25
|
|
|
|
opacity: 0.25
|
|
|
|
}
|
|
|
|
|
|
|
|
Wander {
|
|
|
|
xVariance: 100;
|
|
|
|
pace: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
Emitter {
|
|
|
|
id: cloudLeft
|
|
|
|
width: 160
|
|
|
|
height: 160
|
|
|
|
anchors.right: parent.left
|
|
|
|
emitRate: 0.5
|
|
|
|
lifeSpan: 12000
|
|
|
|
velocity: PointDirection{ x: 64; xVariation: 2; yVariation: 2 }
|
|
|
|
size: 160
|
|
|
|
}
|
|
|
|
|
|
|
|
Emitter {
|
|
|
|
id: cloudRight
|
|
|
|
width: 160
|
|
|
|
height: 160
|
|
|
|
anchors.left: parent.right
|
|
|
|
emitRate: 0.5
|
|
|
|
lifeSpan: 12000
|
|
|
|
velocity: PointDirection{ x: -64; xVariation: 2; yVariation: 2 }
|
|
|
|
size: 160
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Text {
|
2024-07-05 17:41:58 +00:00
|
|
|
visible: gameOverScreen.gameCanvas != undefined
|
|
|
|
text: "You saved " + gameOverScreen.gameCanvas.score + " fishes!"
|
2018-06-26 13:53:07 +00:00
|
|
|
anchors.top: img.bottom
|
|
|
|
anchors.topMargin: 12
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
font.bold: true
|
|
|
|
color: "#000000"
|
|
|
|
opacity: 0.5
|
|
|
|
}
|
|
|
|
|
|
|
|
Image {
|
|
|
|
source: "gfx/button-play.png"
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 0
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
2024-07-05 17:41:58 +00:00
|
|
|
onClicked: gameOverScreen.gameCanvas.gameOver = false//This will actually trigger the state change in Main.qml
|
2018-06-26 13:53:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|