Hello. I’m facing with an issue as I want to print stuff (eventually it’s going to be ascii art to illustrate room) before the room’s “banner” including the description, room name and so on. So I did something like this:
After going to the Bedroom:
if pillow is on bed and pen is on Night table:
say "pb pnt";
else if pillow is on bed:
say "pb";
else if pen is on Night Table:
say "pnt";
else:
say "bleh";
say "[line break]";
produce a room description with going spacing conventions.
This kinda works (it prints stuff depending on what is in the room as expected) HOWEVER it is not printed upon player’s spawn in the world (the Bedroom is the first room of the story).
Carry out looking (this is the foobar rule):
say "foobar.";
The foobar rule is listed before the room description heading rule in the carry out looking rulebook.
You’d probably want to check a property of the room.
A room has some text called the artwork.
Carry out looking (this is the room artwork rule):
say "[fixed letter spacing][artwork of the location][variable letter spacing][paragraph break]".
The room artwork rule is listed before the room description heading rule in the carry out looking rulebook.
@darkhog, I don’t know whether you’ve considered this yet, but think about how ASCII art will look at different window sizes. Make sure they don’t get messed up if someone plays without full screen, or if their dimensions differ from yours.
Carry out looking (this is the asciiart rule):
if the location is the Bedroom:
print bedroom art;
if the location is the Kitchen:
say "Gbrrllll".
The asciiart rule is listed before the room description heading rule in the carry out looking rulebook.
(“print bedroom art” is an instruction defined using To… so the code can be more maintainable) Had to do if ladder because different locations=different artworks and I don’t want to add thousands different rules for displaying them.
The good thing about adding a thousand different rules is that you can put each rule with the definition of the room it goes with, which may be convenient.
This is an important point. I did an ascii art game, and it was a PITA to make sure it looked right. My advice is:
1.) Get it tested on every interpreter, tweak it if needed, and just deal with the fact that it’ll be a little squattier or more elongated in some of them.
2.) Have a screen-reader mode that describes the images. This turned out to be really important when ClubFloyd played it, because they can’t view ascii. Plus, that makes it accessible for people who use screen readers.
Another option, which feels a bit crude but is often the most effective, is to lay out your ASCII art exactly how you like it on your own device, then save it as an image and display that instead. That’s how Kerkerkruip’s graphics work.