Куча ненужных файлов

Которые я потом переведу.
This commit is contained in:
Alexander Yakovlev 2016-12-10 20:46:48 +07:00
parent 6f72453299
commit 80f30194d7
13 changed files with 190 additions and 71 deletions

View File

@ -19,7 +19,7 @@ reload = browserSync.reload
html = (target) -> html = (target) ->
return () -> return () ->
return gulp.src(['html/index.html']).pipe(gulp.dest(target)) return gulp.src(['html/*.html']).pipe(gulp.dest(target))
# Images # Images
img = (target) -> img = (target) ->
@ -54,29 +54,30 @@ bundle = () ->
.pipe(gulp.dest('./build/game')) .pipe(gulp.dest('./build/game'))
gulp.task('concatCoffee', () -> gulp.task('concatCoffee', () ->
files = glob.sync('game/procgen/ru/*.cson') for language in ['ru', 'en']
spec = {} files = glob.sync('game/procgen/'+language+'/*.cson')
for file in files spec = {}
data = CSON.parseCSONFile(file) for file in files
if not data.groups? data = CSON.parseCSONFile(file)
data.groups = [] if not data.groups?
if data.phrases? data.groups = []
data.groups.push({ if data.phrases?
tags: [], data.groups.push({
phrases: data.phrases tags: [],
}) phrases: data.phrases
data.phrases = undefined })
key = file.substr(0, file.lastIndexOf('.')) || file data.phrases = undefined
key = key.replace('game/procgen/ru/', '') key = file.substr(0, file.lastIndexOf('.')) || file
spec[key] = data key = key.replace('game/procgen/'+language+'/', '')
spec[key] = data
json = JSON.stringify(spec) + '\n' json = JSON.stringify(spec) + '\n'
fs.writeFileSync("./build/game/procgen/ru.json", json) fs.writeFileSync("./build/game/procgen/"+language+".json", json)
return gulp.src([ return gulp.src([
'./game/begin.coffee', './game/begin.coffee',
'./game/story.coffee', './game/story.coffee',
]).pipe(concat('./main.coffee')).pipe(gulp.dest('./build/game')) ]).pipe(concat('./main.coffee')).pipe(gulp.dest('./build/game'))
) )
gulp.task('coffee', ['concatCoffee'], bundle) gulp.task('coffee', ['concatCoffee'], bundle)
@ -91,6 +92,7 @@ gulp.task('serve', ['build'], () ->
server: { server: {
baseDir: 'build' baseDir: 'build'
} }
browser: []
}) })
sassListener = () -> sassListener = () ->
@ -112,12 +114,12 @@ gulp.task('img-dist', img('./dist/img'))
gulp.task('audio-dist', audio('./dist/audio')) gulp.task('audio-dist', audio('./dist/audio'))
gulp.task('legal-dist', () -> gulp.task('legal-dist', () ->
return gulp.src(['LICENSE.txt']) return gulp.src(['LICENSE.txt'])
.pipe(gulp.dest("./dist")) .pipe(gulp.dest("./dist"))
) )
gulp.task('sass-dist', () -> gulp.task('sass-dist', () ->
return gulp.src('./sass/main.scss') return gulp.src('./sass/main.scss')
.pipe(sass({outputStyle: 'compressed'})) .pipe(sass({outputStyle: 'compressed'}))
.pipe(gulp.dest('./dist/css')) .pipe(gulp.dest('./dist/css'))
) )
@ -129,7 +131,7 @@ distBundler = browserify({
gulp.task('coffee-dist', ['concatCoffee'], () -> gulp.task('coffee-dist', ['concatCoffee'], () ->
return distBundler.bundle() return distBundler.bundle()
.pipe(source('bundle.js')) .pipe(source('bundle.js'))
.pipe(buffer()) .pipe(buffer())
.pipe(uglify()) .pipe(uglify())
.on('error', gutil.log) .on('error', gutil.log)

View File

@ -5,10 +5,13 @@ require('salet')
ImprovEngine = require('improv') ImprovEngine = require('improv')
Improv = {} Improv = {}
i18n.push("ru", require('../../game/language/ru.coffee'))
i18n.push("en", require('../../game/language/en.coffee'))
salet.game_id = "0ee0825d-0c71-4a08-bfe5-730e575df26d" salet.game_id = "0ee0825d-0c71-4a08-bfe5-730e575df26d"
salet.game_version = "1.0" salet.game_version = "1.0"
$.getJSON('game/procgen/ru.json', (data) -> $.getJSON('game/procgen/'+i18n.lang+'.json', (data) ->
Improv = new ImprovEngine(data, { Improv = new ImprovEngine(data, {
filters: [ filters: [
ImprovEngine.filters.mismatchFilter() ImprovEngine.filters.mismatchFilter()

29
game/language/en.coffee Normal file
View File

@ -0,0 +1,29 @@
module.exports =
back: "Go back"
intro: """
-- Just got a call from the club. <..>
"""
dsc: (Improv) ->
"""
### In the car
Рядом с вами сидит [Лёша](alexey) и #{Improv.gen("alexey")}
На переднем сидении [Марго](margo) #{Improv.gen("margo")}
Вы сидите на заднем сидении, за спиной водителя. [Катя](katie) #{Improv.gen("katie")}
Вы положили в карман дверцы [мобильный телефон.](phone)
За [окном машины](./_writer_window) проносится трасса.
#{Improv.gen("you")}
"""
phone_dsc: "Вы открываете список контактов. Кому бы позвонить…"
director_prompt: "Директор музыкального клуба"
director_dsc: """
Hello? Alla Borisovna?
"""
bye: "Say bye"
cyalater: """
Thank you, I'll be in touch.
"""
end_phone: "Put down the phone"
end: "Nah, I'll think of something else."

30
game/language/ru.coffee Normal file
View File

@ -0,0 +1,30 @@
module.exports =
no_local_storage: "Локальное хранилище недоступно."
erase_message: "Это навсегда удалит вашего персонажа и немедленно вернёт вас на старт игры. Вы уверены?"
back: "Обратно"
intro: """
-- Только что звонили из клуба. <..>
"""
dsc: (Improv) -> """
### В машине
Рядом с вами сидит [Лёша](alexey) и #{Improv.gen("alexey")}
На переднем сидении [Марго](margo) #{Improv.gen("margo")}
Вы сидите на заднем сидении, за спиной водителя. [Катя](katie) #{Improv.gen("katie")}
Вы положили в карман дверцы [мобильный телефон.](phone)
За [окном машины](./_writer_window) проносится трасса.
#{Improv.gen("you")}
"""
phone_dsc: "Вы открываете список контактов. Кому бы позвонить…"
director_prompt: "Директор музыкального клуба"
director_dsc: """
Алло? Анна Борисовна?
"""
bye: "Попрощаться"
cyalater: """
Спасибо. Созвонимся.
"""
end_phone: "Отложить телефон"
end: "Передумать"

View File

@ -0,0 +1,5 @@
phrases: [
"обнимает гитару."
"насвистывает свою партию в песне про солнце."
"задумчиво смотрит в одну точку."
]

View File

@ -0,0 +1,3 @@
phrases: [
"выжимает из машины всё, что дозволено правилами."
]

View File

@ -0,0 +1,3 @@
phrases: [
"напевает про себя весёлый мотивчик."
]

View File

@ -0,0 +1,19 @@
groups: [
tags: []
phrases: [
"За окном проносится Россия."
]
,
tags: [
['weather', 'warm']
]
phrases: [
]
,
tags: [
['weather', 'cold']
]
phrases: [
"Вы ничего не видите в метели."
]
]

3
game/procgen/en/you.cson Normal file
View File

@ -0,0 +1,3 @@
phrases: [
"Вы сжимаете родную флейту. Только бы не опоздать."
]

View File

@ -1,51 +1,33 @@
room "start", room "start",
before: (from) -> before: (from) ->
if (!from) if (!from)
""" return "intro".l()
-- Только что звонили из клуба. dsc: () -> "dsc".l(Improv)
Приехали какие-то чмыри из администрации, нас отменяют.
"""
dsc: () -> """
### В машине
Рядом с вами сидит [Лёша](alexey) и #{Improv.gen("alexey")}
На переднем сидении [Марго](margo) #{Improv.gen("margo")}
Вы сидите на заднем сидении, за спиной водителя. [Катя](katie) #{Improv.gen("katie")}
Вы положили в карман дверцы [мобильный телефон.](phone)
За [окном машины](./_writer_window) проносится трасса.
#{Improv.gen("you")}
"""
writers: writers:
window: () -> window: () ->
# re-enter the room, reroll the description
salet.view.clearContent() salet.view.clearContent()
salet.here().entering() salet.here().entering("start")
return "<em>"+Improv.gen("window")+"</em>" return "<em>"+Improv.gen("window")+"</em>"
room "phone", room "phone",
choices: "#call", choices: "#call",
dsc: "Вы открываете список контактов. Кому бы позвонить…" dsc: "phone_dsc".l()
room "director", room "director",
tags: ["call"], tags: ["call"],
choices: "#director" choices: "#director"
optionText: "Директор музыкального клуба" optionText: "director_prompt".l()
dsc: """ dsc: "director_dsc".l()
Алло? Анна Борисовна?
"""
dialogue "Попрощаться", "director", "call", """ dialogue "bye".l(), "director", "call", "cyalater".l()
Спасибо. Созвонимся.
"""
# Virtual room to go around limitations # Virtual room to go around limitations
room "vstart", room "vstart",
tags: ["call"] tags: ["call"]
optionText: (from) -> optionText: (from) ->
switch from switch from
when "start" then "Осмотреться ещё раз" when "phone" then "end_phone".l()
when "phone" then "Отложить телефон" else "end".l()
else "Передумать"
enter: () -> enter: () ->
salet.goTo("start") salet.goTo("start")

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Salet showcase</title> <title>One room</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <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 href='https://fonts.googleapis.com/css?family=PT+Sans:400,400italic|PT+Sans+Caption' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/main.css">
@ -11,11 +11,6 @@
<div id="page"> <div id="page">
<div class="fixed container"> <div class="fixed container">
<div id="tools_wrapper" class="row"> <div id="tools_wrapper" class="row">
<div class='ways'>
<small class="text-muted" id="ways_hint">Click these links to explore other rooms</small>
<ul class="nav nav-pills" id="ways">
</ul>
</div>
<div class="buttons"> <div class="buttons">
<button id="night" class="btn btn-outline-primary">Night mode</button> <button id="night" class="btn btn-outline-primary">Night mode</button>
<button id="erase" class="btn btn-outline-danger">Restart</button> <button id="erase" class="btn btn-outline-danger">Restart</button>
@ -26,8 +21,7 @@
<div class="row"> <div class="row">
<div id="title" class="title"> <div id="title" class="title">
<div class="label"> <div class="label">
<h1>One room</h1> <h1>&lt;Note: name the game&gt;</h1>
<h2>A Ludum Dare effort</h2>
<noscript> <noscript>
<p class="noscript_message">This game requires Javascript.</p> <p class="noscript_message">This game requires Javascript.</p>
</noscript> </noscript>

55
html/ru.html Normal file
View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>И ТУТ НЕ ЗАБЫТЬ НАЗВАТЬ ИГРУ</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="css/main.css">
</head>
<body>
<div id="page">
<div class="fixed container">
<div id="tools_wrapper" class="row">
<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>Не забыть назвать игру</h1>
<noscript>
<p class="noscript_message">This game requires Javascript.</p>
</noscript>
</div>
</div>
</div>
<div id="content_wrapper" class="row">
<div id="content" class="content">
<noscript>You need to turn on Javascript to play this game.</noscript>
</div>
<a name="end_of_content"></a>
</div>
<div id="legal" class="row">
<div id="footleft">
<p>
<a href="https://git.oreolek.ru/oreolek/ludumdare37" target="_blank">See the source code</a>
</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" integrity="sha384-QXBtGc4014gU26HdCwzgy8TVO+FHSSE4+EvPPiSTpdE9w0KyJy1ocfiIbBl1HLq7" 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/bundle.js"></script>
</body>
</html>

View File

@ -30,13 +30,7 @@ body {
} }
.label { .label {
margin: 1.5em auto; margin: 1.5em auto;
@media (min-width: breakpoint-min(sm)) { @include make-col(12);
@include make-col-offset(2);
@include make-col(8);
}
@media (max-width: breakpoint-min(sm)) {
@include make-col(12);
}
text-align: center; text-align: center;
} }
.subtitle { .subtitle {
@ -77,12 +71,9 @@ body {
} }
#tools_wrapper { #tools_wrapper {
background: $body-bg; background: $body-bg;
.ways {
padding: 0.5em;
@include make-col(6);
}
.buttons { .buttons {
@include make-col(6); @include make-col(6);
@include make-col-offset(6);
text-align: right; text-align: right;
} }
button { button {