Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
1
142GameCenter
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nelson Phillips
142GameCenter
Commits
0e710492
Commit
0e710492
authored
Mar 18, 2019
by
Konrad McClure
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autosave
parent
ea79e367
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
3 deletions
+27
-3
GameEngine/2048GameOverState.cpp
GameEngine/2048GameOverState.cpp
+17
-1
GameEngine/2048GameOverState.h
GameEngine/2048GameOverState.h
+1
-0
GameEngine/SnakeGameOverState.cpp
GameEngine/SnakeGameOverState.cpp
+5
-2
SaveLoad/2048Data.txt
SaveLoad/2048Data.txt
+1
-0
SaveLoad/snakedata.txt
SaveLoad/snakedata.txt
+3
-0
No files found.
GameEngine/2048GameOverState.cpp
View file @
0e710492
...
...
@@ -57,11 +57,16 @@ void C2048GameOverState::HandleEvents(CGameEngine* game)
if
(
!
scoreSet
)
{
system
(
"stty cooked"
);
cout
<<
"Press enter to continue"
<<
endl
;
game
->
inputPause
=
true
;
while
(
game
->
newInput
==
false
)
{}
highscores
.
userInputNameMakeScore
(
game
->
GetScore
());
userRank
=
highscores
.
userInputNameMakeScore
(
game
->
GetScore
());
scoreSet
=
true
;
system
(
"stty raw"
);
game
->
inputPause
=
false
;
}
...
...
@@ -99,6 +104,17 @@ void C2048GameOverState::Draw(CGameEngine* game)
highscores
.
displayScores
();
if
(
scoreSet
)
{
cout
<<
endl
<<
"Your score:"
<<
endl
;
highscores
.
useRankFindScore
(
userRank
);
}
if
(
scoreSet
)
{
cout
<<
"Press x to return to main menu"
<<
endl
;
}
highscores
.
updateFile
(
"../SaveLoad/2048Data.txt"
);
system
(
"stty raw"
);
...
...
GameEngine/2048GameOverState.h
View file @
0e710492
...
...
@@ -29,6 +29,7 @@ class C2048GameOverState : public CGameState
char
input
;
string
menuTitle
;
SL2048
highscores
;
int
userRank
=
0
;
bool
isInit
=
false
;
bool
scoreSet
=
false
;
...
...
GameEngine/SnakeGameOverState.cpp
View file @
0e710492
...
...
@@ -111,8 +111,11 @@ void CSnakeGameOverState::Draw(CGameEngine* game)
highscores
.
useRankFindScore
(
userRank
);
}
cout
<<
"Press x to return to main menu"
<<
endl
;
if
(
scoreSet
)
{
cout
<<
"Press x to return to main menu"
<<
endl
;
}
highscores
.
updateFile
(
"../SaveLoad/snakedata.txt"
);
system
(
"stty raw"
);
...
...
SaveLoad/2048Data.txt
View file @
0e710492
...
...
@@ -16,6 +16,7 @@ bvn 1268
POP 636
kom 428
vbv 172
dip 128
asd 68
dad 36
kkk 0
SaveLoad/snakedata.txt
View file @
0e710492
...
...
@@ -11,3 +11,6 @@ aaa 10
aaa 5
sss 5
aaa 1
kko 1
dip 0
mko 0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment