diff --git a/game/begin.coffee b/game/begin.coffee index 3823d2f..64cc316 100644 --- a/game/begin.coffee +++ b/game/begin.coffee @@ -22,6 +22,8 @@ actlink = (content, ref) -> return "#{content}" textcycle = (content, ref) -> return "#{content}" +cyclelink = (content) -> + return "#{content}" # Cycling link. It's implied there can be only one per situation. # You are welcome to improve this code. diff --git a/game/story.coffee b/game/story.coffee index 6a4354f..868128d 100644 --- a/game/story.coffee +++ b/game/story.coffee @@ -1,62 +1,5 @@ -# Your game goes here -dialogue "Yes", "start", "question2", """ - Good, because you'll have to read the sources. A lot. - - Salet is *not* a library or a framework you can slap something on. - It's more a game you can hack into your game. - (Like Undum, yeah.) - - I hope to change that in the future but for now it's a weird mix of CoffeeScript classes and Undum core Javascript functions. - And Undum is notorious for making some hardcoded calls to how your game should *look and feel*. - The point of Salet is to have some freedom to change the user interface however you like. - But you'll have to code it first. - - For example, notice the lack of "Character" section? - The qualities and tools? - The functionality is still there but you'll have to style it yourself if you want it. - - So, that's the bad news. The good news are just a click ahead of you. -""" - -dialogue "No", "start", "question2", """ - Okay, this is going to be tough but you'll have to pick up *something* to use this. - - Salet is *not* a library or a framework you can slap something on. - It's more a game you can hack into your game. (Like Undum, yeah.) - - There is no cool editor or clear instructions. - You'll have to copy the source code and edit the CoffeeScript files in the `game` folder. - Then *compile* them. - - So, that's the bad news. The good news are just a click ahead of you. -""" - -dialogue "Dialogue functions", "question2", "world", """ - Let's start with a relatively small feature: dialogues. - - Undum's arguably not the best thing for menu-style dialogues because while it gives the author a great dialogue engine, - he has to write a lot of code for a single reply. - So I did a shortcut function. - - This is Undum's implicit choice, which you can use in you dialogues or floating modules: - - dialogue "Title", "start_tag", "end_tag", "content", "code" - - where: - - * `title` is a text the player clicks on, - * `start_tag` is a tag for *this* room (no `#` or arrays), - * `end_tag` is a tag for the choices in this room (no `#` or arrays) - * `code` is a piece of Javascript that gets executed once the player clicks on a choice. - - You still need to write a Situation for each reply, sorry. - But now you can do it faster! - - Okay, with this aside, let me show you... The World. -""" - room "world", - tags: ["world"], + tags: ["start"], optionText: "Enter the world", ways: ["plaza"] content: """ @@ -76,18 +19,17 @@ room "plaza", return "Upwards" else return "Town plaza" - cycle_gallery: () -> + cycle_gallery: () -> # it needs to be a function if you want localization return [ "quirky", "distinct", "kooky", "crazy", "quaint" ] ways: ["shop"] before: () -> """ - You climb up the well and come out to a central plaza of a #{textcycle("quaint", "cyclewriter")} little town. + You climb up the well and come out to a central plaza of a #{cyclelink("quaint")} little town. A plaque nearby says it's the town of *Innsmouth,* wherever that is. """ content: """ - You are There are #{textlink("people shouting", "people")} nearby. You could ask a policeman #{textlink("for directions.", "mark")} @@ -127,3 +69,14 @@ bugg = obj "bugg-shoggog", this.delete() return "You eat the bugg mass. Delicious and raw." bugg.put("lair") + +room "shop-inside", + ways: ["shop"] + title: "Inside the Shop" + content: """ + The insides are painted pastel white, honouring The Great Milk Spill of 1985. + """ + +lamp = obj "lamp", + dsc: "You see a {{lamp.}}" + take: "You carefully take the lamp." diff --git a/html/index.html b/html/index.html index 0dca9ab..e94eccb 100644 --- a/html/index.html +++ b/html/index.html @@ -27,7 +27,17 @@

The project is still a work-in-progress. This "game" will show you some of the new features.

It's supposed to be relatively painless for the author without sacrificing the reader's experience. For example, the game still loads while you're reading this.

-

First of all, are you familiar with HTML and Coffeescript? As in, reading the real source code.

+

Salet is not a library or a framework you can slap something on. + It's more a game you can hack into your game. (Like Undum, yeah.)

+

There are no either cool editor or clear instructions. + You'll have to copy the source code and edit the CoffeeScript files in the game folder. + Then compile them.

+

This is not a technical documentation or UI tutorial, this is a game. + You're supposed to note all the cool and curious features yourself. + If you want some technical info, there is the source code and a wiki.

+

I'm just here to point out that you are playing this in the web browser, online. + And you don't need to learn The Complete Javascript, Volumes I-III to write in this style.

+

So let me show you... The World.

diff --git a/lib/obj.coffee b/lib/obj.coffee index 410a6a5..204161b 100644 --- a/lib/obj.coffee +++ b/lib/obj.coffee @@ -23,6 +23,7 @@ class RaconteurObj take: () -> "You take the #{@name}." # taking to inventory act: () -> "You don't find anything extraordinary about the #{@name}." # object action dsc: () -> "You see a {{#{@name}}} here." # object description + inv: () -> "It's a {{#{@name}.}}" # inventory description location: "" put: (location) -> @level = 0 # this is scenery