From d66b78dd8b43664a7c6a160a6d20d40fb43af432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20Garc=C3=ADa?= Date: Wed, 26 Oct 2011 00:38:48 +0200 Subject: [PATCH] fixed README --- README.textile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.textile b/README.textile index fa846ac..7b25050 100644 --- a/README.textile +++ b/README.textile @@ -86,17 +86,17 @@ Will trigger this action: But also this other one: -
Beholder:trigger({'PLAYERDETECTION', player1}, function(x,y) print("player1 detected at ",x,y)
+
Beholder:observe({'PLAYERDETECTION', player1}, function(x,y) print("player1 detected at ",x,y)
Notice that the two "missing elements" of the table will be passed to the callback as additional parameters. Indeed, that second d action will be executed any time player1 is detected, no matter what coordinates. Similarly, you can add an action that will be triggered for any player detection: -
Beholder:trigger({'PLAYERDETECTION'}, function(player,x,y) print(player.no," detected at ",x,y)
+
Beholder:observe({'PLAYERDETECTION'}, function(player,x,y) print(player.no," detected at ",x,y)
As a matter of fact, that code would be exactly equivalent to this other code: -
Beholder:trigger('PLAYERDETECTION', function(player,x,y) print(player.no," detected at ",x,y)
+
Beholder:observe('PLAYERDETECTION', function(player,x,y) print(player.no," detected at ",x,y)
If you want to detect all signals raised (i.e. for logging and debugging) you can do so by observing the empty table: