diff --git a/Player020HiderAndSeeker.oz b/Player020HiderAndSeeker.oz index ba29ec6834add6c9072fb1058d8614ef6a5fe597..23e2fc0ae38b9f8488a260554f23e79a1fb59da8 100644 --- a/Player020HiderAndSeeker.oz +++ b/Player020HiderAndSeeker.oz @@ -445,7 +445,7 @@ define [] sayAnswerDrone(Drone ID Answer)|T then %% Ignore {AliveTreatStream T State} [] sayPassingSonar(ID Resp)|T then - ID=State.id Resp=pt(x:State.pos.x y:{Max 1 (({OS.rand} mod Input.nColumn)+1)}) + ID=State.id Resp=pt(x:State.pos.x y:{Max Input.nColumn (({OS.rand} mod Input.nColumn)+1)}) {AliveTreatStream T State} [] sayAnswerSonar(ID Answer)|T then %% Ignore {AliveTreatStream T State} diff --git a/Player020Human.oz b/Player020Human.oz index 5fe73299af66089cf2ac17db7033b3668a95c010..c312c18938f1cd1ae18382461f82bea285314acc 100644 --- a/Player020Human.oz +++ b/Player020Human.oz @@ -391,15 +391,16 @@ define end end - proc{ShowMessages ID Msg} + proc{ShowMessages Msg} M R + CloseButton Desc in - Desc=message(aspect:200 + Desc=message(aspect:800 init:Msg handle:M ) - CloseButton = button(text:Close glue: se action:toplevel#close) - {{QTk.build td(Desc CloseButton)} show} + CloseButton = button(text:"Close" action:toplevel#close) + {{QTk.build td(title:"Notification" Desc CloseButton)} show} end @@ -533,23 +534,26 @@ define Answer=State.pos.y==Y {System.show 'Player'#State.id.id#'replied'#sayPassingDrone(drone(column Y) ID Answer)} {AliveTreatStream T State} - [] sayAnswerDrone(Drone ID Answer)|T then %% Ignore + [] sayAnswerDrone(Drone ID Answer)|T then {System.show 'Player'#State.id.id#'received'#sayAnswerDrone(Drone ID Answer)} + {ShowMessages sayAnswerDrone(Drone ID Answer)} {AliveTreatStream T State} [] sayPassingSonar(ID Resp)|T then - ID=State.id Resp=pt(x:State.pos.x y:{Max 0 State.pos.y}) + ID=State.id Resp=pt(x:State.pos.x y:(({OS.rand} mod Input.nColumn)+1)) {System.show 'Player'#State.id.id#'received'#sayPassingSonar(ID Resp)} {AliveTreatStream T State} - [] sayAnswerSonar(ID Answer)|T then %% Ignore + [] sayAnswerSonar(ID Answer)|T then {System.show 'Player'#State.id.id#'received'#sayAnswerSonar(ID Answer)} + {ShowMessages sayAnswerSonar(ID Answer)} {AliveTreatStream T State} - [] sayDamageTaken(ID Damage LifeLeft)|T then %% Ignore + [] sayDamageTaken(ID Damage LifeLeft)|T then {System.show 'Player'#State.id.id#'received'#sayDamageTaken(ID Damage LifeLeft)} + {ShowMessages sayDamageTaken(ID Damage LifeLeft)} {AliveTreatStream T State} - [] sayDeath(ID)|T then NewState RemovedDeadEnemy in %% Ignore + [] sayDeath(ID)|T then NewState RemovedDeadEnemy in {System.show 'Player'#State.id.id#'received'#sayDeath(ID)} + {ShowMessages sayDeath(ID)} {AliveTreatStream T State} - end end @@ -559,6 +563,7 @@ define in {NewPort Stream Port} thread + {ShowMessages theGameisStarting} {AliveTreatStream Stream '#'( id:id(id:ID color:Color name:player020human) life:Input.maxDamage pos:pt(x:0 y:0) diff --git a/Player020Random.oz b/Player020Random.oz index 4620141efe459c3d1315615f02bc642909cdfb20..b9785cce89ee324e61a8ada0d28f3c13cd45f957 100644 --- a/Player020Random.oz +++ b/Player020Random.oz @@ -407,7 +407,7 @@ define {AliveTreatStream T State} [] sayPassingSonar(ID Resp)|T then {System.show 'Player'#State.id.id#'received'#sayPassingSonar(ID Resp)} - ID=State.id Resp=pt(x:State.pos.x y:{Max 0 State.pos.y}) + ID=State.id Resp=pt(x:State.pos.x y:(({OS.rand} mod Input.nColumn)+1)) {AliveTreatStream T State} [] sayAnswerSonar(ID Answer)|T then %% Ignore {System.show 'Player'#State.id.id#'received'#sayAnswerSonar(ID Answer)}