#SimpleRL The C# library for writing RogueLike games
##API todo
##Examples All example projects use E?M? naming. Here E? - group and M? - project number in group.
- E1 - BASE EXAMPLES
- E1M1 - Hello world
- E1M2 - Simple events loop
- E1M3 - Load canvas content
- E1M4 - Mouse painter
- E1M5 - Working with config helper
- E1M6 - Lines
- E2 - GAME EXAMPLES
- E2M1 - Simple maze game
- E2M2 - Random maze game
- E2M3 - Extended maze game
- E2M4 - 3D Maze
- E2M5 - FOV
- E2M6 - Kobolds Cave
- E3 - UI EXAMPLES
- E3M1 - Simple UI with textboxes
- E3M2 - Panel Example
- E3M3 - Colored string
- E3M4 - Menu
- E4 - UTILS
- E4M1 - Cellular cave generation
You can control console window via static members of Util class:
Util.Title = "E1M1 - Hello world";
Util.Width = 80;
Util.Height = 25;
Util.CursorVisible = false;
For to control console's content you must use Util.Buffer:
Util.Buffer.Clear();
Util.Buffer.Write(0, 0, "Hello world");
This library uses buffering, so after Util.Buffer was filled you must call Util.Swap() method:
Util.Swap();
For to events access you must use Events.NextEvent() method. Here simple events loop:
while (true)
{
//process input events
Event e = Events.GetNext(true);
//...
//update screen
//...
}
The Event struct contains info about event kind and additional event data (cursor pos, key and etc).
//ESC key was released
if (e.Kind == EventKind.Key && !e.Key.Press && e.Key.Key == ConsoleKey.Escape)
break;
Console content can be easy saved or loaded via simple text format:
Canvas pic = Canvas.Load("screen.rl");
Util.Buffer.Copy(pic, 4, 1);
Here example and description of *.rl format:
15 12
###############
# # # ## #
# # # # ##
# # # ## ####
## ## # #
# # ###### ##
## ## @## ##
# # # # #
# ### # # # # #
# # ### # # # #
# # # # #
###############
888888888888888
8F8FFFFF8F88FF8
8F8F8F8FFFFFF88
8FFF8F8F88F8888
88F88FFFF8FFFF8
8FFF8F888888F88
88F88FFFFE88F88
8FFFFF8F8F8FFF8
8F888F8F8F8F8F8
8F8F888F8F8F8F8
8FFFFF8F8FFF8F8
888888888888888
000000000000000
000000000000000
000000000000000
000000000000000
000000000000000
000000000000000
000000000000000
000000000000000
000000000000000
000000000000000
000000000000000
000000000000000
first line:
width height
[1, height + 1] lines:
symbols
[height + 2, 2 * height + 1] lines:
fore colors
[2 * height + 2, 3 * height + 1] lines:
back colors