I’ve been working on this game on and off for the last year, and I’m 73% complete. I’ve been making little updates on a different group that recently got shut down, so I’m going to post on here instead (unless it annoys someone! Then I’ll go somewhere quite like Twitter or something.
Edit: This game is now released!
This is a spoiler heavy document, and it’s mostly ‘I’m glad I got such and such to work’.
I’m currently working on my last ‘normal’ area. The game is split into 10 dimensions, of which 8 are basically ifcomp-size (i.e. 2 hr long) games that are almost entirely independent from the others, 1 more dimension that is integrated with all the others, and then the finale, which is separate.
Areas I’ve done so far include (mild spoilers) a haunted house with traditional gameplay (the original intent was to mimic Garry Francis’ style, although I diverged from that later), a murder mystery using my conversation system from Color the Truth, a wax museum escape room, a horror game using spells, a combat arena commanding robot squadrons, a slice-of-life nature area with journal pages, and a zoo. My current area is focused on math and physics.
Anyway, with that background, here’s my first entry. When I was doing a Let’s Read of the Inform 7 documentation, I was amused at the fact that the inverse hyperbolic tangent is built into Inform 7, and I decided to design a puzzle requiring it. It shows up in hyperbolic geometry, my PhD area, so I’m loading in a bunch of geometry stuff in this section. To help players out, I made a calculator, and I’m posting the code below:
(note: some parts are placeholders, like the description)
Calculator Code
The busted-calculator is on the shop-stand. Understand "busted" or "calculator" or "display" as the busted-calculator. The printed name of the busted-calculator is "busted calculator". The price of the busted-calculator is ET50.00. The description of the busted-calculator is "This is a scientific calculator, with the regular buttons for numbers and the decimal point. However, the keys for exponential and logarithmic functions are missing, along with others. Instead, all that are available are SIN, COS, TAN, SINH, COSH, and TANH. There is also an INVERSE toggle.
The display currently says '[error-display]'."
The number-keys are a plural-named part of the busted-calculator. Understand "number" or "key" or "keys" or "decimal" or "point" as the number-keys. The printed name of the number-keys is "number keys".
Instead of pushing the number-keys:
say "Instead of pushing individual keys for numbers, you can simply ENTER the entire number. For instance, you can ENTER 3.1415."
A calculator-button is a kind of thing. Understand "key" or "calculator key" as a calculator-button. A calculator-button is usually privately-named. The description of a calculator-button is usually "This calculator key (fortunately not busted) is labelled '[button-text of the item described]'."
When play begins:
now every calculator-button is part of the busted-calculator.
A calculator-button has some text called the button-text. Understand the button-text property as describing a calculator-button. The printed name of a calculator-button is usually "key".
Before printing the name of a calculator-button (called currentcalc):
let temptext be button-text of currentcalc;
say "[temptext in upper case] ";
The clear-button is a calculator-button. The button-text of clear-button is "CLEAR".
The sin-button is a calculator-button. The button-text of sin-button is "sin".
The cos-button is a calculator-button. The button-text of cos-button is "cos".
The tan-button is a calculator-button. The button-text of tan-button is "tan".
The sinh-button is a calculator-button. The button-text of sinh-button is "sinh".
The cosh-button is a calculator-button. The button-text of cosh-button is "cosh".
The tanh-button is a calculator-button. The button-text of tanh-button is "tanh".
The inv-toggle is part of the busted-calculator. The printed name of the inv-toggle is "INVERSE toggle". Understand "inverse" or "toggle" or "inv" as the inv-toggle.
An arithmetic-button is a kind of calculator-button.
The plus-button is an arithmetic-button. The button-text of the plus-button is "PLUS".
The minus-button is an arithmetic-button. The button-text of the minus-button is "MINUS".
The times-button is an arithmetic-button. The button-text of the times-button is "TIMES".
The divide-button is an arithmetic-button. The button-text of the divide-button is "DIVIDE".
The busted-calculator can be inverted or not inverted. The busted-calculator is not inverted.
Instead of pushing the inv-toggle:
if the busted-calculator is not inverted:
now the busted-calculator is inverted;
say "You push [the inv-toggle], and it sinks down, staying there.";
otherwise if the busted-calculator is inverted:
now the busted-calculator is not inverted;
say "You push [the inv-toggle], and it pops back up.";
Last-button is a thing that varies. Last-button is clear-button.
Instead pushing a calculator-button:
now last-button is the noun;
say "You press [the noun]. ";
if last-button is clear-button:
now calc-display is 0.0;
otherwise if the busted-calculator is not inverted:
if last-button is sin-button:
now calc-display is sine of calc-display;
if last-button is cos-button:
now calc-display is cosine of calc-display;
if last-button is tan-button:
now calc-display is tangent of calc-display;
if last-button is sinh-button:
now calc-display is hyperbolic sine of calc-display;
if last-button is cosh-button:
now calc-display is hyperbolic cosine of calc-display;
if last-button is tanh-button:
now calc-display is hyperbolic tangent of calc-display;
otherwise if the busted-calculator is inverted:
if last-button is sin-button:
now calc-display is arcsine of calc-display;
if last-button is cos-button:
now calc-display is arccosine of calc-display;
if last-button is tan-button:
now calc-display is arctangent of calc-display;
if last-button is sinh-button:
now calc-display is hyperbolic arcsine of calc-display;
if last-button is cosh-button:
now calc-display is hyperbolic arccosine of calc-display;
if last-button is tanh-button:
now calc-display is hyperbolic arctangent of calc-display;
if last-button is an arithmetic-button:
if calc-display is nonexistent:
say "ERROR";
otherwise:
say "The display says ENTER SECOND NUMBER.";
otherwise:
say "Now the display says '[error-display]'."
To say error-display:
if calc-display is nonexistent:
say "ERROR";
otherwise if last-button is an arithmetic-button:
say "ENTER SECOND NUMBER";
otherwise:
say calc-display;
The calc-display is a real number that varies. The calc-display is 0.0000.
Calcinputting is an action applying to a real number and one thing. Understand "type [a real number] on/in/onto/into [busted-calculator]" or "enter [a real number] on/in/onto/into [busted-calculator]" or "push [a real number] on/in/onto/into [busted-calculator]" or "input [a real number] on/in/onto/into [busted-calculator]" as calcinputting when the busted-calculator is held by the player.
Carry out calcinputting:
if last-button is an arithmetic-button:
if calc-display is nonexistent:
say "You type your number into the calculator, but it still says 'ERROR'.";
otherwise:
let tempnum be the real number understood;
if last-button is plus-button:
now calc-display is calc-display plus tempnum;
if last-button is minus-button:
now calc-display is calc-display minus tempnum;
if last-button is times-button:
now calc-display is calc-display multiplied by tempnum;
if last-button is divide-button:
now calc-display is calc-display divided by tempnum;
now last-button is clear-button;
say "You type your number into the calculator. It now displays [error-display].";
otherwise:
say "You type your number into the calculator. It now displays [the real number understood].";
now the calc-display is the real number understood;