Skip to content
Snippets Groups Projects
Commit 6194bdca authored by Delplanque Sara's avatar Delplanque Sara
Browse files
parents 0815734e 126fcf8b
No related branches found
No related tags found
No related merge requests found
...@@ -4,39 +4,50 @@ import QtQuick ...@@ -4,39 +4,50 @@ import QtQuick
Window { Window {
visible: true visible: true
width: 400 width: 400
height: 500 height: 600
title: qsTr("Application 2048") title: qsTr("Application 2048")
Text {
text: "Fusionnez les nombres pour atteindre 2048!"
font.bold: true
color:"grey"
anchors.horizontalCenter: parent.horizontalCenter
y:145
}
Rectangle{ Rectangle{
width:100;height:100 width:100;height:100
color:"orange" color:"orange"
x:25 x:25
y:10 y:10
radius:10 radius:4
Text { Text {
text:"2048" text:"2048"
color: "white" color: "white"
font.bold: true
font.pixelSize: 30
anchors.centerIn: parent anchors.centerIn: parent
} }
} }
Rectangle{ Rectangle{
color:"black" color:"grey"
width: 90; height: 50 width: 90; height: 90
x:270 x:270
y:10 y:10
radius:10 radius:5
Text{ Text{
text: "meilleur score" text: "MEILLEUR"
color:"white" color:"lightgrey"
font.pixelSize: 14
font.bold: true
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
y:5 y:10
} }
...@@ -45,9 +56,39 @@ Window { ...@@ -45,9 +56,39 @@ Window {
text:"0" text:"0"
color:"white" color:"white"
font.bold: true 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 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 { ...@@ -55,10 +96,10 @@ Window {
Rectangle { Rectangle {
id: buttonNew id: buttonNew
color:"#F65E3B" color:"#F65E3B"
width: 90; height: 40 width: 90; height: 30
x:160 x:165
y:65 y:105
radius:10 radius:5
Text{ Text{
id: buttonLabel id: buttonLabel
...@@ -80,10 +121,10 @@ Window { ...@@ -80,10 +121,10 @@ Window {
Rectangle { Rectangle {
id: undo id: undo
color: "#F65E3B" color: "#F65E3B"
width: 90; height: 40 width: 90; height: 30
x:270 x:270
y:65 y:105
radius:10 radius:5
Text{ Text{
...@@ -106,8 +147,8 @@ Window { ...@@ -106,8 +147,8 @@ Window {
Rectangle{ Rectangle{
width:350; height:350 width:350; height:350
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
y:120 y:170
color:"brown" color:"grey"
radius: 10 radius: 10
...@@ -116,16 +157,17 @@ Window { ...@@ -116,16 +157,17 @@ Window {
columns: 4 columns: 4
rows: 4 rows: 4
anchors.centerIn: parent anchors.centerIn: parent
spacing: 5 spacing: 8
padding:8
Repeater { Repeater {
model: 16 model: 16
Rectangle { Rectangle {
width: 80 width: 78
height: 80 height: 78
color: "lightgrey" color: "lightgrey"
border.color: "black"
radius:10 radius:10
Text { Text {
anchors.centerIn: parent anchors.centerIn: parent
...@@ -137,6 +179,9 @@ Window { ...@@ -137,6 +179,9 @@ Window {
} }
Item{
id: keyHandler
focus: true
Keys.onPressed: { Keys.onPressed: {
if (event.key === Qt.Key_Left) gameManager.moveLeft(); if (event.key === Qt.Key_Left) gameManager.moveLeft();
...@@ -147,3 +192,6 @@ Window { ...@@ -147,3 +192,6 @@ Window {
} }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment