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
80228ed1
Commit
80228ed1
authored
Mar 11, 2019
by
Konrad McClure
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autosave
parent
e57ab6cc
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
134 additions
and
0 deletions
+134
-0
GameEngine/2048ScoreState.cpp
GameEngine/2048ScoreState.cpp
+78
-0
GameEngine/2048ScoreState.h
GameEngine/2048ScoreState.h
+32
-0
GameEngine/2048ScoreTitle.txt
GameEngine/2048ScoreTitle.txt
+12
-0
GameEngine/SnakeScoreTitle.txt
GameEngine/SnakeScoreTitle.txt
+12
-0
Testings/SaveLoad/2048Data.txt
Testings/SaveLoad/2048Data.txt
+0
-0
Testings/SaveLoad/SL2048.cpp
Testings/SaveLoad/SL2048.cpp
+0
-0
Testings/SaveLoad/SL2048.h
Testings/SaveLoad/SL2048.h
+0
-0
Testings/SaveLoad/SLSnake.cpp
Testings/SaveLoad/SLSnake.cpp
+0
-0
Testings/SaveLoad/SLSnake.h
Testings/SaveLoad/SLSnake.h
+0
-0
Testings/SaveLoad/SaveLoad.cpp
Testings/SaveLoad/SaveLoad.cpp
+0
-0
Testings/SaveLoad/SaveLoad.h
Testings/SaveLoad/SaveLoad.h
+0
-0
Testings/SaveLoad/Scores.h
Testings/SaveLoad/Scores.h
+0
-0
Testings/SaveLoad/main.cpp
Testings/SaveLoad/main.cpp
+0
-0
Testings/SaveLoad/snakedata.txt
Testings/SaveLoad/snakedata.txt
+0
-0
No files found.
GameEngine/2048ScoreState.cpp
0 → 100644
View file @
80228ed1
#include <iostream>
#include "2048ScoreState.h"
#include <string>
#include <fstream>
#include <streambuf>
using
namespace
std
;
C2048ScoreState
C2048ScoreState
::
m_2048ScoreState
;
void
C2048ScoreState
::
Init
()
{
// Load in main menu title
ifstream
fs
(
"2048ScoreTitle.txt"
);
fs
.
seekg
(
0
,
ios
::
end
);
menuTitle
.
reserve
(
fs
.
tellg
());
fs
.
seekg
(
0
,
ios
::
beg
);
menuTitle
.
assign
((
istreambuf_iterator
<
char
>
(
fs
)),
istreambuf_iterator
<
char
>
());
// Set name for debugging
stateName
=
"2048score"
;
// Set first input and draw the menu
input
=
' '
;
Draw
(
nullptr
);
}
void
C2048ScoreState
::
Pause
()
{
}
void
C2048ScoreState
::
Resume
()
{
input
=
0
;
}
void
C2048ScoreState
::
Cleanup
()
{
}
void
C2048ScoreState
::
HandleEvents
(
CGameEngine
*
game
)
{
while
(
game
->
newInput
==
false
)
{
input
=
' '
;
}
input
=
game
->
input
;
game
->
newInput
=
false
;
}
void
C2048ScoreState
::
Update
(
CGameEngine
*
game
)
{
switch
(
input
)
{
case
'x'
:
// Erase Scores
break
;
default:
game
->
PopState
();
break
;
}
}
void
C2048ScoreState
::
Draw
(
CGameEngine
*
game
)
{
system
(
"stty cooked"
);
cout
<<
menuTitle
<<
endl
;
cout
<<
"
\n\n\n
"
<<
"Press w and s to move up and down, d to select"
<<
endl
;
system
(
"stty raw"
);
}
GameEngine/2048ScoreState.h
0 → 100644
View file @
80228ed1
#ifndef C2048SCORESTATE_H
#define C2048SCORESTATE_H
#include "GameState.h"
#include <iostream>
#include <string>
class
C2048ScoreState
:
public
CGameState
{
public:
void
Init
();
void
Cleanup
();
void
Pause
();
void
Resume
();
void
HandleEvents
(
CGameEngine
*
game
);
void
Update
(
CGameEngine
*
game
);
void
Draw
(
CGameEngine
*
game
);
static
C2048ScoreState
*
Instance
()
{
return
&
m_2048ScoreState
;
}
protected:
C2048ScoreState
()
{}
private:
static
C2048ScoreState
m_2048ScoreState
;
char
input
;
};
#endif
\ No newline at end of file
GameEngine/2048ScoreTitle.txt
0 → 100644
View file @
80228ed1
==================================================================================
|| ___ ___ _ _ ___ _ _ _ _ _____ ||
|| |__ \ / _ \| || | / _ \ | | | (_) | | / ____| ||
|| ) | | | | || || (_) | | |__| |_ __ _| |__ | (___ ___ ___ _ __ ___ ___ ||
|| / /| | | |__ _> _ < | __ | |/ _` | '_ \ \___ \ / __/ _ \| '__/ _ \/ __| ||
|| / /_| |_| | | || (_) | | | | | | (_| | | | | ____) | (_| (_) | | | __/\__ \ ||
|| |____|\___/ |_| \___/ |_| |_|_|\__, |_| |_| |_____/ \___\___/|_| \___||___/ ||
|| __/ | ||
|| |___/ ||
==================================================================================
\ No newline at end of file
GameEngine/SnakeScoreTitle.txt
0 → 100644
View file @
80228ed1
=======================================================================================
|| _____ _ _ _ _ _ _____ ||
|| / ____| | | | | | (_) | | / ____| ||
|| | (___ _ __ __ _| | _____ | |__| |_ __ _| |__ | (___ ___ ___ _ __ ___ ___ ||
|| \___ \| '_ \ / _` | |/ / _ \ | __ | |/ _` | '_ \ \___ \ / __/ _ \| '__/ _ \/ __| ||
|| ____) | | | | (_| | < __/ | | | | | (_| | | | | ____) | (_| (_) | | | __/\__ \ ||
|| |_____/|_| |_|\__,_|_|\_\___| |_| |_|_|\__, |_| |_| |_____/ \___\___/|_| \___||___/ ||
|| __/ | ||
|| |___/ ||
=======================================================================================
\ No newline at end of file
Testings/
Kyle's Folder
/2048Data.txt
→
Testings/
SaveLoad
/2048Data.txt
View file @
80228ed1
File moved
Testings/
Kyle's Folder
/SL2048.cpp
→
Testings/
SaveLoad
/SL2048.cpp
View file @
80228ed1
File moved
Testings/
Kyle's Folder
/SL2048.h
→
Testings/
SaveLoad
/SL2048.h
View file @
80228ed1
File moved
Testings/
Kyle's Folder
/SLSnake.cpp
→
Testings/
SaveLoad
/SLSnake.cpp
View file @
80228ed1
File moved
Testings/
Kyle's Folder
/SLSnake.h
→
Testings/
SaveLoad
/SLSnake.h
View file @
80228ed1
File moved
Testings/
Kyle's Folder
/SaveLoad.cpp
→
Testings/
SaveLoad
/SaveLoad.cpp
View file @
80228ed1
File moved
Testings/
Kyle's Folder
/SaveLoad.h
→
Testings/
SaveLoad
/SaveLoad.h
View file @
80228ed1
File moved
Testings/
Kyle's Folder
/Scores.h
→
Testings/
SaveLoad
/Scores.h
View file @
80228ed1
File moved
Testings/
Kyle's Folder
/main.cpp
→
Testings/
SaveLoad
/main.cpp
View file @
80228ed1
File moved
Testings/
Kyle's Folder
/snakedata.txt
→
Testings/
SaveLoad
/snakedata.txt
View file @
80228ed1
File moved
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