Cut the long introduction

This commit is contained in:
Alexander Yakovlev 2016-01-16 13:26:25 +07:00
parent 9eb9a011bf
commit 8ad06c0d0a
4 changed files with 28 additions and 62 deletions

View file

@ -22,6 +22,8 @@ actlink = (content, ref) ->
return "<a href='./#{ref}' class='once'>#{content}</a>"
textcycle = (content, ref) ->
return "<a href='./_replacer_#{ref}' class='cycle' id='#{ref}'>#{content}</a>"
cyclelink = (content) ->
return "<a href='./_replacer_cyclewriter' class='cycle' id='cyclewriter'>#{content}</a>"
# Cycling link. It's implied there can be only one per situation.
# You are welcome to improve this code.

View file

@ -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."

View file

@ -27,7 +27,17 @@
<p>The project is still a work-in-progress. This "game" will show you some of the new features.</p>
<p>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.</p>
<p>First of all, are you familiar with HTML and Coffeescript? As in, reading the real source code.</p>
<p><em>Salet</em> is <em>not</em> a library or a framework you can slap something on.
It's more a game you can hack into your game. (Like Undum, yeah.)</p>
<p>There are no either cool editor or clear instructions.
You'll have to copy the source code and edit the CoffeeScript files in the <code>game</code> folder.
Then <em>compile</em> them.</p>
<p>This is not a technical documentation or UI tutorial, this is a <em>game.</em>
You're supposed to note all the cool and curious features yourself.
If you want some technical info, there is the <a href="http://git.oreolek.ru/oreolek/salet">source code</a> and a <a href="http://git.oreolek.ru/oreolek/salet/wikis/home">wiki.</a></p>
<p>I'm just here to point out that you are playing this in the web browser, online.
And you don't need to learn <em>The Complete Javascript, Volumes I-III</em> to write in this style.</p>
<p>So let me show you... The World.</p>
<noscript>You need to turn on Javascript to play this game.</noscript>
</section>

View file

@ -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