1
0
Fork 0
Browse Source

English version

master
Alexander Yakovlev 5 years ago
parent
commit
f94cc8d0fe
  1. 9
      Gulpfile.coffee
  2. 27
      game/begin.coffee
  3. 14
      game/story.coffee
  4. 25
      game/translations/en.cson
  5. 24
      game/translations/ru.cson
  6. 65
      html/en.html
  7. 7
      html/index.html
  8. 3
      package.json

9
Gulpfile.coffee

@ -9,12 +9,14 @@ buffer = require('vinyl-buffer')
zip = require('gulp-zip')
concat = require('gulp-concat')
rename = require('gulp-rename')
fs = require('fs')
CSON = require 'cson'
reload = browserSync.reload
html = (target) ->
return () ->
gulp.src(['html/index.html'])
gulp.src(['html/index.html', 'html/en.html'])
.pipe(gulp.dest(target))
gulp.src(['node_modules/salet/lib/index.min.js'])
.pipe(rename('salet.min.js'))
@ -42,6 +44,11 @@ gulp.task('sass', () ->
)
gulp.task('concatCoffee', () ->
for language in ['ru', 'en']
data = CSON.parseCSONFile('game/translations/'+language+'.cson')
json = JSON.stringify(data) + '\n'
fs.writeFileSync("./build/game/translations/"+language+".json", json)
gulp.src([
## additional functions
'./game/dialogue.coffee',

27
game/begin.coffee

@ -1,7 +1,14 @@
salet.game_id = "your-game-id-here"
salet.game_version = "1.6"
salet.game_id = "being-astrid-is-hard-enough-but-try-living-as-one"
salet.game_version = "1.0"
ably = new Ably.Realtime('v6yAiA.PKvuDg:iJhwQu-DkAWpDOUB')
channel = ably.channels.get('astrid')
channel = ably.channels.get('astrid-'+i18n.lang)
$.holdReady( true )
$.getJSON('game/translations/'+i18n.lang+'.json', (data) ->
i18n.push(i18n.lang, data)
$.holdReady( false )
)
$(document).ready(() ->
window.addEventListener('popstate', (event) ->
@ -33,7 +40,7 @@ $(document).ready(() ->
message.data.room == salet.current and
message.data.name != salet.character.name
)
salet.view.write("В комнату входит "+message.data.name+".")
salet.view.write("room_enter".l()+message.data.name+".")
)
salet.beginGame()
@ -55,14 +62,9 @@ actlink = (content, ref) ->
# For accessibility reasons the text is provided in HTML, not here.
room "start",
enter: () ->
names = [
'рыжая Астрид',
'Астрид-хулиганка',
'волшебная русалка Астрид',
'Астрид-ведьма'
]
names = "names".l()
salet.character.name = names[salet.rnd.randomInt(names.length)]
dsc: ""
dsc: () -> "intro".l()
choices: "#start"
croom = (name, options) ->
@ -72,5 +74,6 @@ croom = (name, options) ->
room: @name,
name: salet.character.name
})
options.dsc = "### #{options.title}\n" + options.dsc
options.dsc = () ->
"### #{@title()}\n" + @desc()
return room(name,options)

14
game/story.coffee

@ -1,15 +1,11 @@
croom "entry",
tags: ["start"],
optionText: "Быть Астрид"
title: "Прихожая"
optionText: () -> "entry_option".l()
title: () -> "entry_title".l()
ways: ["corridor"]
dsc: """
Вы находитесь в красивой подводной прихожей. За прозрачными стенами плавают рыбки.
"""
desc: () -> "entry_dsc".l()
croom "corridor",
ways: ["entry"]
title: "Коридор"
dsc: """
Короткий коридор, который замыкается в себе.
"""
title: () -> "corridor_title".l()
desc: () -> "corridor_dsc".l()

25
game/translations/en.cson

@ -0,0 +1,25 @@
intro: """
You are Astrid.
Astrid sleeps and sees herself in her dreams.
In a dream all people are equal because they are Astrid.
"""
room_enter: "And then enters the "
entry_option: "Be Astrid"
entry_title: "Guest room"
entry_dsc: """
You are in a beautiful underwater guest room.
There are water horseys swimming behind the glass walls.
"""
corridor_title: "Corridor"
corridor_dsc: """
A short corridor that turns upon itself.
"""
names: [
'red Astrid',
'Astrid the menace',
'magic Astrid mermaid',
'witch Astrid',
"Astridulhu"
"Dent. Astrident"
]

24
game/translations/ru.cson

@ -0,0 +1,24 @@
intro: """
Вы  Астрид.
Астрид спит и видит себя.
Во сне все люди равны, потому что все они — Астрид.
"""
room_enter: "В комнату входит "
entry_option: "Быть Астрид"
entry_title: "Прихожая"
entry_dsc: """
Вы находитесь в красивой подводной прихожей. За прозрачными стенами плавают рыбки.
"""
corridor_title: "Коридор"
corridor_dsc: """
Короткий коридор, который замыкается в себе.
"""
names: [
'рыжая Астрид',
'Астрид-хулиганка',
'волшебная русалка Астрид',
'Астрид-ведьма',
"Астридулху"
"Дент. Астридент"
]

65
html/en.html

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Being Astrid</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=PT+Sans:400,400italic|PT+Sans+Caption' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.5/css/bootstrap.min.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div id="page">
<div class="fixed container">
<div id="tools_wrapper" class="row">
<div class='ways'>
<small class="text-muted" id="ways_hint">These are the adjacent rooms.</small>
<ul class="nav nav-pills" id="ways">
</ul>
</div>
<div class="buttons">
<button id="night" class="btn btn-outline-primary">Night mode</button>
<button id="erase" class="btn btn-outline-danger">Restart</button>
</div>
</div> <!-- End of div.tools_wrapper -->
</div>
<div class="container">
<div class="row">
<div id="title" class="title">
<div class="label">
<h1>Being Astrid</h1>
<noscript>
<p class="noscript_message">This game requires Javascript.</p>
</noscript>
</div>
</div>
</div>
<div id="content_wrapper" class="row">
<div id="intro" class="content">
<section>
<noscript>You need to turn on Javascript to play this game.</noscript>
</section>
</div>
<div id="content" class="content">
</div>
<a name="end_of_content"></a>
</div>
<div id="legal" class="row">
<div id="footleft">
<p>&copy; 2017 Oreolek.</p>
</div>
<div id="footright">
</div>
</div>
</div>
</div> <!-- End of div.page -->
<!-- CDN JS Libraries -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.5/marked.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="game/salet.min.js"></script>
<script src="https://cdn.ably.io/lib/ably.min.js"></script>
<script type="text/javascript" defer="defer" src="game/main.js"></script>
</body>
</html>

7
html/index.html

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Быть Астрид</title>
@ -37,11 +37,6 @@
<div id="content_wrapper" class="row">
<div id="intro" class="content">
<section>
<p>Вы  Астрид.</p>
<p>Астрид спит и видит себя.</p>
<p>Во сне все люди равны, потому что все они — Астрид.</p>
<noscript>You need to turn on Javascript to play this game.</noscript>
</section>
</div>

3
package.json

@ -16,6 +16,7 @@
"gulp-util": "^3.0.8",
"gulp-zip": "^3.0.2",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
"vinyl-source-stream": "^1.1.0",
"cson": "^4.0.0"
}
}

Loading…
Cancel
Save