import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 2.4
import QtGraphicalEffects 1.0
import com.itsblue.qcookieclicker 1.0
import "./components"
Window {
visible: true
width: 540
height: 960
title: "QcookieClicker"
Page {
id: app
property int level: settings.read("score")
anchors.fill: parent
AppSettings {
id: settings
}
Label {
id: levelLa
anchors {
top: parent.top
horizontalCenter: parent.horizontalCenter
topMargin: 20
font.pixelSize: 30
text: app.level
GameButton {
id: cookieBt
imageSrc: "qrc:/icons/cookie.png"
anchors.centerIn: parent
height: parent.width * 0.6
onClicked: {
settings.write("score", parseInt(settings.read("score")) + 1)
app.level = settings.read("score")
Row {
id: menuRo
bottom: parent.bottom
bottomMargin: parent.height * 0.025
height: parent.height * 0.1
id: shopBt
imageSrc: "qrc:/icons/shop.png"
height: parent.height
shopPu.open()
Rectangle
{
id: popupModal
opacity: shopPu.opened ? 0.5:0
color: "black"
Behavior on opacity {
NumberAnimation {
duration: 200
ShopPopup {
id: shopPu
x: ( parent.width - width ) / 2
y: ( parent.height - height ) / 2
width: parent.width * 0.8