1
0
Fork 0

WIP instances

This commit is contained in:
Alexander Yakovlev 2017-01-27 19:42:42 +07:00
parent 0f452e95a0
commit 4eeb9d15a1
5 changed files with 54 additions and 9 deletions

View File

@ -44,6 +44,7 @@ gulp.task('sass', () ->
)
gulp.task('concatCoffee', () ->
fs.mkdir('./build/game/translations')
for language in ['ru', 'en']
data = CSON.parseCSONFile('game/translations/'+language+'.cson')
json = JSON.stringify(data) + '\n'
@ -104,6 +105,12 @@ gulp.task('sass-dist', () ->
)
gulp.task('coffee-dist', ['concatCoffee'], () ->
fs.mkdir('./dist/game/translations')
for language in ['ru', 'en']
data = CSON.parseCSONFile('game/translations/'+language+'.cson')
json = JSON.stringify(data) + '\n'
fs.writeFileSync("./dist/game/translations/"+language+".json", json)
gulp.src('./build/game/main.coffee', {sourcemaps: false})
.pipe(coffee())
.pipe(buffer())

View File

@ -67,6 +67,37 @@ room "start",
dsc: () -> "intro".l()
choices: "#start"
button = unit "button",
colors: ["red", "blue", "green", "yellow", "orange", "violet"]
color: 0
dsc: () -> "{"+"color_"+@colors[@color].l()+"}"
act: () ->
index = @colors.indexOf(@color)
index = index + 1
if index > @colors.length
index = 0
@color = @colors[index]
salet.rooms["entry"].canChoose = true
room "instance",
dsc: () -> "instance".l()
tags: ["start"]
optionText: () -> "begin_game".l()
enter: () ->
for u in @units
u.color = salet.rnd.randomInt(u.colors.length)
units: [
button "first",
button "second"
]
croom "entry",
canChoose: false
optionText: () -> "entry_option".l()
title: () -> "entry_title".l()
ways: ["corridor"]
desc: () -> "entry_dsc".l()
croom = (name, options) ->
options.enter = () ->
if (salet.interactive)

View File

@ -1,10 +1,3 @@
croom "entry",
tags: ["start"],
optionText: () -> "entry_option".l()
title: () -> "entry_title".l()
ways: ["corridor"]
desc: () -> "entry_dsc".l()
croom "corridor",
ways: ["entry"]
title: () -> "corridor_title".l()

View File

@ -5,7 +5,7 @@ intro: """
In a dream all people are equal because they are Astrid.
"""
room_enter: "And then enters the "
entry_option: "Be Astrid"
begin_game: "Be Astrid"
entry_title: "Guest room"
entry_dsc: """
You are in a beautiful underwater guest room.

View File

@ -4,11 +4,25 @@ intro: """
Астрид спит и видит себя.
Во сне все люди равны, потому что все они — Астрид.
"""
instance: """
Вы стоите в круглой комнате перед круглой дверью.
*Наберите двуцветный код мира и войдите в дверь.
В одном мире не может быть больше четырёх Астрид.*
Рядом с дверью есть цветная кнопка.
"""
color_red: "Красная."
color_green: "Зелёная."
color_blue: "Синяя."
color_yellow: "Жёлтая."
color_orange: "Оранжевая."
color_violet: "Фиолетовая."
no_local_storage: "Локальное хранилище недоступно."
erase_message: "Это навсегда удалит вашего персонажа и немедленно вернёт вас на старт игры. Вы уверены?"
room_enter: "В комнату входит "
room_present: "В комнате стоят "
entry_option: "Быть Астрид"
begin_game: "Быть Астрид"
entry_title: "Прихожая"
entry_dsc: """
Вы находитесь в красивой подводной прихожей. За прозрачными стенами плавают рыбки.