Rebranding. Also removed doc from git repo - docs are NOT the program and should be written - and handled - differently

to be committed:
This commit is contained in:
Alexander Yakovlev 2011-09-03 17:57:56 +07:00
parent 0b7d72ebdd
commit 11cdfd4c4f
31 changed files with 8 additions and 6521 deletions

View file

@ -1,4 +1,4 @@
VERSION := 1.4.6
VERSION := 1.0
DESTDIR=
BIN=

View file

BIN
doc/1.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

View file

@ -1,46 +0,0 @@
include ../Rules.make
include ../config.make
pdf:
# try xetex here, and hope it works ;)
pdflatex manual.tex
makeindex manual.idx
pdflatex manual.tex
$(RM) -f manual.aux manual.log manual.toc manual.out manual.idx manual.ind manual.ilg
#to-do: interpret $PATH
wiki:
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:documentation&do=export_xhtml" -O writing_games.html
wget "http://instead.syscall.ru/wiki/doku.php?id=en:gamedev:documentation&do=export_xhtml" -O writing_games-en.html
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:documentation&do=export_raw" -O writing_games.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=en:gamedev:documentation&do=export_raw" -O writing_games-en.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:click&do=export_raw" -O modules/click.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:format&do=export_raw" -O modules/format.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:hideinv&do=export_raw" -O modules/hideinv.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:prefs&do=export_raw" -O modules/prefs.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:timer&do=export_raw" -O modules/timer.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:xact&do=export_raw" -O modules/xact.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:dash&do=export_raw" -O modules/dash.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:dbg&do=export_raw" -O modules/dbg.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:hotkeys&do=export_raw" -O modules/hotkeys.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:para&do=export_raw" -O modules/para.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:quotes&do=export_raw" -O modules/quotes.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:theme&do=export_raw" -O modules/theme.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:kbd&do=export_raw" -O modules/kbd.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:sprites&do=export_raw" -O modules/sprites.txt
wget "http://instead.syscall.ru/wiki/doku.php?id=ru:gamedev:modules:sound&do=export_raw" -O modules/sound.txt
clean:
all:
install:
$(INSTALLD) $(DOCPATH)
$(INSTALL) *.html *.txt *.pdf $(DOCPATH)
$(INSTALLD) $(DOCPATH)/modules
$(INSTALL) modules/*.txt $(DOCPATH)/modules
$(INSTALLD) $(MANPATH)
$(INSTALL) *.6 $(MANPATH)
uninstall:
$(RM) -rf $(DOCPATH)
$(RM) $(MANPATH)/instead.*

View file

@ -1,9 +0,0 @@
clean:
all:
install:
if not exist ..\bin\doc mkdir ..\bin\doc
if not exist ..\bin\doc\modules mkdir ..\bin\doc\modules
copy /Y *.txt ..\bin\doc
copy /Y *.html ..\bin\doc
copy /Y *.pdf ..\bin\doc
copy /Y modules\*.txt ..\bin\doc\modules

View file

@ -1,79 +0,0 @@
-- add this: dofile("debug.lua")
-- after last line in your main.lua
-- for debug tools
choose_location = dlg {
debug = true,
nam = 'Go to',
dsc = 'Select location.',
gen = function(s)
local k,v
objs(s):zap();
for k,v in pairs(_G) do
if isRoom(v) and not v.debug then
local n = call(v, 'nam');
put(phr(n, '', [[return goto("]]..k..[[")]]), s);
end
end
put (phr('Exit','','back()'), s)
end
}
choose_object = dlg {
debug = true,
nam = 'Get object',
dsc = 'Select object to get.',
gen = function(s)
local k,v
objs(s):zap();
for k,v in pairs(_G) do
if isObject(v) and not isRoom(v) and not isPlayer(v) and not v.debug and not have(v) and not isStatus(v) then
local n = call(v, 'nam');
put(phr(n, '', k..':enable(); return take("'..k..'")'), s);
end
end
put (phr('Exit','','back()'), s)
end
}
drop_object = dlg {
debug = true,
nam = 'Drop object',
dsc = 'Select object to drop.',
gen = function(s)
local k,v
objs(s):zap();
for k,v in pairs(_G) do
if isObject(v) and not isRoom(v) and not isPlayer(v) and not v.debug and have(v) then
local n = call(v, 'nam');
put (phr(k,'','drop("'..k..'","'..deref(from())..'")'), s)
end
end
put (phr('Exit','','back()'), s)
end
}
debug_dlg = dlg {
debug = true,
nam = 'Debug Tool',
dsc = 'Select tool.',
obj = {
[1]=phr('Go to location...', nil ,[[pon(1); choose_location:gen(); return goto('choose_location')]]),
[2]=phr('Get object...', nil , [[pon(2); choose_object:gen(); return goto('choose_object')]]),
[3]=phr('Put object...', nil , [[pon(3); drop_object:gen(); return goto('drop_object')]]),
[4]=phr('Exit', nil , [[pon(4); back()]]),
},
};
debug_tool = obj {
debug = true,
nam = txtb('debug'),
inv = function(s)
debug_dlg.__from__ = deref(here());
me().where = 'debug_dlg'; -- force to go
local r = call(debug_dlg, 'enter');
return r;
end
};
putf('debug_tool', me());

View file

@ -1,230 +0,0 @@
dofile("menu.lua");
Look = function(s)
if not s.exam then
return 'Ничего особенного...';
end
return call(s,'exam');
end
Open = function(s)
if not s.open then
return 'Это нельзя открыть...';
end
if s._opened then
return 'Уже открыто...';
end
local r,v = call(s,'open');
if v ~= false then
s._opened = true;
end
return r
end
Close = function(s)
if not s.close then
return 'Это нельзя закрыть...';
end
if not s._opened then
return 'Уже закрыто...';
end
local r,v = call(s,'close');
if v ~= false then
s._opened = false;
end
return r;
end
Take = function(s)
if have(s) then
return 'У вас уже это есть.';
end
if not s.take then
return 'Это нельзя взять...';
end
local r,v= call(s,'take');
if v ~= false then
take(s);
end
return r
end
Drop = function(s)
if not have(s) then
return 'У вас нет этого.';
end
if not s.drop then
return 'Это нельзя положить...';
end
local r,v = call(here(), 'drop', deref(s))
if not r then
r,v = call(s,'drop');
end
if v ~= false then
drop(s);
end
return r;
end
Push = function(s)
if not s.push then
return 'Это нельзя толкнуть...';
end
local r = call(s, 'push');
return r;
end
Eat = function(s)
if not s.eat then
return 'Это нельзя есть...';
end
local r,v = call(s,'eat');
if v ~= false then
inv():del(s);
end
return r;
end
Talk = function(s)
if not s.talk then
return 'С этим нельзя говорить...';
end
local r,v=call(s, 'talk');
return r
end
Give = function(s, w)
local r, v;
if not have(s) then
return 'Нельзя это отдать...', false;
end
if not s.give then
return 'Гм... Зачем?...', false;
end
r, v = call(s, 'give', w);
if v ~= false then
remove(s, me());
end
return r,false
end
Use = function(s, w)
local r,v;
if givem._state then
if w == nil then
return 'Гм... Абсурд...'
end
return Give(s, w);
end
if not w then
if not s.useit then
return 'Гм... Как это может сработать?...'
end
r, v = call(s, 'useit', w);
else
r, v = call(s, 'useon', w);
end
return r, v;
end
function iobj(v)
v.act = Look;
v.inv = Look;
v.Open = Open;
v.Close = Close;
v.Push = Push;
v.Take = Take;
v.Drop = Drop;
v.Eat = Eat;
v.Exam = Look;
v.Talk = Talk;
v.use = Use;
v.dsc = function(s)
return call(s, 'desc');
end
return menu(v);
end
function iroom(v)
v.dsc = function(s)
return call(s, 'desc');
end
return room(v);
end
-- for aliases
act = {
exam = function(s)
return call(s, 'exam');
end,
take = function(s)
return call(s, 'take');
end,
drop = function(s)
return call(s, 'drop');
end,
push = function(s)
return call(s, 'push');
end,
eat = function(s)
return call(s, 'eat');
end,
talk = function(s)
return call(s, 'talk');
end,
open = function(s)
return call(s, 'open');
end,
close = function(s)
return call(s, 'close');
end,
useon = function(s, w)
return call(s, 'useon', w);
end,
useit = function(s)
return call(s, 'useit');
end,
give = function(s, w)
return call(s, 'give', w);
end
};
takem = actmenu('> взять', 'Take', true);
dropm = actmenu('> бросить', 'Drop', false, true);
pushm = actmenu('> толкнуть', 'Push', true);
eatm = actmenu('> есть', 'Eat', true, true);
talkm = actmenu('> говорить', 'Talk', true);
openm = actmenu('> открыть', 'Open', true, true);
closem = actmenu('> закрыть', 'Close', true, true);
usem = actmenu('> использовать', 'use', true, true);
givem = actmenu('> отдать', 'use', true, true, true);
rest = menu {
nam = '> отдыхать',
act = 'Я отдохнул.',
action_type = true,
};
pocketm = pocket('> с собой');
inv = function(s)
return pocketm.robj;
end
menu_init();
function actions_init()
put(pocketm, 'pl');
put(takem, 'pl');
put(dropm, 'pl');
put(pushm, 'pl');
put(eatm, 'pl');
put(talkm, 'pl');
put(openm, 'pl');
put(closem, 'pl');
put(usem, 'pl');
put(givem, 'pl');
put(rest, 'pl');
-- put(stat { nam = ' ' }, 'pl');
end

View file

@ -1,81 +0,0 @@
dofile("actions.lua");
game.use = 'Не сработает...';
status = stat {
Turns = 0,
nam = function(s)
s.Turns = s.Turns + 1;
return 'Статус игрока: '..s.Turns..'^';
end
};
knife = iobj {
nam = 'ножик',
desc = 'На полу валяется {ножик}.',
exam = 'Бесполезный перочинный ножик.',
}
main = room {
nam = 'intro',
dsc = 'Введение',
exit = function(s)
me().obj:add('status');
actions_init();
inv():add('knife');
end,
obj = { vway('next','{Дальше}.', 'r1') }
}
cube = iobj {
nam = 'куб',
desc = 'В центре комнаты находится {куб}.',
take = 'Вы взяли куб',
exam = 'Мультифункциональный куб -- написано на кубе.',
inv = act.exam,
drop = 'Вы положили куб.',
useit = 'Как можно использовать куб?',
talk = 'Вы поговорили с кубом.',
eat = function(s)
return 'Вы не можете разгрызть куб.', false;
end,
open = 'Вы открыли куб.',
close = 'Вы закрыли куб.',
push = 'Вы толкаете куб.',
give = function(s, w)
return 'Вы пытаетесь отдать куб объекту: '..deref(w)..'.', false
end,
useon = function(s, w)
return 'Вы пытаетесь юзать куб на объект: '..deref(w)..'. Получилось!'
end,
used = 'Куб поюзан.',
};
sphere = iobj {
nam = 'сфера',
desc = 'В центре комнаты находится {сфера}.',
take = 'Вы взяли сферу',
exam = 'Мультифункциональная сфера -- написано на сфере.',
inv = act.exam,
drop = 'Вы положили сферу.',
useit = 'Как можно использовать сферу?',
talk = 'Вы поговорили с сферой.',
eat = function(s)
return 'Вы не можете разгрызть сферу.', false;
end,
open = 'Вы открыли сферу.',
close = 'Вы закрыли сферу.',
push = 'Вы толкаете сферу.',
give = function(s, w)
return 'Вы пытаетесь отдать сферу объекту: '..deref(w)..'.', false
end,
useon = function(s, w)
return 'Вы пытаетесь юзать сферу на объект: '..deref(w)..'. Получилось!'
end,
used = 'Сфера поюзана.',
};
r1 = room {
nam = 'комната',
dsc = 'Вы в комнате',
obj = { cube, sphere },
}

View file

@ -1,213 +0,0 @@
use_proxy = function(o)
local v = {};
v.proxy_type = true;
v.nam = '   '..call(ref(o), 'nam');
if inv():srch(ref(o)) then
v.nam = txtem(v.nam);
end
v.pobj = deref(o);
v.save = function(self, name, h, need)
if need then
h:write(stead.string.format(name.." = use_proxy(%q);\n", tostring(self.pobj)));
end
savemembers(h, self, name,false);
end
if ref(o).use ~= nil then
v.use = function(s, w)
if ref(w).proxy_type then
local v,r = call(ref(s.pobj), 'use', ref(w.pobj));
-- where(s):gen();
return v,r;
end
end
v.inv = function(s)
local v,r = call(ref(s.pobj), 'use', nil);
-- where(s):gen();
return v,r;
end
end
if ref(o).used ~= nil then
v.used = function(s, w)
if ref(w).proxy_type then
local v,r = call(ref(s.pobj), 'used', ref(w.pobj));
-- where(s):gen();
return v,r;
end
end
end
return obj(v)
end
act_proxy = function(o, act)
local v = {};
v.proxy_type = true;
v.nam = '   '..call(ref(o), 'nam');
v.pobj = deref(o);
v.pact = act;
v.save = function(self, name, h, need)
if need then
h:write(stead.string.format(name.." = act_proxy(%q, %q);\n", self.pobj, self.pact));
end
savemembers(h, self, name,false);
end
if ref(o)[act] ~= nil then
v.inv = function(s)
local v, r;
v,r = call(ref(s.pobj), act);
-- where(s):gen();
return v,r;
end
end
return menu(v)
end
fill_objs = function(s, w, act)
local ii,i, o
for i,o,ii in opairs(objs(w)) do
o = ref(o);
if isObject(o) and not isDisabled(o) and o ~= s and not isPhrase(o) then
local n = deref(o)
if type(n) ~= 'string' then
n = deref(w)..".obj["..tonumber(ii).."]";
end
if act == "use" then
put(use_proxy(n), s);
else
put(act_proxy(n, act), s);
end
fill_objs(s, o, act);
end
end
end
fill_inv = function(s, w, act)
local i, o
local rc = false
for i,o in opairs(w) do
o = ref(o);
if isObject(o) and not isDisabled(o)
and not o.proxy_type
and not isStatus(o)
and s ~= o and not o.action_type then
local n = deref(o)
if type(n) ~= 'string' then
n = deref(w)..".obj["..tonumber(ii).."]";
end
if act == "use" then
put(use_proxy(n), s);
else
put(act_proxy(n, act), s);
end
fill_inv(s, o.obj, act);
rc = true
end
end
return rc
end
select_only = function(s)
local k, o, i
for k,o in opairs(me().obj) do
o = ref(o)
if o.action_type and o._state and o ~= s then
o:inv();
end
end
obj_tag(me(), MENU_TAG_ID);
end
actmenu = function(nam, act, _scene, _inv, _ifinvonly)
local v = { };
v.action_type = true;
v._state = false;
v._nam = nam;
v.nam = function(s)
if s._state then
return txtu(s._nam);
end
return s._nam;
end
v._scene = _scene;
v._inv = _inv;
v.gen = function(s)
local k,o,i
local rc = false
s.obj:zap();
if s._inv then
rc =fill_inv(s, inv(), act);
end
if not _ifinvonly or rc then
if s._scene then
fill_objs(s, here(), act);
end
end
select_only(s);
end
v.inv = function(s)
local i,o
local k,v
if not s._state then
s:gen();
s._state = true;
else
s._state = false;
s.obj:zap();
end
return nil, true -- to say instead, do not redraw scene, only inv ;)
end
return menu(v);
end
function gen_actions(s)
local k, o
for k,o in opairs(me().obj) do
o = ref(o)
if o.action_type and o._state then
o:gen();
end
end
end
pocket = function(nam)
local v = {}
v.action_type = true;
v._state = false;
v._nam = nam;
v.nam = function(s)
if s._state then
return txtu(s._nam);
end
return s._nam;
end;
v.gen = function(s)
s.obj:zap();
fill_inv(s, inv(), 'act');
-- put(act_proxy(o, 'inv'), s);
-- s.obj:cat(s.robj);
select_only(s);
end;
v.inv = function(s)
if not s._state then
s:gen();
s._state = true;
else
s.obj:zap();
s._state = false;
end
return nil,true
end;
v.robj = list {};
return menu(v);
end
menu_init = function(s)
pl.inv = function(s)
gen_actions(s);
return player_inv(s);
end
end

View file

@ -1,24 +0,0 @@
-- call here().click or game.click on pic clicks
input.click = function(s, press, mb, x, y, px, py)
if press and px then
return "__mclick__ "..mb..','..px..','..py;
end
end
game.action = function(s, cmd,...)
if cmd == '__mclick__' then
local r
local v
v, r = call(here(), 'click', unpack(arg));
if not v and r ~= true then
v, r = call(ref(game), 'click', unpack(arg));
end
if not v then
return nil, true
end
return v, r
end
return nil,true
end

View file

@ -1,49 +0,0 @@
-- example module
require "timer"
require "theme"
function fading_goto(where, step, bg)
fading_room.where = where
fading_room.step = game.gui.fading;
if step then fading_room.step = step end
fading_room._bg = bg
return goto 'fading_room'
end
game.fading = stead.hook(game.fading,
function(f, s, ...)
local r,v = f(s, unpack(arg))
if r and fading_room.active then
if from() == fading_room then
fading_room.active = false
end
return true, fading_room.step
end
return r,v
end)
fading_room = room {
nam = true;
var { active = false };
var { where = 'main' };
var { step = 4 };
pic = true;
entered = function(s)
s.active = true;
if s._bg then
s._saved_bg = theme.get 'scr.gfx.bg';
theme.gfx.bg(s._bg);
end
s._timer = timer:get();
timer:set(1);
end;
exit = function(s)
if s._bg then
theme.gfx.bg(s._saved_bg)
end
end;
timer = function(s)
timer:set(s._timer);
goto(s.where)
end
}

View file

@ -1,40 +0,0 @@
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
body { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12;
margin-left: 64px;
margin-top: 64px;
margin-right: 64px;
background: #f0f0f0;
}
-->
</style>
<title>INSTEAD -- interpreter of simple text adventures for Unix and Windows</title>
</head><body bgcolor="#f0f0f0">
<h2>INSTEAD 1.4.6</h2>
<p>INSTEAD -- interpreter of simple text adventures for Unix and Windows.<br>
INSTEAD was designed to interpret the games that are the mix of visual novels, text quests and classical 90'ss quests.</p>
<hr>
Links:
<ul>
<li><a href="http://code.google.com/p/instead-games/wiki/Screenshots">Screenshots</a>
<li><a href="http://code.google.com/p/instead-games/downloads/list">Games</a>
<li><a href="http://instead.syscall.ru/forum">Forum</a>
<li><a href="http://instead.syscall.ru/wiki/en/documentation">English Documentation</a>
<li><a href="writing_games-en.html">Local Documentation copy</a>
</ul>
<hr>
Ресурсы:
<ul>
<li><a href="http://instead.syscall.ru/screenshots">Скриншоты</a>
<li><a href="http://instead.syscall.ru/games">Игры</a>
<li><a href="http://instead.syscall.ru/forum">Форум</a>
<li><a href="http://instead.syscall.ru/wiki/ru/documentation">Документация по программированию игр</a>
<li><a href="writing_games.html">Локальная копия Документации</a>
</ul>
<hr>
<p align = "right">(c)by Peter Kosyh, '2009-2010 [gl00my(dog)mail.ru, jabber:gl00my@jabber.ru]</p>
</body></html>

View file

@ -1,149 +0,0 @@
.TH INSTEAD 6 "Version 1.4.6" Instead GAMES
.SH NAME
INSTEAD - Simple Text Adventure Engine, The Interpreter
.SH DESCRIPTION
The interpreter of STEAD (Simple Text Adventures) allows to play games that combine visual novels, text adventures and classic quests of 1990-s.
The STEAD games features are:
.TP
* very simple source code of the stories. (based on LUA);
.TP
* the ability to use graphical or textual (readline) game interface;
.TP
* graphic interface supports music and images;
.TP
* graphic interpreter theme support \- a game may change the interface look;
.TP
* portability (originally written for Linux, depends on SDL and lua).
.SH SYNOPSIS
.B sdl-instead
.I [options] [game.zip to run]
.SH OPTIONS
.TP
.B -debug
Debug mode (for game developers).
.TP
.B -alsa
Force ALSA sound (Linux only).
.TP
.B -nosound
Run the game without sound.
.TP
.B -gamespath <path>
Add path with games.
.TP
.B -themespath <path>
Add path with themes.
.TP
.B -nostdgames
Do not use default games.
.TP
.B -nostdthemes
Do not use default themes.
.TP
.B -game <basename>
Select game in gamespath.
.TP
.B -theme <basename>
Select theme in themespath.
.TP
.B -fullscreen
Run the game in fullscreen mode.
.TP
.B -window
Run the game in windowed mode.
.TP
.B -noautosave
Disable autosave/autoload.
.TP
.B -encode <lua file> [encoded file]
Encode lua file. Encoded file can be executed with doencfile("encoded file").
.TP
.B -idf <path to resources directory or game>
Build idf file [INSTEAD data file] from directory.
.TP
.B -mode [WxH]
Use WxH resolution.
.TP
.B -nopause
Do not pause the game on window minimize.
.TP
.B -install [game in zip]
Install game from zip archive
.TP
.B -quit
Quit :)
.TP
.B -appdata [fullpath]
Store saves and settings in appdata path. Path must exist!
.TP
.B -chunksize [size in bytes]
Size for audio buffer. Try this if sound lags.
.TP
.B -version
Show version and exit.
.PP
Configuration file name is 'insteadrc' and it's located in ~/.instead/.
Games can be downloaded from http://instead.googlecode.com. Unzip them
in ~/.instead/games.
.SH CONTROLS
Please, see tutorial.
.SH LICENCE
This is free software; you can redistribute it and/or modify it
under the terms specified in the GNU Public Licence (GPL).
.SH WARRANTY
None.
.SH COPYRIGHT AND CREDITS
.TP
.B Peter Kosyh
INSTEAD author.
.TP
.B Ilya Ryndin
Initial port to Windows.
.TP
.B Mahno Aleksey
Port to Android.
.TP
.B .dm
Port to Mac OS X.
.TP
.B Andrey Afletdinov
Port to Windows CE.
.TP
.B Vadim Balashoff
Advices.
.TP
.B Vladimir Zhirov
Advices.
.TP
.B Alexander Yakovlev
manual.tex support.
.TP
.B Serj Kalichev
Advices and default theme correction.
.TP
.B Vladimir Podobaev, Oleg Gvozdev
Testers.
.TP
.B Alexander Soborov
Wiki support.
.TP
Many others for comments, bug reports, games and ideas.
.SH SEE ALSO
.BR http://instead.googlecode.com

File diff suppressed because it is too large Load diff

View file

@ -1,56 +0,0 @@
====== Модуль Click ======
^ Подключение | require %%"%%click%%"%% |
^ Тип | расширение кода |
^ Зависимости | нет |
===== Описание =====
Модуль позволяет удобным способом отслеживать клики мышкой по картинке сцены.
При этом, во время клика будет вызван обработчик click текущей сцены, или
одноименный обработчик game.click. В параметрах передаются координаты клика (x, y)
в системе координат оригинального (немасштабированного) изображения. Координата 0,0 соответствует
верхнему левому углу.
Начиная с 1.4.0 функциональность модуля click расширена.
Если необходимо получать события кликов в любой области игрового экрана (если щелчок пришелся на фон), необходимо установить переменную click.bg:
click.bg = true
При этом, в обработчик сначала придут координаты клика фона и координаты клика картинки (если клик пришелся на картинку);
game.click(s, x, y, px, py)
Внимание!!! В режиме прямого доступа (см. модуль sprites) координаты кликов всегда приходят относительно фона.
Если необходимо получать события не только нажатия, но и отжатия, используйте переменную click.press:
click.press = true;
Тогда, в обработчик придет булевое значение press. При нажатии кнопки мыши press установлен в true, при отжатии в false.
game.click(s, press, x, y, px, py)
Если необходимо получать клики не только от первой кнопки мыши, используйте переменную click.button. При этом, в обработчик будет передан код кнопки мыши.
click.button = true
game.click(s, press, button, x, y, px, py)
===== Примеры использования =====
<code lua>
game.click = function(s, x, y)
p ("Click at:",x,",", y);
end
house = room {
nam = 'Дом';
pic = 'house.png';
click = function(s, x, y)
if x > 100 and x < 120 and y > 50 and y < 90 then
goto 'street'
end
end
-- ...
}
</code>

View file

@ -1,19 +0,0 @@
====== Модуль Dash ======
^ Подключение | require %%"%%dash%%"%% |
^ Тип | игровой |
^ Зависимости | [[Format]] |
===== Описание =====
Заменяет последовательность символов %%--%% на символ --. Замена происходит //только//
при выводе содержимого сцены.
===== Примеры использования =====
<code lua>
require "dash"
main = room {
nam = 'Введение';
dsc = [[ -- Ну, начнем!!!]];
}
</code>

View file

@ -1,19 +0,0 @@
====== Модуль Dbg ======
^ Подключение | require %%"%%dbg%%"%% |
^ Тип | игровой |
^ Зависимости | [[input]] |
===== Описание =====
Включает отладчик. Отладчик позволяет:
* переходить в разные локации;
* брать и выбрасывать предметы;
* выполнять lua код;
* делать дамп состояния объектов;
===== Примеры использования =====
После включения модуля в вашу игру, кликните на объект debug в инвентаре,
или нажмите клавишу "F7".

View file

@ -1,18 +0,0 @@
====== Модуль Format ======
^ Подключение | require %%"%%format%%"%% |
^ Тип | расширение кода |
^ Зависимости | нет |
===== Описание =====
Модуль format выполняет форматирование вывода. По умолчанию все настройки выключены:
===== Примеры использования =====
<code lua>
format.para = false -- отступы в начале абзаца;
format.dash = false -- замена двойного - на тире;
format.quotes = false -- замена " " на << >>;
format.filter = nil -- пользовательская функция замены;
</code>
Вы можете пользоваться модулями [[ru:gamedev:modules:para|para]], [[ru:gamedev:modules:dash|dash]], [[ru:gamedev:modules:quotes|quotes]] для включения отдельных настроек.

View file

@ -1,28 +0,0 @@
====== Модуль Hideinv ======
^ Подключение | require %%"%%hideinv%%"%% |
^ Тип | расширение кода |
^ Зависимости | нет |
===== Описание =====
Модуль Hideinv позволяет временно выключать объекты в инвентаре для выбранных комнат.
===== Примеры использования =====
При определении комнаты, просто задайте аттрибут hideinv, например:
<code lua>
require "hideinv"
happyend = room {
nam = 'Конец';
hideinv = true;
dsc = [[ Вы прошли игру! ]];
}
</code>
===== Особенности =====
Если ваша игра использует модуль [[xAct]] и вы хотите использовать свойство hideinv в xroom,
включите модуль Hideinv раньше модуля [[xAct]].

View file

@ -1,17 +0,0 @@
====== Модуль Hotkeys ======
^ Подключение | require %%"%%hotkeys%%"%% |
^ Тип | игровой |
^ Зависимости | [[Kbd]] |
===== Описание =====
Модуль Hotkeys используется для быстрого выбора фраз в диалогах с помощью цифровых
клавиш 1-9 на клавиатуре.
===== Примеры использования =====
Пример использования достаточно очевиден: в диалогах при нажатии цифровых клавиш от одного до девяти выбирается реплика, соответствующая нажатой клавише. Реплику больше 9й выбрать горячей клавишей нельзя.

View file

@ -1,19 +0,0 @@
====== Модуль Para ======
^ Подключение | require %%"%%para%%"%% |
^ Тип | игровой |
^ Зависимости | [[Format]] |
===== Описание =====
Ставит отступ в начале каждого параграфа в соответствии с русской типографской традицией. Дополнение отступом производится //только// при выводе содержимого сцены.
Вы можете менять количество пробелов в отступе с помощью задания format.para_space:
<code lua>
format.para_space = " ";
</code>

View file

@ -1,37 +0,0 @@
====== Модуль Prefs ======
^ Подключение | require %%"%%prefs%%"%% |
^ Тип | расширение кода |
^ Зависимости | нет |
===== Описание =====
Этот модуль позволяет сохранять настройки игры. Другими словами, сохраненная информация не зависит от состояния игры.
Такой механизм можно использовать, например, для реализации системы достижений или счетчика количества прохождений игры.
prefs это объект, все переменные которого буду сохранены.
prefs:store() -- сохранить настройки.
prefs:purge() -- удалить все настройки.
Загрузка настроек выполняется автоматически при инициализации игры (перед вызовом функции init()), но вы можете инициировать загрузку и вручную:
prefs:load();
===== Примеры использования =====
<code lua>
instead_version "1.3.0"
require "click"
require "prefs"
prefs.counter = 0
game.click = function(s)
prefs.counter = prefs.counter + 1
prefs:store();
p("Кликов:", prefs.counter);
end
game.pic = 'clickme.png'
-- ...
</code>

View file

@ -1,34 +0,0 @@
====== Модуль Quotes ======
^ Подключение | require %%"%%quotes%%"%% |
^ Тип | игровой |
^ Зависимости | [[Format]] |
===== Описание =====
Заменяет все двойные кавычки на типографские ("ёлочки").
Также заменяет ,, (две запятые) и %%''%% (два апострофа) на кавычки-"лапки" („”).
Замена происходит //только// при выводе содержимого сцены.
Рекомендуется к применению для соответствия русской типографской традиции. Напомним, что обычно используются "ёлочки", но для употребления кавычек в кавычках и для передачи прямой речи следует использовать "лапки".
===== Примеры использования =====
<code>
"Текст в елочках"
</code>
Результат: «текст в елочках».
<code>
,,Текст в лапках''.
</code>
Результат: „текст в лапках“.
<code>
_"Текст в елочках _"вложенный"_
</code>
Результат: «текст в елочках «вложенный».

View file

@ -1,69 +0,0 @@
====== Модуль Theme ======
^ Подключение | require "theme" |
^ Тип | игровой |
^ Зависимости | нет |
===== Описание =====
Начиная с версии 1.3.0, модуль theme позволяет модифицировать параметры темы на лету.
Для этого, используются следующие функции:
<code lua>
-- настройка окна вывода
theme.win.geom(x, y, w, h)
theme.win.color(fg, link, alink)
theme.win.font(name, size, height)
theme.win.gfx.up(pic, x, y)
theme.win.gfx.down(pic, x, y)
-- настройка инвентаря
theme.inv.geom(x, y, w, h)
theme.inv.color(fg, link, alink)
theme.inv.font(name, size, height)
theme.inv.gfx.up(pic, x, y)
theme.inv.gfx.down(pic, x, y)
theme.inv.mode(mode)
-- настройка меню
theme.menu.bw(w)
theme.menu.color(fg, link, alink)
theme.menu.font(name, size, height)
theme.menu.gfx.button(pic, x, y)
-- настройка графики
theme.gfx.cursor(norm, use, x, y)
theme.gfx.mode(mode)
theme.gfx.pad(pad)
theme.gfx.bg(bg)
-- настройка звука
theme.snd.click(name);
</code>
Если необходимо изменить только часть параметров, в качестве неизменяемых параметров можно указывать значение nil. Например:
<code lua>
theme.win.font(nil, 64);
</code>
Существует возможность чтения текущих параметров тем:
<code lua>
theme.get 'имя переменной темы';
</code>
Начиная с версии INSTEAD 1.4.0 вы можете сбросить значение параметра темы на то, которое было установлено во встроенной теме игры:
<code lua>
theme.reset 'имя переменной';
theme.win.reset();
-- ...
</code>
===== Примеры использования =====
<code lua>
theme.gfx.bg "dramatic_bg.png";
theme.win.geom (0,0, theme.get 'scr.w', theme.get 'scr.h');
theme.inv.mode 'disabled'
</code>

View file

@ -1,43 +0,0 @@
====== Модуль Timer ======
^ Подключение | require %%"%%timer%%"%% |
^ Тип | расширение кода |
^ Зависимости | нет |
===== Описание =====
Модуль позволяет получать события от таймера удобным способом.
Функцию обработчика таймера выполняет game.timer.
Если game.timer возвращает пустое значение,
сцена не перерисовывается. В противном случае,
возвращаемое значение интерпретируется как действие.
Вы можете делать локальные для комнаты обработчики timer. Если
в комнате объявлен обработчик timer, он вызовется вместо game.timer
===== Примеры использования =====
<code lua>
game.timer = function(s)
set_sound('gfx/beep.ogg');
p "Timer:"
p (time())
end
function init()
timer:set(1000)
end
</code>
<code lua>
myroom = room {
entered = function(s)
timer:set(1000);
end;
timer = function(s)
timer:stop();
goto 'myroom2';
end;
nam = 'Проверка таймера';
dsc = [[Ждите.]];
}
</code>

View file

@ -1,59 +0,0 @@
====== Модуль xAct ======
^ Подключение | require %%"%%xact%%"%% |
^ Тип | расширение кода |
^ Зависимости | нет |
===== Описание =====
Модуль позволяет делать ссылки на объекты из других объектов, реакций и life методов в форме: {объект(параметры):текст}.
Начиная с версии 1.2.2 (instead_version "1.2.2") символ разделителя задается stead.delim и по-умолчанию содержит '|'. То-есть формат записи выглядит так: {объект(параметры)|текст}.
Где 'объект' это сам объект или атрибут nam объекта. При этом, чтобы ссылка работала, объект должен
присутствовать в сцене.(Начиная с 1.2.2 -- не обязательно).
(параметры) -- необязательные параметры в виде: (текст, текст, ...)
'текст' -- то, как ссылка выглядит в игре для игрока.
Модуль содержит в себе функцию xact, которая создает объект - простейшую реакцию.
Первый параметр функции -- имя, второй -- реакция, которая может быть строкой, функцией или code.
Модуль содержит в себе реализацию комнаты с расширенным описанием: xroom. Если в такой комнате задать
атрибут xdsc, то он будет выведен в области описаний объектов.
Функция xdsc позволяет более гибко управлять выводом текста в области предметов. См. примеры.
===== Примеры использования =====
<code lua>
main = room {
forcedsc = true;
dsc = [[От автора. Эту игру я писал очень {note1|долго}.]];
obj = {
xact('note1', [[Больше 10 лет.]]);
}
}
</code>
<code lua>main = room {
forcedsc = true;
dsc = [[Я в комнате.]];
xdsc = [[ Я вижу {apple|яблоко} и {knife|нож}. ]];
other = [[ Еще здесь лежат {chain|цепь} и {tool|пила}.]];
obj = {
xdsc(), -- 'xdsc method by default'
xdsc 'other',
'apple', 'knife', 'chain', 'tool',
}
}
</code>
<code lua>
main = xroom {
forcedsc = true;
dsc = [[Я в комнате.]];
xdsc = [[ Я вижу {apple|яблоко} и {knife|нож}. ]];
obj = {
'apple', 'knife', 'chain', 'tool',
}
}
</code>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

@ -1 +1 @@
Subproject commit 6a66be47220b8a6d7c61878ed654d78e18e9f4ba
Subproject commit 5e37ca90163653df11bb804655518dfdde4b9593

View file

@ -28,17 +28,14 @@ MAIN_MENU = \
<a:/ask_quit>Выход</a>
ABOUT_MENU = \
INSTEAD SDL - %s\n\
STEED - %s\n\
На основе INSTEAD SDL\n\
Яковлев А.Я. '2011\n\
\n\
Интерпретатор простых\n\
текстовых приключений:\n\
Автор INSTEAD:\n\
Косых П.А. '2009-2011\n\
\n\
Адаптация для Windows:\n\
Рындин И.В. '2009\n\
\n\
Сайт проекта:\n\
<u>http://instead.googlecode.com</u>\n\
Илья Рындин '2009\n\
\n\
<a:/main>Назад</a>

View file

@ -1343,7 +1343,7 @@ int gfx_video_init(void)
{
char title[4096];
strcpy( title, "INSTEAD SDL - " );
strcpy( title, "Steed v." );
strcat( title, VERSION );
if (TTF_Init()) {