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
of nil#nil then nil
[] (Player|OtherPlayers)#(Color|OtherColors) then
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
)|{InitPlayers OtherPlayers OtherColors AccID+1}
end
......@@ -37,7 +37,7 @@ define
fun {WeHaveAWinner Players Acc}
case Players of nil then Acc==1
[]Player|Others then Resp in
[] Player|Others then Resp in
{Send Player.port isDead(Resp)}
if Resp==true then
{WeHaveAWinner Others Acc}
......@@ -346,14 +346,13 @@ define
end
end
in
%%1.
%% Build the GUI Window
{Send GUI_PORT buildWindow}
%%2. Create Port for Every Player
%% Create Port for Every Player
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
proc{$ Player}
ID Pos
......@@ -363,7 +362,7 @@ in
{Send Player.port dive}
end}
%%4. Launch the game
%% Launch the game
if Input.isTurnByTurn then
{TurnByTurn PlayersList 1}
{System.show '----'}
......@@ -371,6 +370,6 @@ in
{List.forAll PlayersList proc{$ Player} thread {Simultaneous Player PlayersList} end end}
end
%%5. Termination
%% Termination
{List.forAll PlayersList proc{$ Player} {Send Player.port nil} end }
end
......@@ -495,13 +495,13 @@ define
in
{NewPort Stream Port}
thread
{AliveTreatStream Stream '#'( id:ID
{AliveTreatStream Stream '#'( id:id(id:ID color:Color name:player020hunter)
life:Input.maxDamage
pos:pt(x:0 y:0)
chargingItems:[ {GetNewChargeFireItem drone} {GetNewChargeFireItem missile} {GetNewChargeFireItem missile} ]
chargedItems:nil
targets:nil
enemies:{InitEnemies ID.id Input.nbPlayer nil}
enemies:{InitEnemies ID Input.nbPlayer nil}
history:nil
droneLogs:nil
absHistory:nil)}
......
......@@ -420,14 +420,14 @@ define
in
{NewPort Stream Port}
thread
{AliveTreatStream Stream '#'( id:ID
{AliveTreatStream Stream '#'( id:id(id:ID color:Color name:player020hunter)
life:Input.maxDamage
pos:pt(x:0 y:0)
chargingItems:{InitChargingItemsMissile Input.nbPlayer nil}
chargedItems:nil
placedMines:nil
targets:nil
enemies:{InitEnemies ID.id Input.nbPlayer nil}
enemies:{InitEnemies ID Input.nbPlayer nil}
history:nil)}
end
Port
......
......@@ -352,7 +352,6 @@ define
in
{NewPort Stream Port}
thread
{AliveTreatStream Stream '#'( id:ID
life:Input.maxDamage
pos:pt(x:0 y:0)
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