mirror of
https://github.com/Oreolek/shooter.git
synced 2024-05-02 00:49:19 +03:00
READMEs and comments
This commit is contained in:
parent
4d35c0f55b
commit
531914c6d9
22
README.md
22
README.md
|
@ -11,7 +11,7 @@ Here's what you can see here:
|
||||||
* International support
|
* International support
|
||||||
* HTML5 sound effects with volume control
|
* HTML5 sound effects with volume control
|
||||||
* Graphical effects
|
* Graphical effects
|
||||||
* Realtime timer
|
* Realtime events
|
||||||
* Menu dialogue section
|
* Menu dialogue section
|
||||||
|
|
||||||
#### International support
|
#### International support
|
||||||
|
@ -31,6 +31,26 @@ Please.
|
||||||
See `Gulpfile.js.`
|
See `Gulpfile.js.`
|
||||||
The trick is to concatenate your files before every build.
|
The trick is to concatenate your files before every build.
|
||||||
|
|
||||||
|
#### The custom text cycling
|
||||||
|
A cycling link is a "replacer" hyperlink that replaces its contents with another text.
|
||||||
|
The game implies that a situation cannot have more than one cycling link.
|
||||||
|
|
||||||
|
The basic function for a replacer link is this:
|
||||||
|
`textcycle = (content, ref) -> a(content).replacer(ref).class("cycle").id(ref).toString()`
|
||||||
|
|
||||||
|
The `shoot_pacifist` situation uses only this function to do a text cycle.
|
||||||
|
But there's also a more advanced version.
|
||||||
|
|
||||||
|
The function `cycle` expects your situation to have a replacer action `cyclewriter`
|
||||||
|
written like this:
|
||||||
|
|
||||||
|
cyclewriter: (character) -> cycle(this, character)
|
||||||
|
|
||||||
|
Also it expects your situation to have a `cycle_gallery` function.
|
||||||
|
This is the function that returns your text strings.
|
||||||
|
|
||||||
|
You can see how it's done in the `start` situation.
|
||||||
|
|
||||||
## MIT License
|
## MIT License
|
||||||
Copyright © 2015 Alexander Yakovlev, http://en.oreolek.ru
|
Copyright © 2015 Alexander Yakovlev, http://en.oreolek.ru
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,15 @@ undum = require('undum-commonjs')
|
||||||
oneOf = require('raconteur/lib/oneOf.js')
|
oneOf = require('raconteur/lib/oneOf.js')
|
||||||
qualities = require('raconteur/lib/qualities.js')
|
qualities = require('raconteur/lib/qualities.js')
|
||||||
|
|
||||||
|
# load the translations
|
||||||
undumloc = require("./translations/ru.coffee").language
|
undumloc = require("./translations/ru.coffee").language
|
||||||
undum.language["ru"] = undumloc
|
undum.language["ru"] = undumloc
|
||||||
undumloc = require("./translations/en.coffee").language
|
undumloc = require("./translations/en.coffee").language
|
||||||
undum.language["en"] = undumloc
|
undum.language["en"] = undumloc
|
||||||
|
|
||||||
|
# jQuery is used for showing the custom controls when the player clicks on title
|
||||||
$ = require("jquery")
|
$ = require("jquery")
|
||||||
|
# jQuery UI is for volume slider
|
||||||
require('jquery-ui/slider');
|
require('jquery-ui/slider');
|
||||||
|
|
||||||
Array.prototype.oneOf = () ->
|
Array.prototype.oneOf = () ->
|
||||||
|
@ -18,11 +22,16 @@ markdown = new md({
|
||||||
html: true
|
html: true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# unique UUID
|
||||||
undum.game.id = "7a1aba32-f0fd-4e3b-ba5a-59e3fa9e6012"
|
undum.game.id = "7a1aba32-f0fd-4e3b-ba5a-59e3fa9e6012"
|
||||||
|
# You bump the version each time you make a save-breaking bug, i.e. change the game logic.
|
||||||
|
# Comment and text changes should be fine.
|
||||||
undum.game.version = "3.6"
|
undum.game.version = "3.6"
|
||||||
|
|
||||||
a = require('raconteur/lib/elements.js').a
|
a = require('raconteur/lib/elements.js').a
|
||||||
|
# link to a different situation. Styled differently. Not used in this project.
|
||||||
way_to = (content, ref) -> a(content).class('way').ref(ref)
|
way_to = (content, ref) -> a(content).class('way').ref(ref)
|
||||||
|
# link to a writer action. Not used in this project.
|
||||||
textlink = (content, ref) -> a(content).once().writer(ref)
|
textlink = (content, ref) -> a(content).once().writer(ref)
|
||||||
textcycle = (content, ref) -> a(content).replacer(ref).class("cycle").id(ref).toString()
|
textcycle = (content, ref) -> a(content).replacer(ref).class("cycle").id(ref).toString()
|
||||||
# Cycling link. It's implied there can be only one per situation.
|
# Cycling link. It's implied there can be only one per situation.
|
||||||
|
@ -36,11 +45,14 @@ cycle = (obj, character) ->
|
||||||
if character.sandbox.cycle_index[obj.name] == responses.length
|
if character.sandbox.cycle_index[obj.name] == responses.length
|
||||||
character.sandbox.cycle_index[obj.name] = 0
|
character.sandbox.cycle_index[obj.name] = 0
|
||||||
return textcycle(response, 'cyclewriter')
|
return textcycle(response, 'cyclewriter')
|
||||||
|
# usage: writemd( system, "Text to write")
|
||||||
writemd = (system, text) ->
|
writemd = (system, text) ->
|
||||||
if typeof text is Function
|
if typeof text is Function
|
||||||
text = text()
|
text = text()
|
||||||
system.write(markdown.render(text))
|
system.write(markdown.render(text))
|
||||||
|
|
||||||
|
# The first situation. It should be before is_visited because is_visited expects
|
||||||
|
# the situations array to be already initialized with something.
|
||||||
situation "start",
|
situation "start",
|
||||||
cycle_gallery: () -> "christine".l()
|
cycle_gallery: () -> "christine".l()
|
||||||
content: (character) ->
|
content: (character) ->
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
|
|
||||||
|
# This game does not *show* any qualities but it uses them.
|
||||||
|
# You can even resurrect the qualities block from the previous commits
|
||||||
|
# and it would work!
|
||||||
qualities
|
qualities
|
||||||
head:
|
head:
|
||||||
bullets: qualities.integer("bullets".l()),
|
bullets: qualities.integer("bullets".l()),
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="legal">
|
<div id="legal">
|
||||||
<div id="footleft">
|
<div id="footleft">
|
||||||
<p>Approximate play time: five minites.</p>
|
<p>Approximate play time: three minites.</p>
|
||||||
<p>Made using <a href="http://undum.com">Undum</a> and <a href="http://sequitur.github.io/raconteur/">Raconteur</a>.</p>
|
<p>Made using <a href="http://undum.com">Undum</a> and <a href="http://sequitur.github.io/raconteur/">Raconteur</a>.</p>
|
||||||
<p class="text-muted">Betatesting credit: headless zombie, Kie Kazuki, <a href="http://udivas.livejournal.com/profile" target="_blank">udivas</a></p>
|
<p class="text-muted">Betatesting credit: headless zombie, Kie Kazuki, <a href="http://udivas.livejournal.com/profile" target="_blank">udivas</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="legal">
|
<div id="legal">
|
||||||
<div id="footleft">
|
<div id="footleft">
|
||||||
<p>Приблизительное время прохождения игры: пять минут.</p>
|
<p>Приблизительное время прохождения игры: три минуты.</p>
|
||||||
<p>Написано при помощи <a href="http://undum.com" target="_blank">Undum</a> и <a href="http://sequitur.github.io/raconteur/" target="_blank">Raconteur</a>.</p>
|
<p>Написано при помощи <a href="http://undum.com" target="_blank">Undum</a> и <a href="http://sequitur.github.io/raconteur/" target="_blank">Raconteur</a>.</p>
|
||||||
<p class="muted">Бета-тестеры: headless zombie, Kie Kazuki, <a href="http://udivas.livejournal.com/profile" target="_blank">udivas</a></p>
|
<p class="muted">Бета-тестеры: headless zombie, Kie Kazuki, <a href="http://udivas.livejournal.com/profile" target="_blank">udivas</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue