diff --git a/applicationQT2048/Main.qml b/applicationQT2048/Main.qml index 8a5a673d239794321b8a5e27769311031d3ee704..70afa817783317824b1dad37a93da98fa91853ca 100644 --- a/applicationQT2048/Main.qml +++ b/applicationQT2048/Main.qml @@ -4,39 +4,50 @@ import QtQuick Window { visible: true width: 400 - height: 500 + height: 600 title: qsTr("Application 2048") + Text { + + text: "Fusionnez les nombres pour atteindre 2048!" + font.bold: true + color:"grey" + anchors.horizontalCenter: parent.horizontalCenter + y:145 + } Rectangle{ width:100;height:100 color:"orange" x:25 y:10 - radius:10 + radius:4 Text { text:"2048" color: "white" - + font.bold: true + font.pixelSize: 30 anchors.centerIn: parent } } Rectangle{ - color:"black" - width: 90; height: 50 + color:"grey" + width: 90; height: 90 x:270 y:10 - radius:10 + radius:5 Text{ - text: "meilleur score" - color:"white" + text: "MEILLEUR" + color:"lightgrey" + font.pixelSize: 14 + font.bold: true anchors.horizontalCenter: parent.horizontalCenter - y:5 + y:10 } @@ -45,9 +56,39 @@ Window { text:"0" color:"white" font.bold: true - font.pixelSize: 20 + font.pixelSize: 25 + anchors.centerIn:parent + + + } + } + + Rectangle{ + + color:"grey" + width: 90; height: 90 + x:165 + y:10 + radius:5 + + Text{ + text: "SCORE" + color:"lightgrey" + font.pixelSize: 14 + font.bold: true anchors.horizontalCenter: parent.horizontalCenter - y:20 + y:10 + + } + + Text{ + id: score + text:"0" + color:"white" + font.bold: true + font.pixelSize: 25 + anchors.centerIn:parent + } } @@ -55,10 +96,10 @@ Window { Rectangle { id: buttonNew color:"#F65E3B" - width: 90; height: 40 - x:160 - y:65 - radius:10 + width: 90; height: 30 + x:165 + y:105 + radius:5 Text{ id: buttonLabel @@ -80,10 +121,10 @@ Window { Rectangle { id: undo color: "#F65E3B" - width: 90; height: 40 + width: 90; height: 30 x:270 - y:65 - radius:10 + y:105 + radius:5 Text{ @@ -106,8 +147,8 @@ Window { Rectangle{ width:350; height:350 anchors.horizontalCenter: parent.horizontalCenter - y:120 - color:"brown" + y:170 + color:"grey" radius: 10 @@ -116,16 +157,17 @@ Window { columns: 4 rows: 4 anchors.centerIn: parent - spacing: 5 + spacing: 8 + padding:8 Repeater { model: 16 Rectangle { - width: 80 - height: 80 + width: 78 + height: 78 color: "lightgrey" - border.color: "black" + radius:10 Text { anchors.centerIn: parent @@ -137,13 +179,19 @@ Window { } + Item{ + id: keyHandler + focus: true - Keys.onPressed: { - if (event.key === Qt.Key_Left) gameManager.moveLeft(); - else if (event.key === Qt.Key_Right) gameManager.moveRight(); - else if (event.key === Qt.Key_Up) gameManager.moveUp(); - else if (event.key === Qt.Key_Down) gameManager.moveDown(); + Keys.onPressed: { + if (event.key === Qt.Key_Left) gameManager.moveLeft(); + else if (event.key === Qt.Key_Right) gameManager.moveRight(); + else if (event.key === Qt.Key_Up) gameManager.moveUp(); + else if (event.key === Qt.Key_Down) gameManager.moveDown(); + } } + + }