maybe ?
This commit is contained in:
parent
e1c482979b
commit
97f042d693
5
again.ml
5
again.ml
|
@ -1078,7 +1078,7 @@ let seek_player (gd : game_data) (dgs : danger_map) =
|
|||
let directn = path_seek gd dgs (gd.dt -. interval *. !remaining_dash) !cxi !cyi destx desty (player_range + int_of_float !remaining_dash) foundpath in
|
||||
if !foundpath then begin
|
||||
found := true ;
|
||||
if logg then Printf.fprintf stderr "Found target (%d)\n" pl ;
|
||||
if logg then Printf.fprintf stderr "Found target (%d) [%d]\n" pl (int_of_float !remaining_dash) ;
|
||||
if logg then Printf.fprintf stderr "(%d, %d) --[%d]--> (%d, %d)\n" !cxi !cyi directn destx desty ;
|
||||
if destx = !cxi && desty = !cyi then begin
|
||||
if logg then Printf.fprintf stderr " Trapping\n" ;
|
||||
|
@ -1122,6 +1122,7 @@ let seek_player (gd : game_data) (dgs : danger_map) =
|
|||
remaining_dash := max 0. (!remaining_dash -. 1.)
|
||||
done ;
|
||||
if logg then Printf.fprintf stderr "Success!\n" ;
|
||||
remaining_dash := !remaining_dash +. 1. ;
|
||||
true
|
||||
with
|
||||
| ReturnBool b -> b ;;
|
||||
|
@ -1378,7 +1379,7 @@ print_dangers danger_data ;;*)
|
|||
print_dangers danger_data ;;*)
|
||||
|
||||
if read_queue "again.sav" then begin
|
||||
()
|
||||
remaining_dash := !remaining_dash +. 1.
|
||||
end
|
||||
else begin
|
||||
let direction = ref 4 in
|
||||
|
|
37
entrees.txt
37
entrees.txt
|
@ -1,21 +1,22 @@
|
|||
69.28
|
||||
1
|
||||
107.0
|
||||
0
|
||||
13 21
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 1
|
||||
1 0 1 0 1 0 1 0 1 2 1 0 1 0 1 0 1 0 1 0 1
|
||||
1 0 0 0 0 0 0 0 2 0 2 0 0 0 0 2 0 2 0 0 1
|
||||
1 0 1 0 1 0 1 3 1 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2 0 0
|
||||
1
|
||||
10 3 0
|
||||
|
|
|
@ -384,11 +384,7 @@ def execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, jo
|
|||
joueur[J_PIEGESRESTANTS]-=1
|
||||
pieges.append([i,j,indiceJoueur])
|
||||
print("||||| trap at", i, j, "|||||")
|
||||
ip,jp = prochain(i,j,direction)
|
||||
if plateau[ip][jp]==PLATEAU_VIDE and trouve_objet(ip, jp, bombes)==None:
|
||||
joueur[J_LIGNE]=ip
|
||||
joueur[J_COLONNE]=jp
|
||||
|
||||
|
||||
i, j = joueur[J_LIGNE], joueur[J_COLONNE]
|
||||
indicePiege = trouve_objet(i,j, pieges)
|
||||
penalite = 0
|
||||
|
@ -396,8 +392,18 @@ def execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, jo
|
|||
piege = pieges[indicePiege]
|
||||
if piege[P_JOUEUR] != indiceJoueur:
|
||||
penalite = 3
|
||||
print(indiceJoueur, "|||||||| has triggered", piege[P_JOUEUR], "'s trap (at", i, j, ")||||||||")
|
||||
pieges.pop(indicePiege)
|
||||
|
||||
ip,jp = prochain(i,j,direction)
|
||||
if plateau[ip][jp]==PLATEAU_VIDE and trouve_objet(ip, jp, bombes)==None and penalite==0:
|
||||
print(joueur[J_LIGNE], joueur[J_COLONNE], "--->", ip, jp)
|
||||
joueur[J_LIGNE]=ip
|
||||
joueur[J_COLONNE]=jp
|
||||
else:
|
||||
print("still")
|
||||
|
||||
i, j = joueur[J_LIGNE], joueur[J_COLONNE]
|
||||
indicePowerup = trouve_objet(i,j,powerups)
|
||||
if indicePowerup != None:
|
||||
powerup = powerups.pop(indicePowerup)
|
||||
|
|
|
@ -1 +1 @@
|
|||
1 0
|
||||
4 0
|
Loading…
Reference in New Issue