voyageur-review/game/begin.coffee
2017-02-12 23:27:43 +07:00

30 lines
839 B
CoffeeScript

salet.game_id = "ddee8b0c-00c7-4ed3-a080-42d77c6ff2b8"
salet.game_version = "1.0"
$(document).ready(() ->
salet.beginGame()
)
way_to = (content, ref) ->
return "<a href='#{ref}' class='way'>#{content}</a>"
textlink = (content, ref) ->
return "<a href='./_writer_#{ref}' class='once'>#{content}</a>"
actlink = (content, ref) ->
return "<a href='./#{ref}' class='once'>#{content}</a>"
croom = (name, spec) ->
spec.clear = false
spec.color ?= 'green'
spec.optionText ?= """
<div class="#{spec.color}">
<div class="title">#{spec.title}</div>
<div class="subtitle">#{spec.subtitle}</div>
</div>
"""
spec.canView ?= () ->
not salet.isVisited(spec.name)
if spec.onexit
spec.exit = () ->
salet.view.write('<span class="shake">'+@onexit+'</span>')
return true
return room(name, spec)