Skip to content
Snippets Groups Projects
Commit ac7aba0a authored by Jake Feddersen's avatar Jake Feddersen
Browse files

Test and clean up for submission

parent bcfcae03
No related branches found
No related tags found
No related merge requests found
......@@ -37,3 +37,11 @@
2/27: Fix memory leaks using valgrind
Test the monster types and verify reasonable behaviour from each
Add ascii art win/loss messages
3/8: Import ncurses library
Convert dungeon I/O to ncurses
Add player-controlled movement
Add basic monsters screen
3/9: Make the monsters screen prettier
Implement going up and down stairs
Add status messages to the screen on certain events
Remove obsolete command line flags
Rogue-Like Game COMS 327
Generates or loads a dungeon map and optionally saves it to a file.
Generates random monsters in the dungeon, and runs the game
autonomously until the pc either wins or loses.
Generates random monsters in the dungeon, and runs based on player
input until the game is over.
Compile: `make`
Run: `./rlg327 [OPTIONS]`
......@@ -9,10 +9,9 @@ Run `./rlg327 -h` for a full list and description of options.
The game generates/loads the map as before. The player character is spawned
in a random position, as well as the monsters as specified on the command
line. The PC wanders the dungeon randomly, and the monsters chase it until
they kill the PC or are all dead.
line. The PC is player-controlled now, according to the key mappings given.
I implemented the turn queue using Dr. Sheaffer's heap again. I implemented
all 16 monster types described in the assignment, though it is sometimes hard
to observe their behaviors because the game ends so quickly. I also
implemented line of sight for the monsters based on Bresenham's line algorithm.
The monsters screen displays all of the monsters in the dungeon in a list.
Since there isn't room for it on the screen, it overwrites the dungeon map
while active. Q still quits the game while on the monsters screen. Dungeon
levels are not persistent and stairs are not connected.
File deleted
#include <ncurses.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
// Init curses
initscr();
cbreak();
noecho();
curs_set(0);
clear();
addch('a');
addch('b');
mvaddch(5, 5, 'c');
addch('d');
mvaddch(6, 6, 'e');
mvaddch(6, 8, 'f');
mvaddstr(LINES-1, 0, "This is the last line");
refresh();
usleep(1000000);
mvaddch(10, 10, '!');
usleep(1000000);
mvaddch(11, 11, '?');
refresh();
getch();
endwin();
}
......@@ -9,9 +9,10 @@ for file in glob.glob("*.rlg327"):
run_sync('cp ' + file + ' ' + os.environ['HOME'] + '/.rlg327/dungeon')
run_sync('cp ' + file + ' ' + os.environ['HOME'] + '/.rlg327/dungeon_untouched')
result = run_sync('../feddersen_jacob.assignment-1.04/rlg327 --load --save --step=0')
result = run_sync('../feddersen_jacob.assignment-1.05/rlg327 --load --save')
diff = run_sync('diff ' + os.environ['HOME'] + '/.rlg327/dungeon ' + os.environ['HOME'] + '/.rlg327/dungeon_untouched');
if (diff != ""):
print("ERROR!");
\ No newline at end of file
else:
print("File checks out!");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment