A rambling train of thought that vaguely deals with Roguelikes, D&D, and Programming
Monday, March 7, 2011
7DRL Day 3
Today I worked on getting the map to display right and shift along when the player gets to the edge. I also did the start screen and detailed the flavor for the game. The '<' in the screen just represents the place you start at and nothing more.
I was able to use the following code to place the start area in the upper left corner and plan to use an inversion of it to place the Boss in the other corner.
bool testwalk = false; int startX=0, startY=0;
while (!testwalk)
{
if (map.tile[startY, startX].Walkable) { testwalk = true; }
else if (startY < startX) { startY++; }
else { startX++; }
}
map.tile[startY, startX].Symbol = '<';
map.tile[startY, startX].Walkable = false;
player = new Player(10, true, startX, startY, '@', TermColor.White);
I set the map.tile.walkable that the player is on to start so that monsters an stuff do not walk onto it. When you move it resets it to true and your new position to back to false. the "player" has in order hp, alive, x, y, symbol, and the color. Tomorrow or the next day there will also be soul strength.
I did not do all that I wanted today but because of collage I did not have the time. My '@' now walks in rooms and hallways only and not in the walls so once I get it so it does not automatically show the whole map it will at least be interesting to explore. Because of how I set it up Visibility is its own thing so you will be able to see through monsters but not walk into their square and stand on them.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment