mirror of
https://gitlab.com/Oreolek/salet-module.git
synced 2024-07-05 08:14:23 +03:00
Cut the long introduction
This commit is contained in:
parent
9eb9a011bf
commit
8ad06c0d0a
|
@ -22,6 +22,8 @@ actlink = (content, ref) ->
|
||||||
return "<a href='./#{ref}' class='once'>#{content}</a>"
|
return "<a href='./#{ref}' class='once'>#{content}</a>"
|
||||||
textcycle = (content, ref) ->
|
textcycle = (content, ref) ->
|
||||||
return "<a href='./_replacer_#{ref}' class='cycle' id='#{ref}'>#{content}</a>"
|
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.
|
# Cycling link. It's implied there can be only one per situation.
|
||||||
# You are welcome to improve this code.
|
# You are welcome to improve this code.
|
||||||
|
|
|
@ -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",
|
room "world",
|
||||||
tags: ["world"],
|
tags: ["start"],
|
||||||
optionText: "Enter the world",
|
optionText: "Enter the world",
|
||||||
ways: ["plaza"]
|
ways: ["plaza"]
|
||||||
content: """
|
content: """
|
||||||
|
@ -76,18 +19,17 @@ room "plaza",
|
||||||
return "Upwards"
|
return "Upwards"
|
||||||
else
|
else
|
||||||
return "Town plaza"
|
return "Town plaza"
|
||||||
cycle_gallery: () ->
|
cycle_gallery: () -> # it needs to be a function if you want localization
|
||||||
return [
|
return [
|
||||||
"quirky", "distinct", "kooky", "crazy", "quaint"
|
"quirky", "distinct", "kooky", "crazy", "quaint"
|
||||||
]
|
]
|
||||||
ways: ["shop"]
|
ways: ["shop"]
|
||||||
before: () ->
|
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.
|
A plaque nearby says it's the town of *Innsmouth,* wherever that is.
|
||||||
"""
|
"""
|
||||||
content: """
|
content: """
|
||||||
You are
|
|
||||||
There are #{textlink("people shouting", "people")} nearby.
|
There are #{textlink("people shouting", "people")} nearby.
|
||||||
|
|
||||||
You could ask a policeman #{textlink("for directions.", "mark")}
|
You could ask a policeman #{textlink("for directions.", "mark")}
|
||||||
|
@ -127,3 +69,14 @@ bugg = obj "bugg-shoggog",
|
||||||
this.delete()
|
this.delete()
|
||||||
return "You eat the bugg mass. Delicious and raw."
|
return "You eat the bugg mass. Delicious and raw."
|
||||||
bugg.put("lair")
|
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."
|
||||||
|
|
|
@ -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>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.
|
<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>
|
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>
|
<noscript>You need to turn on Javascript to play this game.</noscript>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -23,6 +23,7 @@ class RaconteurObj
|
||||||
take: () -> "You take the #{@name}." # taking to inventory
|
take: () -> "You take the #{@name}." # taking to inventory
|
||||||
act: () -> "You don't find anything extraordinary about the #{@name}." # object action
|
act: () -> "You don't find anything extraordinary about the #{@name}." # object action
|
||||||
dsc: () -> "You see a {{#{@name}}} here." # object description
|
dsc: () -> "You see a {{#{@name}}} here." # object description
|
||||||
|
inv: () -> "It's a {{#{@name}.}}" # inventory description
|
||||||
location: ""
|
location: ""
|
||||||
put: (location) ->
|
put: (location) ->
|
||||||
@level = 0 # this is scenery
|
@level = 0 # this is scenery
|
||||||
|
|
Loading…
Reference in a new issue