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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Delplanque Sara
Application 2048
Commits
c392be23
Commit
c392be23
authored
3 months ago
by
Breitwiller Josephine
Browse files
Options
Downloads
Patches
Plain Diff
menu mise à jour
parent
ac866a43
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
applicationQT2048/MenuPage.qml
+77
-40
77 additions, 40 deletions
applicationQT2048/MenuPage.qml
applicationQT2048/gamemanager.cpp
+4
-11
4 additions, 11 deletions
applicationQT2048/gamemanager.cpp
with
81 additions
and
51 deletions
applicationQT2048/MenuPage.qml
+
77
−
40
View file @
c392be23
...
@@ -14,9 +14,19 @@ Rectangle {
...
@@ -14,9 +14,19 @@ Rectangle {
y
:
70
y
:
70
}
}
Text
{
text
:
"
Design du jeu
"
font.bold
:
true
color
:
"
grey
"
font.pixelSize
:
25
anchors.horizontalCenter
:
parent
.
horizontalCenter
y
:
120
}
MenuBar
{
MenuBar
{
y
:
22
0
y
:
18
0
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
background
:
Rectangle
{
color
:
"
#BBADA0
"
;
radius
:
5
}
background
:
Rectangle
{
color
:
"
#BBADA0
"
;
radius
:
5
}
...
@@ -25,7 +35,7 @@ Rectangle {
...
@@ -25,7 +35,7 @@ Rectangle {
MenuItem
{
MenuItem
{
text
:
"
Arial
"
text
:
"
Arial
"
background
:
Rectangle
{
color
:
"
black
"
;
radius
:
5
}
// Fond et coins arrondis
background
:
Rectangle
{
color
:
"
grey
"
;
radius
:
5
}
// Fond et coins arrondis
}
}
}
}
...
@@ -33,7 +43,7 @@ Rectangle {
...
@@ -33,7 +43,7 @@ Rectangle {
}
}
MenuBar
{
MenuBar
{
y
:
30
0
y
:
24
0
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
background
:
Rectangle
{
color
:
"
#BBADA0
"
;
radius
:
5
}
background
:
Rectangle
{
color
:
"
#BBADA0
"
;
radius
:
5
}
...
@@ -43,15 +53,20 @@ Rectangle {
...
@@ -43,15 +53,20 @@ Rectangle {
}
}
Text
{
Rectangle
{
text
:
"
Fonctionnalitées
"
color
:
"
red
"
font.bold
:
true
width
:
90
;
height
:
30
color
:
"
grey
"
font.pixelSize
:
25
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
y
:
150
y
:
300
radius
:
5
}
MenuBar
{
MenuBar
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
y
:
350
background
:
Rectangle
{
color
:
"
#BBADA0
"
;
radius
:
5
}
Menu
{
Menu
{
title
:
"
mode de jeu
"
title
:
"
mode de jeu
"
...
@@ -69,21 +84,24 @@ Rectangle {
...
@@ -69,21 +84,24 @@ Rectangle {
}
}
}
}
}
Rectangle
{
Text
{
text
:
"
accès à l'historique des parties
"
width
:
90
;
height
:
30
color
:
"
grey
"
font.pixelSize
:
20
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
y
:
250
y
:
390
radius
:
5
}
MenuBar
{
MenuBar
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
y
:
450
background
:
Rectangle
{
color
:
"
#BBADA0
"
;
radius
:
5
}
Menu
{
Menu
{
title
:
"
Charger une ancienne partie
"
title
:
"
Charger une ancienne partie
"
Repeater
{
Repeater
{
model
:
gameManager
.
partieHistorique
model
:
gameManager
.
partieHistorique
MenuItem
{
MenuItem
{
...
@@ -96,14 +114,33 @@ Rectangle {
...
@@ -96,14 +114,33 @@ Rectangle {
}
}
Rectangle
{
color
:
"
#BBADA0
"
width
:
150
;
height
:
30
anchors.horizontalCenter
:
parent
.
horizontalCenter
y
:
510
radius
:
5
Text
{
anchors.centerIn
:
parent
text
:
"
Supprimer l'historique
"
color
:
"
black
"
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
gameManager
.
supprimerHistorique
()
}
}
}
Rectangle
{
Rectangle
{
color
:
"
blue
"
color
:
"
blue
"
width
:
90
;
height
:
30
width
:
90
;
height
:
30
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
y
:
5
1
0
y
:
5
6
0
radius
:
5
radius
:
5
Text
{
Text
{
...
...
This diff is collapsed.
Click to expand it.
applicationQT2048/gamemanager.cpp
+
4
−
11
View file @
c392be23
...
@@ -206,15 +206,12 @@ void GameManager::restartGame(QString partieName) {
...
@@ -206,15 +206,12 @@ void GameManager::restartGame(QString partieName) {
//demander pour sauvergarder la partie précédente
//demander pour sauvergarder la partie précédente
<<<<<<<
HEAD
if
(
partieName
==
"false"
){
if
(
partieName
==
"false"
){}
else
{
}
else
{
enregistrerPartie
(
partieName
);
enregistrerPartie
(
partieName
);
};
};
=======
enregistrerPartie
(
"partie1"
);
m_gameOver
=
false
;
m_gameOver
=
false
;
>>>>>>>
e22daca7a3c09bd0a515d12093b0cbf7e3e4e152
// Réinitialisation des variables
// Réinitialisation des variables
...
@@ -405,19 +402,16 @@ void GameManager::chargerPartie(QString partieName){
...
@@ -405,19 +402,16 @@ void GameManager::chargerPartie(QString partieName){
}
}
emit
gridChanged
();
// Notifiez que la grille a changé
emit
gridChanged
();
// Notifiez que la grille a changé
file
.
close
();
file
.
close
();
calculscore
();
}
}
int
GameManager
::
score
()
const
{
int
GameManager
::
score
()
const
{
return
m_score
;
// Retourne le score actuel
return
m_score
;
// Retourne le score actuel
}
}
<<<<<<<
HEAD
=======
void
GameManager
::
calculscore
(){
void
GameManager
::
calculscore
(){
if
(
m_gameOver
)
{
// Si la partie est terminée, ne calcule pas le score
if
(
m_gameOver
)
{
// Si la partie est terminée, ne calcule pas le score
return
;
return
;
...
@@ -448,4 +442,3 @@ bool GameManager::isGameOver() {
...
@@ -448,4 +442,3 @@ bool GameManager::isGameOver() {
}
}
return
true
;
// Si la grille est pleine et aucune fusion n'est possible, la partie est terminée
return
true
;
// Si la grille est pleine et aucune fusion n'est possible, la partie est terminée
}
}
>>>>>>>
e22daca7a3c09bd0a515d12093b0cbf7e3e4e152
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