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: