Juicy Squash Simple - Match-3 Game
import Felgo 4.0
import QtQuick 2.0
GameWindow {
id: gameWindow
activeScene: scene
screenWidth: 640
screenHeight: 960
onSplashScreenFinished: scene.startGame()
EntityManager {
id: entityManager
entityContainer: gameArea
}
FontLoader {
id: gameFont
source: Qt.resolvedUrl("../assets/fonts/akaDylan Plain.ttf")
}
Scene {
id: scene
width: 320
height: 480
property int score
BackgroundImage {
source: Qt.resolvedUrl("../assets/JuicyBackground.png")
anchors.centerIn: scene.gameWindowAnchorItem
}
Text {
font.family: gameFont.name
font.pixelSize: 12
color: "red"
text: scene.score
anchors.horizontalCenter: parent.horizontalCenter
y: 446
}
GameArea {
id: gameArea
anchors.horizontalCenter: scene.horizontalCenter
y: 20
blockSize: 30
onGameOver: gameOverWindow.show()
}
GameOverWindow {
id: gameOverWindow
y: 90
opacity: 0
anchors.horizontalCenter: scene.horizontalCenter
onNewGameClicked: scene.startGame()
}
function startGame() {
gameOverWindow.hide()
gameArea.initializeField()
scene.score = 0