With Interactive Fiction, you type your commands in plain English each
time you see the prompt which looks like this:
>
[...]
There are many differnet kinds of sentences used in interactive fiction.
Here are some examples:
> walk to the north
> west
> ne
> down
> take the birdcage
> read about dimwit flathead
> look up megaboz in the encyclopedia
> lie down in the pink sofa
> examine the shiny coin
> put the rusty key in the cardboard box
> show my bow tie to the bouncer
> hit the crawling crab with the giant nutcracker
> ask the cowardly king about the crown jewels
You can use multiple objects with certain verbs if you separate them by
the word "and" or by a comma. Here are some examples:
> take the book and the frog
> drop the jar of peanut butter, the spoon, and the lemming food
> put the egg and the pencil in the cabinet
Is it possible to switch the text to black background or even change the color of both?Shit, forgot to implement the invert colors feature. D: (I had white-on-black at first, but I found it's more pleasant to read when it's the other way around.)
2. Can it load .z3, .z5, or .z8 files?+1
nio_InitConsole (&console, 54, 30, 0, 0, 15, 0);
void nio_cursor_draw(nio_console* c)
{
unsigned short color = c->color[c->cursor_y*c->max_x+c->cursor_x];
unsigned char foreground_color = color;
// The starting position of where to draw the cursor
const unsigned short cursor_x_start = c->offset_x + c->cursor_x*NIO_CHAR_WIDTH;
const unsigned short cursor_y_start = c->offset_y + (c->cursor_y*NIO_CHAR_HEIGHT) + NIO_CHAR_HEIGHT;
if((c->drawing_enabled) && (c->cursor_enabled)) {
if (!((c->cursor_type >= 0) && (c->cursor_type <= 4))) {
// Set the cursor type to a valid one
c->cursor_type = 0;
}
int i, j;
if (c->cursor_type == 0) {
// Draw a box for the cursor
for(i = 0; i < NIO_CHAR_WIDTH; i++)
{
for(j = NIO_CHAR_HEIGHT; j > 0; j--)
{
nio_pixel_set(cursor_x_start+i,cursor_y_start-j, foreground_color);
}
}
} else if (c->cursor_type == 1) {
// Draw a horizontal underline (underscore) for the cursor
// Sanity check for cursor_line_width
if (!((c->cursor_line_width > 0) && (c->cursor_line_width <= NIO_CHAR_HEIGHT))) {
// Set the cursor width to 1 (regular cursor width)
c->cursor_line_width = 1;
}
// Draw it!
for(i = 0; i < NIO_CHAR_WIDTH; i++)
{
//for(j = NIO_CHAR_HEIGHT; j > (NIO_CHAR_HEIGHT - c->cursor_line_width); j--)
for(j = 0; j < c->cursor_line_width; j++)
{
nio_pixel_set(cursor_x_start+i,cursor_y_start-j-1, foreground_color);
}
}
} else if (c->cursor_type == 2) {
// Draw a vertical bar for the cursor
// Sanity check for cursor_line_width
if (!((c->cursor_line_width > 0) && (c->cursor_line_width <= NIO_CHAR_WIDTH))) {
// Set the cursor width to 1 (regular cursor width)
c->cursor_line_width = 1;
}
// Draw it!
for(i = 0; i < c->cursor_line_width; i++) {
for(j = NIO_CHAR_HEIGHT; j > 0; j--)
{
nio_pixel_set(cursor_x_start+i,cursor_y_start-j, foreground_color);
}
}
} else if (c->cursor_type == 3 || c->cursor_type == 4) {
// Draw a custom cursor
// This uses pretty much the same code as the regular character drawing
unsigned char background_color = color >> 8;
// Sanity check to make sure the user defined something for the character
if (c->cursor_custom_data == NULL) {
// Set the cursor to a full cursor
int p;
for(p = 0; p <= 5; p++)
c->cursor_custom_data[p] = 0xFF;
}
// Draw it!
int pixelOn;
for(i = 0; i < NIO_CHAR_WIDTH; i++)
{
for(j = NIO_CHAR_HEIGHT; j > 0; j--)
{
pixelOn = c->cursor_custom_data[i] << j;
pixelOn = pixelOn & 0x80 ;
if (pixelOn) nio_pixel_set(cursor_x_start+i,cursor_y_start-j,foreground_color);
else if(!pixelOn) nio_pixel_set(cursor_x_start+i,cursor_y_start-j,background_color);
}
}
}
}
}
void nio_cursor_erase(nio_console* c)
{
unsigned short color = c->color[c->cursor_y*c->max_x+c->cursor_x];
char background_color = color >> 8;
// The starting position of where to draw the cursor
const unsigned short cursor_x_start = c->offset_x + c->cursor_x*NIO_CHAR_WIDTH;
const unsigned short cursor_y_start = c->offset_y + (c->cursor_y*NIO_CHAR_HEIGHT) + NIO_CHAR_HEIGHT;
// Draw a box for the cursor
if((c->drawing_enabled) && (c->cursor_enabled)) {
int i, j;
for(i = 0; i < NIO_CHAR_WIDTH; i++)
{
for(j = NIO_CHAR_HEIGHT; j > 0; j--)
{
nio_pixel_set(cursor_x_start+i,cursor_y_start-j, background_color);
}
}
nio_csl_drawchar(c,c->cursor_x,c->cursor_y);
}
}
Thanks catastropher :)You switched to Git? Nice. Feel free to give me access to your repo, my GitHub username is juju2143 and I'll check it out as soon as I'll get my hands on my Prizm (my bro have it atm).
I will integrate your changes as soon as possible (probably tomorrow :P)
btw, I am in the progress of changing the Nspire I/O repository from SVN to Git.
Any new changes will be made to https://github.com/compujuckel/nspire-io instead of the nspforge repo (I'll make a separate post about this once I release a major update or something)
You switched to Git? Nice. Feel free to give me access to your repo, my GitHub username is juju2143 and I'll check it out as soon as I'll get my hands on my Prizm (my bro have it atm).Done ;)
Thanks ^_^You switched to Git? Nice. Feel free to give me access to your repo, my GitHub username is juju2143 and I'll check it out as soon as I'll get my hands on my Prizm (my bro have it atm).Done ;)