diff --git a/Winner.gif b/Winner.gif new file mode 100644 index 0000000..1ca0144 Binary files /dev/null and b/Winner.gif differ diff --git a/gui.pl b/gui.pl index ce1c3e4..b6fd665 100644 --- a/gui.pl +++ b/gui.pl @@ -270,6 +270,7 @@ show_controls(D) :- player_tokens(Player, Tokens), string_concat('Aktiv: Spieler ', Player, String_active_player), string_concat('Tokens: ', Tokens, String_tokens), + % die Bausteine zur Steuerung send(Controls, append, new(Label1, label(name, String_active_player))), send(Controls, append, new(Label4, label(name, String_tokens))), @@ -281,7 +282,7 @@ show_controls(D) :- send(Controls, append, new(ToY,text_item('Y:'))), send(Controls, append, button('Bestaetigen',message(@prolog, process_move_unit, FromX, FromY, ToX, ToY, Controls))), send(Controls, append, button('Zug Beenden',message(@prolog, process_end_turn))), - %send(D, left, Controls), + send(Controls, open), assert(game_control(Controls)). @@ -316,6 +317,19 @@ process_end_turn :- update_controls, spielfeld. +game_over_gui(Winner) :- + game_control(C), + game_window(D), + send(C, destroy), + send(D, destroy), + new(G, dialog('Winner')), + new(I, image('Winner.gif')), + new(B, bitmap(I)), + send(G, display, B), + send(G, append, new(Label, label(name, Winner))), + send(G, open). + + %TODO delete test_change :- new(D, dialog), diff --git a/logik.pl b/logik.pl index 6ddc1f7..c4b8c4d 100644 --- a/logik.pl +++ b/logik.pl @@ -185,6 +185,7 @@ game_over(Winner) :- % Falls das Spiel vorbei ist, mach nix end_turn :- game_over(Winner), + game_over_gui(Winner), write("Game Over!"), nl, write("Player "), @@ -232,7 +233,7 @@ calc_tokens(Tokens) :- last_turn(LastTurn), PreLastTurn is LastTurn - 1, - player_turn(Player, LastTurn, Tlast) + player_turn(Player, LastTurn, Tlast), player_turn(Player, PreLastTurn, Tprelast), % Neue Anzahl der Tokens ausgeben