I just read the thread with Cameronhimself asking if he should post his development prgress on his game and it gave me an idea. This thread is now for posting code you are particularly proud of. I believe it will give people a chance to show off and give others ideas for their own code or even get suggestions about what they’ve already written. It is open to authors of all experience levels. Let me start off.
First I need to post a bit of code which uses hyperlinks to post a list of various actions the player can perform on the objects in the world so you know whats up with the other examples I share.
[code]Include Inline Hyperlinks by Erik Temple.
A thing has some text called acts. The acts of a thing is usually “blank”. Understand “act [something]” and “[something]” as acting. Acting is an action applying to one thing. Check acting: if the acts of the noun is “blank”, say “There wasn’t anything I could think to do with [the noun].” instead. Carry out acting: say “[acts of the noun]”. Report acting: do nothing.
The lantern is a switched off device in the Bedroom. It is fixed in place. The description of the lantern is “The lantern was nothing special, simply a glass gas lamp made by the local smith and bolted to the wall.”
After switching on the lantern: say "I reached up to the nob which controlled the gas flow, giving it a slight twist. After a quick tap on the starter the flame burst into life. ".
the acts of the lantern is “[link]light[as]light lantern[end link]”.[/code]
Fairly simple but the backbone of how I want to write this thing.
This one I already posted in another thread but I’m still proud of it, it’s an example of having the first time a room is visiting having a description in which the player is more involved the first run through (terrible explanation I know)
[code]The Bedroom is a room; "[first time]I woke up in a suden flash, cold sweat coatexd my body but I felt unbeleavably hot. I quickly shoved my sheets away and sat up. It was still deep in the middle of the night so it took a while for my eyes to adjust, it felt like I just came out of a brightly lit room. The first thing I did was check on my brother, to my releaf he was still fast asleep; snoring soundly. His bed sat against the wall seperated from mine by a wooden [link]end-table[end link] with a [link]glass of water[end link] on top and a [link]lantern[end link] hanging on the wall above.
Now that I was sure I hadn’t bothered him I took a closer look around.[only] [if visited]My brother was sleeping in the bed accross from mine, separated by a wooden [link]end-table[end link] with a [link]glass of water[end link] on top and a [link]lantern[end link] hanging on the wall above.[end if]Faint starlight streamed from the one [link]window[end link] in the room,[if the window is closed] firmly shut[otherwise] wide open[end if]. Next to it stood my [link]bookshelf[end link]. [first time]Everything in the room was technically both of ours but my brother had never been much one for reading.[only]Siting across the bookshelf stood the small circular [link]table[as]center table[end link] with two chairs. The [link]book[end link] I had been reading and a candle sat ontop. [if unvisited]Finally my eyes settled on the [link]metal sheet[end link] hanging on the closed door opposite my bed. Engraved on it was he Celdar national chant.[otherwise]Hanging on the door opposite my bed was a metal shit engraved with the Celdar national chant."[/code]
So go ahead and show us what you got.