Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RogueReborn
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mikhail Andrenkov
RogueReborn
Commits
9a5e536b
Commit
9a5e536b
authored
8 years ago
by
Ian Prins
Browse files
Options
Downloads
Patches
Plain Diff
remove unused code
parent
d317630a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.cpp
+0
-114
0 additions, 114 deletions
src/main.cpp
with
0 additions
and
114 deletions
src/main.cpp
+
0
−
114
View file @
9a5e536b
...
...
@@ -20,118 +20,4 @@ void putString(int x, int y, std::string text) {
int
main
(
int
argv
,
char
**
args
)
{
MasterController
controller
;
controller
.
run
();
/*
std::cout << "Welcome to Rogue Reborn!" << std::endl;
TCODConsole::setCustomFont("assets/terminal-large.png");
PlayerChar player(Coord(10, 10));
auto level = Level(0);
level.generate(player);
//Init console
TCODConsole::initRoot(level.getSize()[0], level.getSize()[1] + 5, "Rogue Reborn", false);
//Game loop
while (!TCODConsole::isWindowClosed()) {
//Handle user input
TCOD_key_t key;
TCODSystem::checkForEvent(TCOD_EVENT_KEY_PRESS, &key, NULL);
//Arrow controls
auto newPos = player.getCoord().copy();
if (key.vk == TCODK_UP) {
newPos -= Coord(0, 1);
} else if (key.vk == TCODK_DOWN) {
newPos += Coord(0, 1);
} else if (key.vk == TCODK_LEFT) {
newPos -= Coord(1, 0);
} else if (key.vk == TCODK_RIGHT) {
newPos += Coord(1, 0);
}
if (newPos != player.getCoord() && level.contains(newPos) and level[newPos].isPassable()) {
player.setCoord(newPos);
}
//Keypad controls
switch (key.vk){
case TCODK_KP1:
if ((py < mapy-1 and px > 0) and map[px-1][py+1] == 0) {
py += 1;
px -= 1;
}
break;
case TCODK_KP2:
if (py < mapy-1 and map[px][py+1] == 0) {
py += 1;
}
break;
case TCODK_KP3:
if ((py < mapy-1 and px < mapx-1) and map[px+1][py+1] == 0) {
py += 1;
px += 1;
}
break;
case TCODK_KP4:
if (px > 0 and map[px-1][py] == 0) {
px -= 1;
}
break;
case TCODK_KP6:
if (px < mapx-1 and map[px+1][py] == 0) {
px += 1;
}
break;
case TCODK_KP7:
if ((py > 0 and px > 0) and map[px-1][py-1] == 0) {
py -= 1;
px -= 1;
}
break;
case TCODK_KP8:
if (py > 0 and map[px][py-1] == 0) {
py -= 1;
}
break;
case TCODK_KP9:
if ((py > 0 and px < mapx-1) and map[px+1][py-1] == 0) {
py -= 1;
px += 1;
}
break;
default:
break;
}
//Redraw
TCODConsole::root->clear();
for (auto x=0; x < level.getSize()[0]; x++) {
for (auto y=0; y < level.getSize()[1]; y++) {
TCODConsole::root->putChar(x, y, level[Coord(x, y)].getChar());
}
}
putString(0, 26, "test");
//Place player
TCODConsole::root->putChar(player[0], player[1],'@');
//Push changes to screen
TCODConsole::flush();
}
return 0;*/
}
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