Skip to content
Extraits de code Groupes Projets
Valider ab279a9a rédigé par Vany Ingenzi's avatar Vany Ingenzi
Parcourir les fichiers

Fixed some bugs in the code

parent 95416266
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -17,7 +17,7 @@ define ...@@ -17,7 +17,7 @@ define
of nil#nil then nil of nil#nil then nil
[] (Player|OtherPlayers)#(Color|OtherColors) then [] (Player|OtherPlayers)#(Color|OtherColors) then
player( player(
port:{PlayerManager.playerGenerator Player Color id(id:AccID color:Color name:Player)} port:{PlayerManager.playerGenerator Player Color AccID}
nbSurface: 0 %% All the players start underwater nbSurface: 0 %% All the players start underwater
)|{InitPlayers OtherPlayers OtherColors AccID+1} )|{InitPlayers OtherPlayers OtherColors AccID+1}
end end
...@@ -37,7 +37,7 @@ define ...@@ -37,7 +37,7 @@ define
fun {WeHaveAWinner Players Acc} fun {WeHaveAWinner Players Acc}
case Players of nil then Acc==1 case Players of nil then Acc==1
[]Player|Others then Resp in [] Player|Others then Resp in
{Send Player.port isDead(Resp)} {Send Player.port isDead(Resp)}
if Resp==true then if Resp==true then
{WeHaveAWinner Others Acc} {WeHaveAWinner Others Acc}
...@@ -346,14 +346,13 @@ define ...@@ -346,14 +346,13 @@ define
end end
end end
in in
%%1. %% Build the GUI Window
{Send GUI_PORT buildWindow} {Send GUI_PORT buildWindow}
%%2. Create Port for Every Player %% Create Port for Every Player
PlayersList={InitPlayers Input.players Input.colors 1} PlayersList={InitPlayers Input.players Input.colors 1}
%%3. Ask Init Point and tell players to dive %% Ask Init Point and tell players to dive
{VisitList PlayersList {VisitList PlayersList
proc{$ Player} proc{$ Player}
ID Pos ID Pos
...@@ -363,7 +362,7 @@ in ...@@ -363,7 +362,7 @@ in
{Send Player.port dive} {Send Player.port dive}
end} end}
%%4. Launch the game %% Launch the game
if Input.isTurnByTurn then if Input.isTurnByTurn then
{TurnByTurn PlayersList 1} {TurnByTurn PlayersList 1}
{System.show '----'} {System.show '----'}
...@@ -371,6 +370,6 @@ in ...@@ -371,6 +370,6 @@ in
{List.forAll PlayersList proc{$ Player} thread {Simultaneous Player PlayersList} end end} {List.forAll PlayersList proc{$ Player} thread {Simultaneous Player PlayersList} end end}
end end
%%5. Termination %% Termination
{List.forAll PlayersList proc{$ Player} {Send Player.port nil} end } {List.forAll PlayersList proc{$ Player} {Send Player.port nil} end }
end end
...@@ -495,13 +495,13 @@ define ...@@ -495,13 +495,13 @@ define
in in
{NewPort Stream Port} {NewPort Stream Port}
thread thread
{AliveTreatStream Stream '#'( id:ID {AliveTreatStream Stream '#'( id:id(id:ID color:Color name:player020hunter)
life:Input.maxDamage life:Input.maxDamage
pos:pt(x:0 y:0) pos:pt(x:0 y:0)
chargingItems:[ {GetNewChargeFireItem drone} {GetNewChargeFireItem missile} {GetNewChargeFireItem missile} ] chargingItems:[ {GetNewChargeFireItem drone} {GetNewChargeFireItem missile} {GetNewChargeFireItem missile} ]
chargedItems:nil chargedItems:nil
targets:nil targets:nil
enemies:{InitEnemies ID.id Input.nbPlayer nil} enemies:{InitEnemies ID Input.nbPlayer nil}
history:nil history:nil
droneLogs:nil droneLogs:nil
absHistory:nil)} absHistory:nil)}
......
...@@ -420,14 +420,14 @@ define ...@@ -420,14 +420,14 @@ define
in in
{NewPort Stream Port} {NewPort Stream Port}
thread thread
{AliveTreatStream Stream '#'( id:ID {AliveTreatStream Stream '#'( id:id(id:ID color:Color name:player020hunter)
life:Input.maxDamage life:Input.maxDamage
pos:pt(x:0 y:0) pos:pt(x:0 y:0)
chargingItems:{InitChargingItemsMissile Input.nbPlayer nil} chargingItems:{InitChargingItemsMissile Input.nbPlayer nil}
chargedItems:nil chargedItems:nil
placedMines:nil placedMines:nil
targets:nil targets:nil
enemies:{InitEnemies ID.id Input.nbPlayer nil} enemies:{InitEnemies ID Input.nbPlayer nil}
history:nil)} history:nil)}
end end
Port Port
......
...@@ -352,7 +352,6 @@ define ...@@ -352,7 +352,6 @@ define
in in
{NewPort Stream Port} {NewPort Stream Port}
thread thread
{AliveTreatStream Stream '#'( id:ID
life:Input.maxDamage life:Input.maxDamage
pos:pt(x:0 y:0) pos:pt(x:0 y:0)
chargingItems:[ {GetNewChargeFireItem mine} {GetNewChargeFireItem missile} chargingItems:[ {GetNewChargeFireItem mine} {GetNewChargeFireItem missile}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter