From ae83a87bc60fc496f987460741b9072698475228 Mon Sep 17 00:00:00 2001 From: tymek Date: Sat, 30 May 2026 12:52:14 +0200 Subject: [PATCH] end --- statek.py | 13 +++++++++++-- testy.py | 23 +++++++++++------------ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/statek.py b/statek.py index f47b161..76f6dda 100644 --- a/statek.py +++ b/statek.py @@ -223,6 +223,7 @@ def aktualizuj_karabiny(): tekst_celu["text"] = "MISJA UKOŃCZONA! ZNISZCZYŁEŚ CELE!" tekst_celu["foreground"] = "gold" root.after(5000, lambda: tekst_celu.place_forget()) + root.after(7000, misja) kamyki_do_usuniecia.sort(reverse=True) for idx in kamyki_do_usuniecia: @@ -266,7 +267,6 @@ def aktualizuj_karabiny(): def misja(): - print("X") global ktura_misja, cele, cele_zniszczone, cel_wymagany ktura_misja += 1 tekst_celu.place(x=20, y=20) @@ -274,7 +274,7 @@ def misja(): cele = [] cele_zniszczone = 0 cel_wymagany = ktura_misja * 5 - + root.after(1000, lambda: tekst_celu.config(text=f"Cele do zniszczenia: {cele_zniszczone}/{cel_wymagany}")) for i in range(cel_wymagany): cx = randrange(200, 900) cy = randrange(200, 600) @@ -406,9 +406,18 @@ def sprawdz_kolizje_czolgu(): hpile["text"] = str(int(hp)) x = 0 tempomat = False + if hp <= 0: + end() break +def end(): + grafika_misji = PhotoImage(file="GAME-OVER.png") + c = Label(root, image=grafika_misji,bg="black")#darkolivegreen") + c.place(relx=0.5, rely=0.5, x=-330) + root.after(1000, exit) + + def gluwna(): global x, tempomat, firerate, czekajmagazynek, pelny, magazynek, ladowanie, pzeladowanie diff --git a/testy.py b/testy.py index a6f815e..eb7e629 100644 --- a/testy.py +++ b/testy.py @@ -1,15 +1,14 @@ -from turtle import * -import turtle as t +import tkinter as tk +from tkinter import font +root = tk.Tk() +# Tworzymy okno z listą, żeby wygodnie przewijać czcionki +listbox = tk.Listbox(root, width=50, height=20) +listbox.pack(padx=10, pady=10) -def cc(c): - if c <= 3: - o = 0 - return - fd(c) - lt(30) - cc(c / 2) +# Sortujemy i dodajemy wszystkie dostępne nazwy czcionek +for f in sorted(font.families()): + listbox.insert(tk.END, f) + print(f) - -cc(80) -t.mainloop() +root.mainloop() \ No newline at end of file