Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Application 2048
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Delplanque Sara
Application 2048
Commits
6194bdca
Commit
6194bdca
authored
2 months ago
by
Delplanque Sara
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' of
https://gitlab.ec-lyon.fr/sdelplan/application-2048
parents
0815734e
126fcf8b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
applicationQT2048/Main.qml
+77
-29
77 additions, 29 deletions
applicationQT2048/Main.qml
with
77 additions
and
29 deletions
applicationQT2048/Main.qml
+
77
−
29
View file @
6194bdca
...
@@ -4,39 +4,50 @@ import QtQuick
...
@@ -4,39 +4,50 @@ import QtQuick
Window
{
Window
{
visible
:
true
visible
:
true
width
:
400
width
:
400
height
:
5
00
height
:
6
00
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
:
5
0
width
:
90
;
height
:
9
0
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
:
4
0
width
:
90
;
height
:
3
0
x
:
16
0
x
:
16
5
y
:
6
5
y
:
10
5
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
:
4
0
width
:
90
;
height
:
3
0
x
:
270
x
:
270
y
:
6
5
y
:
10
5
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
:
1
2
0
y
:
1
7
0
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
:
8
0
width
:
7
8
height
:
8
0
height
:
7
8
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 {
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment