fix in moving

This commit is contained in:
p.kosyh 2011-08-11 12:41:53 +00:00
parent 035003a1d9
commit 3a40eba5c3
3 changed files with 11 additions and 7 deletions

1
debian/changelog vendored
View file

@ -2,6 +2,7 @@ instead (1.4.6) unstable; urgency=low
* bug fix in gamefile; * bug fix in gamefile;
* bug fix in lifes output; * bug fix in lifes output;
* bug fix in PLAYER_MOVED and lifes;
-- Peter Kosyh <p.kosyh@gmail.com> Mon, 09 Aug 2011 12:24:00 +0400 -- Peter Kosyh <p.kosyh@gmail.com> Mon, 09 Aug 2011 12:24:00 +0400

View file

@ -42,7 +42,7 @@ Without this line STEAD API will stay in compatible(legacy) mode.
</WRAP> </WRAP>
//Game initialization// should be defined as init function. For example: //Game initialization// should be defined as init function. For example:
<code> <code lua>
function init() function init()
me()._know_truth = false me()._know_truth = false
take(knife); take(knife);
@ -56,18 +56,18 @@ From version 1.2.0 Windows and Unix standalone builds looks into ''./appdata/gam
===== 1. Scene ===== ===== 1. Scene =====
A scene is a game unit. Within it a player can examine all the scene objects and interact with them. A game should contain at least one scene with the name “main”. A scene is a game unit. Within it a player can examine all the scene objects and interact with them. A game should contain at least one scene with the name ''main''.
<code lua> <code lua>
main = room { main = room {
nam = 'main room', nam = 'main room',
dsc = 'You are in a large room.', dsc = 'You are in a large room.',
}; };
</code> </code>
The record means creation of an object “main” of a type “room”. Every object has attributes and handlers. For example the attribute “nam” (name) is obligatory for every object. The record means creation of an object ''main'' of a type ''room''. Every object has attributes and handlers. For example the attribute ''nam'' (name) is obligatory for every object.
The “nam” attribute for a scene will be the scene name when it is played. The name of a scene is also used to identify it when passing between scenes. The ''nam'' attribute for a scene will be the scene name when it is played. The name of a scene is also used to identify it when passing between scenes.
The “dsc” attribute is a description of a static part of the scene. It is shown once when entering the scene or after the explicit “look” command. The ''dsc'' attribute is a description of a static part of the scene. It is shown once when entering the scene or after the explicit ''look'' command.
Attention!!! You may use symbol “;” instead of “,”. For example: Attention!!! You may use symbol “;” instead of “,”. For example:
<code lua> <code lua>
@ -79,12 +79,12 @@ main = room {
Attention!!! If your creative design requires the static part description to be shown every time, you may define the “forcedsc” parameter for your game (at the start). Attention!!! If your creative design requires the static part description to be shown every time, you may define the “forcedsc” parameter for your game (at the start).
<code lua> <code lua>
game.forcedsc = true; game.forcedsc = true;
</code lua> </code>
Or similarly set the “forcedsc” for particular scenes. Or similarly set the “forcedsc” for particular scenes.
For long descriptions the following format is convenient: For long descriptions the following format is convenient:
<code>dsc = [[ Very long description... ]],</code> <code lua>dsc = [[ Very long description... ]],</code>
In this format line breaks are ignored. If you need paragraph breaks in the description, use the “^” symbol. In this format line breaks are ignored. If you need paragraph breaks in the description, use the “^” symbol.

View file

@ -1467,6 +1467,7 @@ end
function game_life(self) function game_life(self)
local i,o local i,o
local av,v local av,v
local was_moved
stead.in_life_call = true; stead.in_life_call = true;
stead.lifes_off = list {}; -- lifes to off stead.lifes_off = list {}; -- lifes to off
stead.PLAYER_MOVED = PLAYER_MOVED stead.PLAYER_MOVED = PLAYER_MOVED
@ -1480,6 +1481,7 @@ function game_life(self)
if PLAYER_MOVED then -- clear life output, but not current if PLAYER_MOVED then -- clear life output, but not current
av = nil av = nil
v = nil v = nil
was_moved = true
end end
if pre or (PLAYER_MOVED and pre ~= false) then if pre or (PLAYER_MOVED and pre ~= false) then
av = stead.par(' ', av, vv); av = stead.par(' ', av, vv);
@ -1488,6 +1490,7 @@ function game_life(self)
end end
end end
end end
PLAYER_MOVED = was_moved
if not PLAYER_MOVED then PLAYER_MOVED = stead.PLAYER_MOVED end if not PLAYER_MOVED then PLAYER_MOVED = stead.PLAYER_MOVED end
stead.PLAYER_MOVED = nil stead.PLAYER_MOVED = nil
stead.in_life_call = false; stead.in_life_call = false;