diff --git a/.gitignore b/.gitignore index 8ccf01d..4188c92 100644 --- a/.gitignore +++ b/.gitignore @@ -306,3 +306,17 @@ dist .yarn/install-state.gz .pnp.* +renpy/*-dists/ + +# AI and assistant folders +.antigravitycli/ +.gemini/ +.cline/ +.cursor/ + +# Ren'Py temp files +*/log.txt +*/traceback.txt +*/errors.txt +*/game/cache/ +*/game/saves/ diff --git a/README.md b/README.md index b9f9128..88543e7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,62 @@ -# python_gamejam_examples +# 🎮 Python Game Jam - Průvodce, Ukázky a Zdroje -Toto je malý repozitář na ukázku malých her pro Python Game Jam a tento repozitář šlouží jako odrazový můstek pro vaše hry, které budete tvořit v pythonu \ No newline at end of file +Vítejte v hlavním repozitáři pro **Python Game Jam**! Tento repozitář obsahuje vše, co potřebujete do začátku. Najdete zde ukázky kódu, tipy a triky, jak pracovat s různými herními frameworky v Pythonu. + +*(Poznámka: Samotné zadání a pravidla najdete v souboru `ZADANI_GAME_JAM.md`, který už máte na Moodle.)* + +--- + +## 📂 Co v repozitáři najdete? + +* 📁 **`pygame/`** - Obsahuje 7 plně rozkomentovaných ukázkových her (od Pexesa, přes Pong až po Vesmírnou střílečku). Je to ideální základ pro akční a arkádové hry. +* 📁 **`renpy/`** - Obsahuje 3 ukázkové projekty pro tvorbu příběhových her a vizuálních novel. Uvidíte tam, jak se pracuje s postavami, větvením děje i pokročilými animacemi. +* 📁 **`pure_python/`** - Ukázky her vytvořených v čistém Pythonu bez externích knihoven. Najdete zde textovou adventuru a klasického oběšence. Skvělé pro pochopení logiky a smyček. + +--- + +## 🎨 Kde stáhnout grafiku a zvuky (Assety)? + +Hra není jen o kódu, ale i o vzhledu a atmosféře. Zde je seznam těch nejlepších stránek, kde si můžete **zdarma a legálně** stáhnout grafiku, zvuky a hudbu do svých her: + +### 🖼️ Grafika a 2D Assety +* [**Kenney.nl**](https://kenney.nl/assets) – Absolutní svatý grál pro začínající vývojáře. Tisíce 2D i 3D modelů, UI prvků a zvuků, které jsou zcela zdarma (tzv. Public Domain - CC0). Nemusíte u nich ani uvádět autora. +* [**Itch.io (Game Assets)**](https://itch.io/game-assets/free) – Velká platforma pro nezávislé vývojáře. Najdete tam obrovské množství asset packů (pixel art, postavy, pozadí). Stačí filtrovat podle "Free". +* [**OpenGameArt.org**](https://opengameart.org/) – Jedna z nejstarších a největších komunitních databází herní grafiky. Pozor, čtěte si licence (často je nutné uvést jméno autora do titulků vaší hry). + +### 🎵 Zvukové efekty a hudba +* [**Freesound.org**](https://freesound.org/) – Obrovská databáze uživateli nahraných zvukových efektů (výbuchy, kroky, skákání, vítr). Pro stahování si musíte vytvořit bezplatný účet. +* [**Incompetech.com**](https://incompetech.com/) – Stránka legendárního skladatele Kevina MacLeoda. Najdete tam stovky skladeb roztříděných podle žánru a nálady. Ideální pro podkresovou hudbu. (Stačí ho uvést v titulcích hry). +* [**Chiptone**](https://sfbgames.itch.io/chiptone) – Online generátor zvuků, kde si můžete sami vygenerovat vtipné 8-bitové zvuky (skok, zranění, sbírání mincí) pouhým klikáním. + +--- + +## 🛠️ Jaký software k vývoji použít? + +I když budete dělat jen jednoduché hry, hodí se vědět, jaké programy vám práci nejvíc usnadní: + +### Psaní kódu (IDE) +* [**Visual Studio Code**](https://code.visualstudio.com/) – Nejpoužívanější editor současnosti. Určitě si do něj stáhněte rozšíření pro Python. +* [**PyCharm Community**](https://www.jetbrains.com/pycharm/) – Skvělé prostředí od JetBrains, perfektní pro odhalování chyb. +* [**Thonny**](https://thonny.org/) – Jednoduchý editor dělaný speciálně pro začátečníky. Pokud se vám VS Code zdá moc složitý, Thonny je jasná volba. + +### Tvorba grafiky (Pixel Art) +* [**Piskel**](https://www.piskelapp.com/) – Jednoduchý editor v prohlížeči, perfektní na tvorbu postaviček a jednoduchých animací zdarma. +* [**Aseprite / LibreSprite**](https://libresprite.github.io/) – Profesionální nástroje na pixel art a animace (LibreSprite je zdarma). +* *Nebo obyčejné Malování! I s tím se dá udělat zábavná a vtipná hra.* + +### Úprava zvuku +* [**Audacity**](https://www.audacityteam.org/) – Klasický, bezplatný program na stříhání zvuků, úpravu hlasitosti a spojování hudby. + +--- + +## 💡 Rady do začátku a jak postupovat + +Pokud nevíte jak začít, zkuste se držet těchto bodů: + +1. **Udržujte to jednoduché (KISS):** Váš první cíl není vytvořit MMORPG s obřím světem. Zkuste vytvořit hru, ve které ovládáte čtvereček, co sbírá jiné čtverečky. Teprve až to bude fungovat, nahraďte čtverečky za grafiku a přidejte zvuky. +2. **Kopírujte a upravujte:** Nejlepší způsob, jak se naučit programovat hry, je vzít fungující kód a zkusit ho "rozbít". Vezměte si naši ukázku Pongu nebo Skákačky, změňte barvy, změňte rychlost, přidejte dalšího nepřítele. Postupně tak pochopíte, co který řádek dělá. +3. **Debugujte pomocí `print()`:** Pokud se vaše postava nehýbe nebo se neděje to, co má, vypisujte si do terminálu její souřadnice nebo stav. Mnohdy vám to okamžitě odhalí chybu. +4. **Rozdělte si práci:** Pokud na začátku narazíte na příliš složitý problém, rozdělte si ho na menší části. Nezkoušejte naprogramovat "bojový systém" jako celek. Nejdřív naprogramujte "stisknutí mezerníku ubere nepříteli 1 HP". +5. **Dělejte si zálohy:** Často ukládejte a pokud něco začne fungovat, udělejte si kopii souboru (nebo použijte Git!), než do toho začnete vrtat dál. + +Hodně štěstí při vývoji! Nezapomeňte, že primárním cílem Game Jamu je se něco nového naučit a pobavit se u toho. \ No newline at end of file diff --git a/ZADANI_GAME_JAM.md b/ZADANI_GAME_JAM.md new file mode 100644 index 0000000..c160d58 --- /dev/null +++ b/ZADANI_GAME_JAM.md @@ -0,0 +1,45 @@ +# 🎮 1. Ročník - Python Game Jam! 🎮 + +Vítejte u vašeho prvního skutečného programátorského hackathonu! Vaším úkolem bude během vymezeného času vymyslet, naprogramovat a odprezentovat vlastní hru v Pythonu. + +Nejde o to udělat další GTA 6. Jde o to zkusit si zrealizovat vlastní nápad, naučit se řešit chyby a hlavně se u toho bavit! + +--- + +## 📜 Pravidla Game Jamu + +1. **Samostatná práce:** Z důvodu spravedlivého hodnocení (známkování) pracuje každý sám za sebe. Na hře pracujete jako jednotlivci (sólo vývojáři). Nemusíte se bát, pokud vaše hra nebude mít dokonalou grafiku, hodnotí se hlavně váš nápad a kód! +2. **Technologie:** Hra musí běžet v **Pythonu**. Můžete použít: + * Čistý Python v terminálu (Textové adventury) + * Knihovnu **Pygame** nebo **Pygame Zero** (Skákačky, střílečky, arkády) + * Engine **Ren'Py** (Vizuální novely a příběhové hry) +3. **Používání umělé inteligence (ChatGPT, Claude, atd.):** + * **JE POVOLENO!** Jsme v moderní době a vývojáři AI běžně používají. + * **POZOR NA JEDNU VĚC:** Během hodnocení může dojít k obhajobě kódu. Pravděpodobně k tomu nedojde, ale pokud bude ve vašem programu nějaká nejasnost nebo podezřele složitý blok kódu, zeptám se vás, jak to funguje. AI používejte jako *pomocníka* a *vysvětlovače*, ne jako někoho, kdo za vás napíše kód, kterému sami nerozumíte. +4. **Vlastní assety:** Obrázky a zvuky si můžete buď nakreslit sami (např. v Malování, Piskel), nebo si je stáhnout z internetu (hrajeme to jen ve škole, takže autorská práva teď tolik neřešíme, ale nesmí to být nic vulgárního). + +--- + +## 🏆 Jak se bude hodnotit? + +Na konci Game Jamu si všechny hry společně zahrajeme a zhodnotíme je podle následujících 3 kritérií: + +1. **Hratelnost a Funkčnost (40 %)** + * Dává hra smysl? + * Dá se to hrát, nebo to po 5 vteřinách spadne a vyhodí chybovou hlášku? (I nejjednodušší funkční Pong je lepší než nádherná 3D hra, která nejde spustit). +2. **Originalita a Zábavnost (30 %)** + * Je to vtipné? Má to zajímavý nápad? + * Použili jste vlastní (třeba i vtipné/ošklivé) obrázky sebe nebo spolužáků místo stažených grafik? Oceňuje se kreativní přístup! +3. **Čistota kódu a porozumění (30 %)** + * Kód by měl být přehledný a měli byste mu rozumět. Ukážete mi, na co jste nejvíce pyšní. + * *Vyhrazuji si právo se vás zeptat na to, co dělá konkrétní část vašeho kódu, pokud v něm objevím nějakou nejasnost. To je prevence proti bezmyšlenkovitému kopírování.* + +--- + +## 💡 Tipy pro přežití + +* **Začněte v malém (KISS - Keep It Simple, Stupid):** Váš první cíl je mít na obrazovce čtverec, se kterým jde hýbat. Až to funguje, udělejte ze čtverce loď. Až to funguje, přidejte střelbu. NIKDY nezačínejte tím, že zkusíte naprogramovat všechno najednou. +* **Koukejte do repozitáře:** Ve složce `pygame` (na gitu) máte hned několik hotových her (Pong, Skákačka, Střílečka). Klidně si jednu vezměte jako základ a předělejte ji k nepoznání! +* **Bavte se:** Kódování her má být zábava. Když se zaseknete, zeptejte se učitele, zeptejte se AI nebo zkuste problém obejít jinak. + +**Hodně štěstí a ať vám kompilátor (a Pygame) slouží!** diff --git a/pure_python/01_obesenec.py b/pure_python/01_obesenec.py new file mode 100644 index 0000000..e64b61e --- /dev/null +++ b/pure_python/01_obesenec.py @@ -0,0 +1,146 @@ +import random +import os + +def vycisti_obrazovku(): + """Vyčistí obrazovku terminálu pro lepší herní zážitek.""" + # Pro Windows použijeme příkaz 'cls', pro systémy typu Linux/Mac 'clear' + os.system('cls' if os.name == 'nt' else 'clear') + +def vykresli_obesence(pocet_chyb): + """Vykreslí aktuální stav šibenice a oběšence podle počtu chyb.""" + # Seznam různých fází obrázku, index odpovídá počtu chyb + faze = [ + """ + ------ + | | + | + | + | + | + ------- + """, + """ + ------ + | | + | O + | + | + | + ------- + """, + """ + ------ + | | + | O + | | + | + | + ------- + """, + """ + ------ + | | + | O + | /| + | + | + ------- + """, + """ + ------ + | | + | O + | /|\\ + | + | + ------- + """, + """ + ------ + | | + | O + | /|\\ + | / + | + ------- + """, + """ + ------ + | | + | O + | /|\\ + | / \\ + | + ------- + """ + ] + print(faze[pocet_chyb]) + +def hraj_obesence(): + """Hlavní smyčka a logika hry Oběšenec.""" + # Seznam slov, ze kterých hra náhodně vybírá. Můžete přidat vlastní! + slova = ["programovani", "python", "skola", "pocitac", "algoritmus", "hra", "promenna"] + + # Výběr náhodného slova a převod na velká písmena pro jednotnost + hledane_slovo = random.choice(slova).upper() + + # 'set' (množina) zabraňuje ukládání duplicitních písmen + uhadnuta_pismena = set() + chybna_pismena = set() + max_chyb = 6 + + vycisti_obrazovku() + print("Vítejte ve hře OBĚŠENEC!") + print("------------------------") + + # Hra běží, dokud hráč neudělá maximum povolených chyb + while len(chybna_pismena) < max_chyb: + vykresli_obesence(len(chybna_pismena)) + + # Zobrazení hledaného slova s podtržítky pro zatím neuhodnutá písmena + zobrazene_slovo = "" + for pismeno in hledane_slovo: + if pismeno in uhadnuta_pismena: + zobrazene_slovo += pismeno + " " + else: + zobrazene_slovo += "_ " + + print(f"Slovo: {zobrazene_slovo}") + print(f"Chybná písmena: {', '.join(chybna_pismena)}") + print(f"Zbývající pokusy: {max_chyb - len(chybna_pismena)}") + + # Kontrola výhry: Všechna písmena z hledaného slova jsou v množině uhodnutých písmen + if set(hledane_slovo).issubset(uhadnuta_pismena): + print("\nGRATULUJEME! Uhodli jste slovo:", hledane_slovo) + return # Ukončení funkce, tím i hry + + # Získání vstupu od hráče (převedeme na velká písmena) + tip = input("\nZadej písmeno: ").upper() + vycisti_obrazovku() + + # Kontrola platnosti vstupu: musí to být přesně jeden znak a musí to být písmeno (ne číslo) + if len(tip) != 1 or not tip.isalpha(): + print("Chyba: Zadej prosím právě jedno písmeno!") + continue # Skočíme zpět na začátek cyklu while + + # Kontrola, zda hráč nehádá písmeno, které už hádal + if tip in uhadnuta_pismena or tip in chybna_pismena: + print(f"Pozor: Písmeno '{tip}' už jsi hádal!") + continue + + # Vyhodnocení tipu + if tip in hledane_slovo: + print(f"Výborně! Písmeno '{tip}' je ve slově.") + uhadnuta_pismena.add(tip) + else: + print(f"Škoda, písmeno '{tip}' ve slově není.") + chybna_pismena.add(tip) + + # Cyklus skončil - hráč udělal 6 chyb. Hráč prohrál. + vykresli_obesence(len(chybna_pismena)) + print("\nPROHRÁL JSI! Hledané slovo bylo:", hledane_slovo) + +if __name__ == "__main__": + # Tato část se spustí jen pokud pustíme přímo tento skript + hraj_obesence() + input("\nStiskni Enter pro ukončení programu...") diff --git a/pure_python/02_textova_hra.py b/pure_python/02_textova_hra.py new file mode 100644 index 0000000..708afcb --- /dev/null +++ b/pure_python/02_textova_hra.py @@ -0,0 +1,135 @@ +import time +import os + +def vycisti_obrazovku(): + """Vyčistí obrazovku terminálu, aby text nebyl nepřehledný.""" + os.system('cls' if os.name == 'nt' else 'clear') + +def vypis_pomalu(text, zpozdeni=0.03): + """ + Vypíše text znak po znaku pro lepší herní (RPG) atmosféru. + Parametr 'zpozdeni' určuje, jak rychle se text vypíše. + """ + for znak in text: + # parametr end='' způsobí, že 'print' automaticky neodřádkuje + # flush=True vynutí okamžité vypsání znaku na obrazovku + print(znak, end='', flush=True) + time.sleep(zpozdeni) + print() # Odřádkování na samotném konci + +# Definice místností (mapa hry) +# Každá místnost je slovník (dictionary) obsahující popis a cesty do dalších místností. +# Umožňuje to jednoduše tvořit i velmi složitou mapu. +mistnosti = { + 'jeskyne': { + 'popis': 'Stojíš v temné vlhké jeskyni. Slyšíš kapání vody a cítíš chlad.', + 'vychody': {'sever': 'chodba'}, # Klíč je směr, hodnota je ID další místnosti + 'predmety': ['klic'] # Seznam předmětů ležících v místnosti + }, + 'chodba': { + 'popis': 'Jsi v dlouhé kamenné chodbě. Na stěnách jsou podivné prastaré malby.', + 'vychody': {'jih': 'jeskyne', 'vychod': 'pokladnice'}, + 'predmety': [] + }, + 'pokladnice': { + 'popis': 'Ocitl ses v obrovské místnosti se zlatými dveřmi na konci a podstavcem uprostřed.', + 'vychody': {'zapad': 'chodba'}, + 'predmety': ['mec'] + } +} + +# Počáteční stav hry (proměnné pro sledování stavu hráče) +aktualni_mistnost = 'jeskyne' +inventar = [] # Prázdný seznam pro předměty + +def hraj_hru(): + """Hlavní smyčka hry, která zpracovává příkazy od hráče.""" + global aktualni_mistnost # Potřebujeme měnit globální proměnnou + + vycisti_obrazovku() + vypis_pomalu("Vítej v textovém dobrodružství!") + vypis_pomalu("K dispozici máš příkazy: 'jdi [smer]', 'vezmi [predmet]', 'inventar', 'pomoc', 'konec'") + print("-" * 50) + time.sleep(1) + + # Hlavní herní smyčka (běží do nekonečna, dokud ji neukončíme) + while True: + # Získání dat o aktuální lokaci + mistnost_data = mistnosti[aktualni_mistnost] + print("\n" + "=" * 50) + vypis_pomalu(mistnost_data['popis']) + + # Zobrazení dostupných východů + vychody = list(mistnost_data['vychody'].keys()) + print(f"Vidíš cesty na: {', '.join(vychody)}") + + # Zobrazení předmětů v místnosti + if mistnost_data['predmety']: + print(f"Na zemi leží: {', '.join(mistnost_data['predmety'])}") + + # Neustálý výpis inventáře, pokud v něm něco je + if inventar: + print(f"[ Tvůj inventář: {', '.join(inventar)} ]") + + # Vstup od hráče, vše převedeme na malá písmena a rozdělíme podle mezer do seznamu + prikaz = input("\nCo chceš udělat? > ").lower().strip().split() + + if not prikaz: + continue # Hráč nic nezadal a zmáčkl Enter + + akce = prikaz[0] # První slovo je samotná akce + + # ========================================== + # Zpracování jednotlivých příkazů + # ========================================== + if akce == 'konec': + print("Díky za hru!") + break # Přeruší smyčku while a ukončí hru + + elif akce == 'pomoc': + print("\n--- NÁPOVĚDA ---") + print("Můžeš psát následující příkazy:") + print(" jdi [sever/jih/zapad/vychod] - přesun do jiné místnosti") + print(" vezmi [predmet] - sebereš předmět ze země") + print(" inventar - vypíše, co máš u sebe") + print(" konec - ukončí hru") + print("----------------\n") + + elif akce == 'inventar': + # Kontrola, zda seznam inventar není prázdný + if inventar: + print(f"Máš u sebe: {', '.join(inventar)}") + else: + print("Tvůj inventář je prázdný.") + + elif akce == 'jdi': + if len(prikaz) < 2: + print("Chyba: Musíš zadat směr (např. 'jdi sever').") + continue + + smer = prikaz[1] # Druhé slovo je směr + if smer in mistnost_data['vychody']: + aktualni_mistnost = mistnost_data['vychody'][smer] + vycisti_obrazovku() + vypis_pomalu(f"Jdeš na {smer}...") + else: + print("Tímto směrem nemůžeš jít!") + + elif akce == 'vezmi': + if len(prikaz) < 2: + print("Chyba: Musíš zadat, co chceš vzít (např. 'vezmi klic').") + continue + + predmet = prikaz[1] + if predmet in mistnost_data['predmety']: + mistnost_data['predmety'].remove(predmet) # Odebere ze země + inventar.append(predmet) # Přidá hráči + print(f"Vzal jsi předmět: {predmet}.") + else: + print(f"Předmět '{predmet}' tady nikde nevidíš.") + + else: + print("Neznámý příkaz. Zkus např. 'jdi sever', 'vezmi klic', 'pomoc' nebo 'konec'.") + +if __name__ == "__main__": + hraj_hru() diff --git a/pure_python/README.md b/pure_python/README.md new file mode 100644 index 0000000..69c845d --- /dev/null +++ b/pure_python/README.md @@ -0,0 +1,78 @@ +# Pure Python Hry v Terminálu 🐍🎮 + +Tato složka obsahuje ukázky jednoduchých her, které běží přímo v příkazovém řádku (terminálu) a k jejichž vytvoření není potřeba žádná externí knihovna typu Pygame. Jsou ideální pro seznámení se se základy programovací logiky (cykly, podmínky, slovníky, seznamy). + +## Užitečné tipy a triky pro terminálové hry + +Zde je několik zajímavých technik, které můžete ve svých hrách využít: + +### 1. Čištění obrazovky +Pro iluzi animace nebo zobrazení nové "scény" je užitečné vymazat obsah terminálu, aby se starý text nehromadil nahoře. + +```python +import os + +def vycisti_obrazovku(): + # 'cls' funguje na Windows, 'clear' na Linux/Mac + os.system('cls' if os.name == 'nt' else 'clear') + +# Příklad použití: +print("Stará scéna") +vycisti_obrazovku() +print("Nová scéna (to předchozí zmizelo)") +``` + +### 2. Pomalé vypisování textu (RPG efekt) +V adventurách vypadá skvěle, když se text nevypíše najednou v jedné milisekundě, ale znak po znaku (jako na psacím stroji). Hra má hned lepší atmosféru. + +```python +import time +import sys + +def vypis_pomalu(text, zpozdeni=0.05): + for znak in text: + print(znak, end='', flush=True) # flush=True je nutné, aby se znak ihned zobrazil + time.sleep(zpozdeni) # Uspí program na zadaný počet sekund + print() # Na konci odřádkujeme pro další text + +vypis_pomalu("Probouzíš se v temném lese a nic si nepamatuješ...") +``` + +### 3. Barevný text v terminálu (ANSI escape kódy) +Do terminálu můžete psát barevně pomocí speciálních znakových sekvencí. +*(Poznámka: Ve starších Windows cmd to nemusí fungovat bez zapnutí podpory, ale v moderních terminálech to funguje spolehlivě.)* + +```python +# Definice barev pomocí ANSI kódů +CERVENA = '\033[91m' +ZELENA = '\033[92m' +ZLUTA = '\033[93m' +MODRA = '\033[94m' +RESET = '\033[0m' # Resetuje barvu zpět na normální (VELMI DŮLEŽITÉ) + +print(f"Tohle je normální text.") +print(f"{CERVENA}Pozor, nepřítel útočí!{RESET}") +print(f"{ZELENA}Úspěšně jsi otevřel truhlu a našel jsi {ZLUTA}zlato{ZELENA}.{RESET}") +``` + +### 4. Náhodnost +Bez náhody by hry byly předvídatelné a nudné. Modul `random` je váš nejlepší přítel! + +```python +import random + +# Hod kostkou (náhodné celé číslo od 1 do 6) +kostka = random.randint(1, 6) +print(f"Hodil jsi: {kostka}") + +# Náhodný výběr položky ze seznamu +nepratele = ["Skřet", "Kostlivec", "Drak", "Sliz"] +nahodny_nepritel = random.choice(nepratele) +print(f"Objevil se divoký {nahodny_nepritel}!") +``` + +### 5. Slovníky pro tvorbu herního světa (Mapy) +Jak je ukázáno ve skriptu `02_textova_hra.py`, nejlepší způsob jak uchovávat data o místnostech a předmětech v nich, je použití struktury dat zvané `dictionary` (slovník). +Můžete tak jednoduše propojovat místnosti pomocí směrů a ukládat do nich seznamy věcí. + +Nebojte se experimentovat a zkusit si ukázkový kód upravit! Co takhle přidat do textové hry zdraví postavy, bojový systém, nebo zamčené dveře, které vyžadují klíč z jiné místnosti? diff --git a/pygame/01_pexeso.py b/pygame/01_pexeso.py new file mode 100644 index 0000000..43c551f --- /dev/null +++ b/pygame/01_pexeso.py @@ -0,0 +1,216 @@ +import pygame +import random +import sys + +# pygame.init() nastartuje všechny vnitřní moduly Pygame. +# Je to naprosto povinný první krok před tím, než můžeme v Pygame cokoliv udělat. +pygame.init() + +# --- Konstanty okna a rozvržení mřížky --- +# Konstanty (velkými písmeny) se během hry nemění. Určují základní vlastnosti naší hry. +SIRKA_OKNA = 600 +VYSKA_OKNA = 600 +FPS = 30 # Počet snímků za sekundu (jak rychle se hra překresluje). 30 bohatě stačí pro Pexeso. + +# Kolik karet chceme mít na šířku a na výšku? +RADKY = 4 +SLOUPCE = 4 +# Velikost jedné karty v pixelech (obrazových bodech) +KARTICKA_VELIKOST = 100 +# Mezera mezi kartičkami +MEZERA = 20 + +# Výpočet celkové šířky a výšky celé mřížky karet, abychom ji pak mohli na obrazovce vycentrovat +Mrizka_sirka = (SLOUPCE * KARTICKA_VELIKOST) + ((SLOUPCE - 1) * MEZERA) +Mrizka_vyska = (RADKY * KARTICKA_VELIKOST) + ((RADKY - 1) * MEZERA) + +# Vypočítáme, kde mřížka začíná na osách X (vodorovně) a Y (svisle), aby byla přesně uprostřed okna +Odsazeni_x = (SIRKA_OKNA - Mrizka_sirka) // 2 +Odsazeni_y = (VYSKA_OKNA - Mrizka_vyska) // 2 + +# Barvy v Pygame se zadávají ve formátu (R, G, B) = Red, Green, Blue. +# Každá hodnota je od 0 (nic) do 255 (maximum dané barvy). +BILA = (255, 255, 255) +SEDA = (150, 150, 150) +TMAVE_MODRA = (20, 20, 80) +ZELENA_TEXT = (50, 255, 50) + +# Budeme mít celkem 16 karet (4x4), což znamená 8 různých párů (8 unikátních barev). +BARVY_PARU = [ + (255, 0, 0), # Červená + (0, 255, 0), # Světle Zelená + (0, 0, 255), # Modrá + (255, 255, 0), # Žlutá + (255, 0, 255), # Fialová + (0, 255, 255), # Azurová + (255, 165, 0), # Oranžová + (139, 69, 19) # Hnědá +] + +# Vytvoříme samotné okno (obrazovku), kam se bude vše vykreslovat +okno = pygame.display.set_mode((SIRKA_OKNA, VYSKA_OKNA)) +# Nastavíme text, který uvidíme nahoře v liště okna +pygame.display.set_caption("Pexeso (Hledání barevných párů)") + +# Založíme si herní "hodiny" - pomohou nám udržovat hru v rychlosti stanovené přes FPS +hodiny = pygame.time.Clock() + +# Fonty slouží pro vykreslování textu. Načteme si dva různé. +font = pygame.font.SysFont("arial", 40, bold=True) +font_maly = pygame.font.SysFont("arial", 20) + +# --- Třída objektu - objektově orientované programování (OOP) --- +# Třída je jako "plánek" na vytvoření konkrétních věcí. Zde je to plánek na vytvoření "Kartičky". +# Každá kartička si bude sama pamatovat, jakou má barvu a jestli je už otočená. +class Karticka: + def __init__(self, radek, sloupec, barva_vnitrku): + self.barva = barva_vnitrku # Tato barva bude vidět, když se karta otočí + + # Stavové proměnné (True = ano, False = ne) + self.odkryta = False # Zda ji hráč v tomto tahu právě teď otočil + self.nalezena = False # Zda už hráč našel její pár a karta je tak z kola venku + + # Matematika! Vypočítáme přesnou pozici X a Y (v pixelech), kam se tato karta nakreslí. + self.x = Odsazeni_x + sloupec * (KARTICKA_VELIKOST + MEZERA) + self.y = Odsazeni_y + radek * (KARTICKA_VELIKOST + MEZERA) + + # pygame.Rect vytvoří "neviditelný obdélník" kolem naší kartičky. + # Díky němu se mnohem snadněji zjišťuje, jestli na kartičku hráč kliknul myší. + self.rect = pygame.Rect(self.x, self.y, KARTICKA_VELIKOST, KARTICKA_VELIKOST) + + def vykresli(self): + # Funkce (metoda), která zajistí, že se karta správně namaluje na obrazovku + + if self.odkryta or self.nalezena: + # Pokud je karta odkrytá (otočená), namalujeme její tajnou barvu + pygame.draw.rect(okno, self.barva, self.rect) + else: + # Pokud karta leží rubem nahoru, namalujeme ji šedou (nebo jakýkoliv jiný vzor chceme) + pygame.draw.rect(okno, SEDA, self.rect) + + # Kromě výplně nakreslíme ještě bílý obrys (rámeček) o tloušťce 3 pixely, ať to lépe vypadá + pygame.draw.rect(okno, BILA, self.rect, 3) + +def hlavni_smycka(): + # --- PŘÍPRAVA HRY --- + # 1. Připravíme si seznam barev. Chceme 8 párů, takže každou barvu z BARVY_PARU potřebujeme dvakrát. + barvy_do_hry = BARVY_PARU * 2 + # Modul random má funkci shuffle, která pořadí položek v seznamu krásně zamíchá. + random.shuffle(barvy_do_hry) + + # 2. Vytvoření "mřížky" kartiček (2D pole, tedy seznam v seznamu) + karticky = [] + index_barvy = 0 # Slouží k tomu, abychom z listu barvy_do_hry postupně brali barvy + + for radek in range(RADKY): + rada = [] # Vytvoříme prázdný seznam pro jeden konkrétní řádek + for sloupec in range(SLOUPCE): + # Pro každé políčko vytvoříme nový objekt podle našeho "plánku" Karticka + karta = Karticka(radek, sloupec, barvy_do_hry[index_barvy]) + rada.append(karta) # Kartu přidáme do řádku + index_barvy += 1 + karticky.append(rada) # Celý naplněný řádek přidáme do hlavní mřížky + + # Proměnné pro systém hry - pamatujeme si, co hráč naklikal v aktuálním tahu + prvni_vybrana = None + druha_vybrana = None + + pocet_pokusu = 0 + nalezeno_paru = 0 + + # --- HLAVNÍ HERNÍ SMYČKA --- + # Tento cyklus 'while True' běží pořád dokola, stokrát za sekundu a tvoří samotnou hru + while True: + + # 1. ZPRACOVÁNÍ UDÁLOSTÍ (Event handling) + # Události jsou vstupy od hráče: stisknutí klávesy, kliknutí myší, zavření okna křížkem... + for udalost in pygame.event.get(): + # Pokud hráč klikl na červený křížek okna, ukončíme Pygame a celou aplikaci + if udalost.type == pygame.QUIT: + pygame.quit() + sys.exit() + + # Kontrola kliknutí myší (MOUSEBUTTONDOWN = tlačítko zmáčknuto dolů, button 1 = levé tlačítko) + if udalost.type == pygame.MOUSEBUTTONDOWN and udalost.button == 1: + + # Pokud už hráč v tomto tahu otočil dvě karty a čekáme, zabráníme mu klikat dál! + if prvni_vybrana is not None and druha_vybrana is not None: + continue # "continue" přeskočí zbytek kódu v této smyčce a nedovolí mu kartu otočit + + # Kde přesně se myš nachází? Souřadnice X,Y na obrazovce. + mys_x, mys_y = pygame.mouse.get_pos() + + # Projdeme všechny naše karty jednu po druhé a zkontrolujeme, zda hráč neklikl na některou z nich + for radek in range(RADKY): + for sloupec in range(SLOUPCE): + karta = karticky[radek][sloupec] + + # Metoda collidepoint zjistí, zda se bod (myš) nachází uvnitř obdélníku (karty) + if karta.rect.collidepoint(mys_x, mys_y): + # Otočit můžeme jen kartu, která ještě NENÍ otočená + if not karta.odkryta and not karta.nalezena: + karta.odkryta = True # Hráč ji otočil! + + # Systém logiky: Byla tohle první karta v tahu? + if prvni_vybrana is None: + prvni_vybrana = karta + else: + # Nebyla, takže to už musí být druhá karta v tahu. + druha_vybrana = karta + pocet_pokusu += 1 # Tah končí, započítáme pokus + + # 2. VYKRESLOVÁNÍ (Kreslíme nový "snímek" - frame) + # Nejdřív vždy smažeme starý obraz tím, že celé okno přebarvíme jednolitou barvou + okno.fill(TMAVE_MODRA) + + # Projdeme mřížku a řekneme každé kartičce, aby se nakreslila na okno + for radek in range(RADKY): + for sloupec in range(SLOUPCE): + karticky[radek][sloupec].vykresli() + + # Vykreslíme text s počtem pokusů. Funkce render vytvoří z textu "obrázek", který pak můžeme vykreslit + text_tahy = font_maly.render(f"Počet pokusů: {pocet_pokusu}", True, BILA) + # blit je příkaz pro "nalep tento obrázek na dané souřadnice" + okno.blit(text_tahy, (10, 10)) + + # Zkontrolujeme vítězství + if nalezeno_paru == 8: # Maximum možných párů je 8 + text_konec = font.render("Vítězství! Skvělá paměť.", True, ZELENA_TEXT) + # Center zarovná text hezky doprostřed požadované X pozice + rect = text_konec.get_rect(center=(SIRKA_OKNA // 2, VYSKA_OKNA - 30)) + okno.blit(text_konec, rect) + + # ZÁSADNÍ VĚC: Po tom co jsme do paměti Pygame naskládali příkazy kreslení, + # musíme to všechno najednou zviditelnit na obrazovce pomocí příkazu flip() nebo update()! + # Děláme to už teď, abychom (pokud budeme dole hru pauzovat), viděli otočenou druhou kartu. + pygame.display.flip() + + # 3. HERNÍ LOGIKA: Vyhodnocení tahu + # Pokud už hráč vybral dvě karty, musíme zjistit, jestli udělal pár + if prvni_vybrana is not None and druha_vybrana is not None: + if prvni_vybrana.barva == druha_vybrana.barva: + # SUPER! Barvy se shodují, je to PÁR! + prvni_vybrana.nalezena = True + druha_vybrana.nalezena = True + nalezeno_paru += 1 + else: + # ŠPATNĚ! Barvy se liší. + # Aby hráč vůbec stihl zaregistrovat barvu druhé karty, musíme na chvíli zmrazit hru + # wait(1000) hru zastaví přesně na 1000 milisekund (1 sekundu) + pygame.time.wait(1000) + + # A pak obě karty otočíme zase lícem dolů (šedá strana nahoru) + prvni_vybrana.odkryta = False + druha_vybrana.odkryta = False + + # Tah je u konce, ať už to byl pár nebo ne. Vyčistíme výběr pro další tah! + prvni_vybrana = None + druha_vybrana = None + + # Rychlost smyčky: Řekneme hodinám, že chceme, aby smyčka běžela maximálně tolikrát za vteřinu, jak určuje FPS + hodiny.tick(FPS) + +# Tohle říká Pythonu: Pokud tento soubor spouštíš jako hlavní program (ne jen importuješ), +# tak teprve tehdy spusť hlani_smycka() +if __name__ == "__main__": + hlavni_smycka() diff --git a/pygame/02_flappy_bird.py b/pygame/02_flappy_bird.py new file mode 100644 index 0000000..5f905f7 --- /dev/null +++ b/pygame/02_flappy_bird.py @@ -0,0 +1,194 @@ +import pygame +import random +import sys + +# pygame.init() připraví knihovnu Pygame k použití. Volat to musíme vždy jako první věc! +pygame.init() + +# --- Nastavení okna a základních konstant --- +# Konstanty nepíšeme malými písmeny, ale VELKÝMI, abychom zdůraznili, že se jejich hodnota za běhu nemění. +SIRKA_OKNA = 400 +VYSKA_OKNA = 600 +FPS = 60 # FPS (Frames Per Second) = kolikrát se celá obrazovka překreslí za vteřinu. 60 je hezky plynulé. + +# Barvy zapisujeme jako mix tří kanálů: (Červená, Zelená, Modrá) - každý má hodnotu 0 až 255. +# (0,0,0) je černá (žádná barva), (255,255,255) je bílá (plné všechny barvy). +CERNA = (0, 0, 0) +BILA = (255, 255, 255) +MODRA_OBLOHA = (135, 206, 235) +ZELENA = (34, 139, 34) +ZLUTYP_PTAK = (255, 215, 0) +CERVENA = (255, 0, 0) + +# Vytvoření okna (plocha, kam se bude vše vykreslovat) +okno = pygame.display.set_mode((SIRKA_OKNA, VYSKA_OKNA)) +pygame.display.set_caption("Flappy Bird") # Nápis v horní liště programu + +# Herní hodiny pro řízení rychlosti smyčky +hodiny = pygame.time.Clock() + +# Tvorba písem. font_velky použijeme na herní nápisy (Konec hry apod.), font_maly na menší text. +font_velky = pygame.font.SysFont("arial", 48, bold=True) +font_maly = pygame.font.SysFont("arial", 24) + +# Pomocná funkce pro snazší kreslení textu. Abychom nemuseli pokaždé opakovat stejné složité příkazy. +def zobraz_text(text, font, barva, x, y, zarovnat_stred=False): + # render() převede text ze znaků do obrázku (tzv. "Surface"), který lze následně nakreslit. + plocha = font.render(text, True, barva) + if zarovnat_stred: + # Vypočítáme obdélník (rect) obrázku textu a řekneme, ať je jeho STŘED (center) na dané X a Y pozici + rect = plocha.get_rect(center=(x, y)) + okno.blit(plocha, rect) # blit() nalepí obrázek plochy na 'okno' + else: + # Jinak ho plácneme normálně za jeho levý horní roh + okno.blit(plocha, (x, y)) + +def hlavni_smycka(): + # --- PROMĚNNÉ PTÁKA --- + # Toto jsou proměnné, které se v čase mění, proto nejsou VELKÝMI PÍSMENY + ptak_x = 50 # Zleva je pták relativně blízko okraji + ptak_y = VYSKA_OKNA // 2 # Vertikálně (Y) ho položíme doprostřed okna + ptak_sirka = 30 + ptak_vyska = 30 + + # Fyzika + rychlost_padu = 0 # Zpočátku stojí pták na místě + gravitace = 0.5 # Gravitace každým snímkem tuto 'rychlost_padu' zvyšuje směrem DOLŮ (kladné hodnoty Y) + sila_skoku = -8 # Skok je prostě náhlé nastavení rychlosti do záporných hodnot, tedy NAHORU! + + # --- PROMĚNNÉ PŘEKÁŽEK (ZELENÉ TRUBKY) --- + trubka_sirka = 60 + mezera_mezi_trubkami = 160 # Jak velikou skulinou bude hráč létat? (v pixelech) + rychlost_posunu = 3 # Překážky neustále jedou směrem doleva, aby to vypadalo, že pták letí dopředu + + # Seznam do kterého budeme ukládat trubky. Použijeme slovníky {ključ: hodnota}. + # Např: {"x": 400, "y_stred": 300} ... 'y_stred' určuje, kde přesně je střed oné mezery kudy se letí + trubky = [] + + # Funkce k přidání nové trubky na určené X ose + def pridej_trubku(x_pozice): + # Nechceme mezeru úplně na kraji (nemožné projet), omezíme ji od 150px nahoře po 150px dole + stred_mezery = random.randint(150, VYSKA_OKNA - 150) + trubky.append({"x": x_pozice, "y_stred": stred_mezery}) + + # Přidáme první dvě trubky už před startem hry, nacházejí se zprvu mimo okno vpravo. + pridej_trubku(SIRKA_OKNA + 100) + pridej_trubku(SIRKA_OKNA + 400) # Další trubka má odstup 300 pixelů + + skore = 0 + + # STAVOVÝ AUTOMAT - skvělý trik v programování. Znalost toho "ve kterém jsme stavu" + # nám pomáhá měnit logiku. Hra se chová úplně jinak, když jsme v MENU než když právě HRAJEME. + stav_hry = "START" # Možnosti: "START", "HRA", "KONEC" + + # --- HERNÍ SMYČKA --- + while True: + + # 1. ČTENÍ VSTUPŮ (UDÁLOSTI) + for udalost in pygame.event.get(): + if udalost.type == pygame.QUIT: + pygame.quit() # Korektně ukončí knihovnu Pygame + sys.exit() # Ukončí celý Python skript + + # Pokud někdo zmáčkl klávesu na klávesnici (KEYDOWN) + if udalost.type == pygame.KEYDOWN: + if udalost.key == pygame.K_SPACE: # Speciálně zkoumáme MEZERNÍK + # Co dělá mezerník záleží na tom, v jakém STAVU je hra: + if stav_hry == "START": + stav_hry = "HRA" # Přepneme hru na aktivní + rychlost_padu = sila_skoku # Hned v první sekundě mu dáme skokový impuls + elif stav_hry == "HRA": + rychlost_padu = sila_skoku # Hráč skočil! (Pták vzletí nahoru) + elif stav_hry == "KONEC": + return # Vyskočíme z této funkce, což vyústí ve spuštění znova (viz úplně dole v kódu) + + # 2. LOGIKA A POHYB + # Zpracovává se jen pokud jsme ve stavu HRA + if stav_hry == "HRA": + + # Aplikace gravitace: Rychlost pádu je stále vyšší kladné číslo + rychlost_padu += gravitace + # Přičtením této rychlosti k souřadnici Y pták pomalu (a čím dál rychleji) "padá" na zem okna + ptak_y += rychlost_padu + + # Pohyb trubek doleva (zmenšujeme jejich osu X) + for t in trubky: + t["x"] -= rychlost_posunu + + # Kontrola první trubky v seznamu: Nevyjela nám náhodou úplně ven z okna doleva? + if trubky[0]["x"] < -trubka_sirka: + trubky.pop(0) # Odstraníme první trubku ze seznamu, už ji nikdy neuvidíme + + # Zjistíme, kde byla zhruba naposled vygenerovaná trubka, a přidáme novou ZA ni + posledni_trubka_x = trubky[-1]["x"] + pridej_trubku(posledni_trubka_x + 300) + + # Pokud trubka odjede ven, znamená to, že ji hráč musel úspěšně přeletět! + skore += 1 + + # --- Detekce nárazů (KOLIZE) --- + # Pro kontrolu jestli pták do něčeho vrazil používáme pygame.Rect (neviditelné hranice objektů) + ptak_rect = pygame.Rect(ptak_x, ptak_y, ptak_sirka, ptak_vyska) + + # 1) Náraz do stropu nebo do podlahy okna + if ptak_y < 0 or ptak_y + ptak_vyska > VYSKA_OKNA: + stav_hry = "KONEC" # Bum! Umřel. + + # 2) Náraz do jakékoliv překážky + for t in trubky: + # Vypočteme, kde končí 'horní' překážka + horni_vyska = t["y_stred"] - (mezera_mezi_trubkami // 2) + horni_rect = pygame.Rect(t["x"], 0, trubka_sirka, horni_vyska) + + # Vypočteme, kde začíná 'spodní' překážka (od středu + polovina mezery) + dolni_y = t["y_stred"] + (mezera_mezi_trubkami // 2) + # Výška spodní části je VYSKA_OKNA mínus počáteční Y souřadnice spodní trubky + dolni_rect = pygame.Rect(t["x"], dolni_y, trubka_sirka, VYSKA_OKNA - dolni_y) + + # Pokud se "obdélník ptáka" dotýká / prolíná (colliderect) s horní nebo dolní trubkou + if ptak_rect.colliderect(horni_rect) or ptak_rect.colliderect(dolni_rect): + stav_hry = "KONEC" + + # 3. KRESLENÍ (na 'platno') + # Smažeme stopu ze starého snímku překrytím čistou oblohou + okno.fill(MODRA_OBLOHA) + + # Nakreslení obou překážek + for t in trubky: + # Horní trubka vykreslena od Y=0 (strop) + horni_vyska = t["y_stred"] - (mezera_mezi_trubkami // 2) + pygame.draw.rect(okno, ZELENA, (t["x"], 0, trubka_sirka, horni_vyska)) + + # Dolní trubka vykreslena od konce mezery (dolni_y) až dolu k podlaze + dolni_y = t["y_stred"] + (mezera_mezi_trubkami // 2) + pygame.draw.rect(okno, ZELENA, (t["x"], dolni_y, trubka_sirka, VYSKA_OKNA - dolni_y)) + + # Nakreslení postavy (Ptáka) + # int() ořezává desetinná čísla z fyziky do celých čísel pixelů, aby to šlo nakreslit + pygame.draw.rect(okno, ZLUTYP_PTAK, (ptak_x, int(ptak_y), ptak_sirka, ptak_vyska)) + + # --- ZOBRAZOVÁNÍ NÁPISŮ (UI) --- + if stav_hry == "START": + zobraz_text("Stiskni MEZERNÍK", font_maly, BILA, SIRKA_OKNA//2, VYSKA_OKNA//2 - 50, zarovnat_stred=True) + zobraz_text("pro začátek létání", font_maly, BILA, SIRKA_OKNA//2, VYSKA_OKNA//2, zarovnat_stred=True) + elif stav_hry == "HRA": + # Skóre nahoře + zobraz_text(str(skore), font_velky, BILA, SIRKA_OKNA//2, 50, zarovnat_stred=True) + elif stav_hry == "KONEC": + # GAME OVER statistiky po smrti + zobraz_text("GAME OVER", font_velky, CERVENA, SIRKA_OKNA//2, VYSKA_OKNA//2 - 50, zarovnat_stred=True) + zobraz_text(f"Skóre: {skore}", font_maly, BILA, SIRKA_OKNA//2, VYSKA_OKNA//2 + 10, zarovnat_stred=True) + zobraz_text("Stiskni MEZERNÍK pro restart", font_maly, CERNA, SIRKA_OKNA//2, VYSKA_OKNA//2 + 50, zarovnat_stred=True) + + # "Otoč" buffer z paměti na reálný monitor - tady se stane kouzlo a vše se zobrazí! + pygame.display.flip() + + # Pojistka pro správnou rychlost. Počká se milisekundu tak, abychom dodrželi stanovené FPS. + hodiny.tick(FPS) + +# Toto funguje tak, že hru spouštíme donekonečna. Když hráč zemře a dá mezerník, +# funkce 'hlavni_smycka()' skončí (return), ale díky tomuto cyklu 'while True' +# se obratem zavolá od znova z čistého stolu a se skórem nula. +if __name__ == "__main__": + while True: + hlavni_smycka() diff --git a/pygame/03_chytani_jablek.py b/pygame/03_chytani_jablek.py new file mode 100644 index 0000000..ce2d52b --- /dev/null +++ b/pygame/03_chytani_jablek.py @@ -0,0 +1,140 @@ +import pygame +import sys +import random + +# Inicializace knihovny Pygame - povinný krok. Nastaví všechny podmoduly zvuků, kreslení atd. +pygame.init() + +# --- Nastavení herního okna --- +SIRKA = 800 +VYSKA = 600 +# Vytvoření hlavního okna hry o dané velikosti v pixelech (obrazových bodech) +okno = pygame.display.set_mode((SIRKA, VYSKA)) +# Přidáme název hry do horní lišty softwarového okna +pygame.display.set_caption("Chytání jablek") + +# --- Paleta barev --- +# Barvy zadáváme přes číselné hodnoty Červené, Zelené a Modré - RGB (Red, Green, Blue) +CERNA = (0, 0, 0) # Černá je absence všech barev +ZELENA = (0, 255, 0) # Barva hráče (košíku) +CERVENA = (255, 0, 0) # Barva padajícího jablka +BILA = (255, 255, 255) # Použijeme pro texty + +# Vytvoření objektu 'Clock', který řídí rychlost, aby hra nejela super rychle na výkonných PC +hodiny = pygame.time.Clock() + +# Tvorba "fontu" neboli stylu písma pro vypisování skóre atd. +font = pygame.font.SysFont("Arial", 36) + +# --- Proměnné Hráče (Zelený Košík dole) --- +hrac_sirka = 100 +hrac_vyska = 20 +# Kde bude stát na začátku? X=vodorovně (uprostřed mínus půlka hráče), Y=svisle (úplně dole) +hrac_x = SIRKA // 2 - hrac_sirka // 2 +hrac_y = VYSKA - 40 +# Rychlost hráče říká, o kolik pixelů se posune, když drží šipku +rychlost_hrace = 8 + +# --- Proměnné Jablka (Červený čtvereček shora) --- +jablko_velikost = 30 +# Vybereme mu náhodnou souřadnici X kdekoliv od okraje do okraje +jablko_x = random.randint(0, SIRKA - jablko_velikost) +# Y mu dáme do ZÁPORNÝCH HODNOT! To znamená, že začíná nahoře schovaný mimo obrazovku! +jablko_y = -jablko_velikost +rychlost_jablka = 5 # Jak rychle jablko letí dolů? + +# Herní statistiky +skore = 0 +zivoty = 3 + +# Pravdivostní proměnná (boolean) udávající, že aplikace běží. +bezime = True + +# ========================================== +# HLAVNÍ HERNÍ SMYČKA (GAME LOOP) +# Vše, co se děje ve hře se opakuje zde, zhruba 60x za vteřinu +# ========================================== +while bezime: + + # 1. ČTENÍ UDÁLOSTÍ + # Kontrolujeme, co uživatel dělá - například zda nechce program zavřít + for udalost in pygame.event.get(): + if udalost.type == pygame.QUIT: + bezime = False # Když klikne na křížek, ukončíme smyčku tím, že z 'bezime' uděláme False + + # Hra se fyzicky hraje jenom dokud máme nějaké životy + if zivoty > 0: + + # 2. LOGIKA HRÁČE: Čteme stisknutí kláves v reálném čase + # pygame.key.get_pressed() vrací obrovský seznam s hodnotami True nebo False u VŠECH tlačítek na klávesnici + klavesy = pygame.key.get_pressed() + + # Pokud drží levou šipku a navíc ještě nenarazil do levé zdi (x > 0) + if klavesy[pygame.K_LEFT] and hrac_x > 0: + hrac_x -= rychlost_hrace # Posuneme ho doleva (odečteme x) + + # Pokud drží pravou šipku a nenarazil do pravé zdi (Zde musíme odečíst šířku postavy, abychom měřili od kraje) + if klavesy[pygame.K_RIGHT] and hrac_x < SIRKA - hrac_sirka: + hrac_x += rychlost_hrace # Posuneme ho doprava (přičteme x) + + # 3. LOGIKA PADÁNÍ JABLKA + # Osa Y jde v počítačové grafice "shora dolů", takže se zvyšující se Y jablko padá níže + jablko_y += rychlost_jablka + + # --- KOLIZE (Dotyk hráče s jablkem) --- + # Abychom snadno zjistili, jestli se dotýkají, "obalíme" je virtuálními obdélníky (Rect) + hrac_rect = pygame.Rect(hrac_x, hrac_y, hrac_sirka, hrac_vyska) + jablko_rect = pygame.Rect(jablko_x, jablko_y, jablko_velikost, jablko_velikost) + + # Pokud se tyto dva obdélníky protnou/srazí... Hráč ho chytil! + if hrac_rect.colliderect(jablko_rect): + skore += 1 # Dáme mu bod + rychlost_jablka += 0.2 # Mírně hru zrychlíme, ať je to těžší! + + # Vygenerujeme znovu to stejné jablko úplně nahoře na nové X pozici + jablko_y = -jablko_velikost + jablko_x = random.randint(0, SIRKA - jablko_velikost) + + # 4. LOGIKA PŘEHLÉDNUTÍ JABLKA + # Co se stane, když jablko propadne až za spodní hranu obrazovky? + elif jablko_y > VYSKA: + zivoty -= 1 # Hráč přišel o život + + # Musíme jablko i přesto respawnovat zpět nahoru, aby hra mohla pokračovat + jablko_y = -jablko_velikost + jablko_x = random.randint(0, SIRKA - jablko_velikost) + + # 5. KRESLENÍ VŠEHO NA OBRAZOVKU + # Každý snímek musíme celé okno zalít černou barvou, jinak by postavička dělala šmouhy, jak se hýbe + okno.fill(CERNA) + + # Kreslíme jenom to, co je zrovna relevantní + if zivoty > 0: + # Vykreslení obdélníku hráče + pygame.draw.rect(okno, ZELENA, (hrac_x, hrac_y, hrac_sirka, hrac_vyska)) + # Vykreslení obdélníku jablka + pygame.draw.rect(okno, CERVENA, (jablko_x, jablko_y, jablko_velikost, jablko_velikost)) + + # Převedeme textovou proměnnou (string) do obrázku (surface) + text_skore = font.render(f"Skóre: {skore}", True, BILA) + text_zivoty = font.render(f"Životy: {zivoty}", True, BILA) + + # 'Nalepíme' (blit) tyto obrázky textů na plátno (obrazovku) + okno.blit(text_skore, (10, 10)) + okno.blit(text_zivoty, (SIRKA - 150, 10)) + + else: + # Hráč nemá životy, je KONEC HRY! Kreslíme varovný text doprostřed. + text_konec = font.render(f"KONEC HRY! Tvé skóre: {skore}", True, CERVENA) + okno.blit(text_konec, (SIRKA//2 - 180, VYSKA//2)) + + # --- FINALIZACE SNÍMKU --- + # Toto pošle všechny ty připravené obdélníčky a texty z paměti počítače rovnou do monitoru! + pygame.display.flip() + + # A tohle vynutí pauzu natolik dlouhou, abychom za vteřinu nepřekročili 60 smyček (60 FPS) + hodiny.tick(60) + +# Pokud 'bezime' skočí na False a vyskočíme ze smyčky 'while', musíme bezpečně zhasnout! +pygame.quit() +sys.exit() diff --git a/pygame/04_pong_dva_hraci.py b/pygame/04_pong_dva_hraci.py new file mode 100644 index 0000000..578876d --- /dev/null +++ b/pygame/04_pong_dva_hraci.py @@ -0,0 +1,192 @@ +import pygame +import sys + +# pygame.init() spustí vnitřní motory knihovny Pygame. Bez toho nejde ani otevřít okno. +pygame.init() + +# --- NASTAVENÍ OKNA --- +SIRKA = 800 +VYSKA = 600 +# Okno upevníme na tyto rozměry +okno = pygame.display.set_mode((SIRKA, VYSKA)) +pygame.display.set_caption("Pong - Plná Hra pro dva hráče") + +# --- BARVY --- +BILA = (255, 255, 255) +CERNA = (0, 0, 0) +ZELENA = (0, 255, 0) + +# Herní hodiny omezují, aby náš počítač nehrál 1000x za vteřinu, čímž by hra byla nehratelná. +hodiny = pygame.time.Clock() + +# Tvorba písem (pro vykreslování textu potřebujeme vždy nastavit velikost a typ písma) +font_velky = pygame.font.SysFont("Arial", 50) +font_maly = pygame.font.SysFont("Arial", 30) + +# --- STAVOVÝ AUTOMAT (State Machine) --- +# Trik profesionálů: Hra je vždy v nějakém "Stavu" (Menu, Hra, Konec). +# Podle tohoto čísla pak naše hlavní smyčka pozná, jaké má platit rozvržení obrazovky a pravidla. +STAV_MENU = 0 +STAV_HRA = 1 +STAV_KONEC = 2 +stav = STAV_MENU # Začínáme logicky v hlavním menu + +# --- PROMĚNNÉ HRÁČŮ (Pálky) A MÍČKU --- +palka_sirka = 15 +palka_vyska = 100 +rychlost_palky = 7 +micek_velikost = 15 + +# Funkce, která vrátí všechny proměnné na začátek. Použije se po gólu nebo při startu nové hry. +def reset_hry(): + # Klíčové slovo 'global' musíme použít vždycky, když uvnitř Funkce chceme MĚNIT proměnnou, + # která byla vytvořena venku (na nejvyšší úrovni skriptu). + global hrac1_y, hrac2_y, skore1, skore2, micek_x, micek_y, micek_rychlost_x, micek_rychlost_y + + # Hráče zarovnáme na střed Y osy (Výška okna / 2 - polovina velikosti hráče) + hrac1_y = VYSKA // 2 - palka_vyska // 2 + hrac2_y = VYSKA // 2 - palka_vyska // 2 + skore1 = 0 + skore2 = 0 + + # Míček přesně doprostřed obou os X a Y + micek_x = SIRKA // 2 - micek_velikost // 2 + micek_y = VYSKA // 2 - micek_velikost // 2 + + # Míček poletí rychlostí 5 bodů za snímek šikmo dolů doprava + micek_rychlost_x = 5 + micek_rychlost_y = 5 + +# Okamžitě to zavoláme, abychom proměnným výše vložili výchozí čísla hned při spuštění programu +reset_hry() + +bezime = True +# Hlavní cyklus hry, který točí snímek za snímkem donekonečna, dokud aplikaci neukončíme. +while bezime: + + # 1. ZPRACOVÁNÍ UDÁLOSTÍ + # Procházíme např. stisky tlačítek myši, křížek pro zavření okna, jedno-stisky kláves + for udalost in pygame.event.get(): + if udalost.type == pygame.QUIT: + bezime = False # Ukončíme while-cyklus + + # Zjišťujeme, zda se NESTISKNULA klávesa. Tohle se provede jen JEDNOU, i když ji uživatel drží! + if udalost.type == pygame.KEYDOWN: + if stav == STAV_MENU and udalost.key == pygame.K_SPACE: + # Jsme v menu, hráč stiskl MEZERNÍK. Přepneme hru do režimu STAV_HRA! + stav = STAV_HRA + elif stav == STAV_KONEC and udalost.key == pygame.K_SPACE: + # Jsme na obrazovce s vítězem, hráč chce hrát znovu. + reset_hry() + stav = STAV_HRA + + # Oproti tomu toto zjistí AKTUÁLNĚ DRŽENÉ klávesy v tomto zlomku vteřiny + klavesy = pygame.key.get_pressed() + + # 2. HERNÍ LOGIKA (HÝBÁNÍ SE) + # Tohle se provede JEN a POUZE, pokud zrovna hrajeme zápas! + if stav == STAV_HRA: + # Ovládání Hráče 1 vlevo (Klávesy W a S pro pohyb nahoru/dolů) + if klavesy[pygame.K_w] and hrac1_y > 0: + hrac1_y -= rychlost_palky + # Dolů nemůže víc, než je výška okna zmenšená o jeho vlastní výšku pálky + if klavesy[pygame.K_s] and hrac1_y < VYSKA - palka_vyska: + hrac1_y += rychlost_palky + + # Ovládání Hráče 2 vpravo (Šipky Nahoru a Dolů) + if klavesy[pygame.K_UP] and hrac2_y > 0: + hrac2_y -= rychlost_palky + if klavesy[pygame.K_DOWN] and hrac2_y < VYSKA - palka_vyska: + hrac2_y += rychlost_palky + + # Míček se za každou smyčku kousek posune. Tím vzniká dojem pohybu. + micek_x += micek_rychlost_x + micek_y += micek_rychlost_y + + # --- Fyzika: Odraz míčku od stropu a podlahy --- + # Trik: Vynásobením rychlosti číslem -1 se obrátí znaménko. + # Z kladné rychlosti (+5 padá dolů) se stane záporná (-5 letí nahoru). Odrazil se! + if micek_y <= 0 or micek_y >= VYSKA - micek_velikost: + micek_rychlost_y *= -1 + + # --- Fyzika: Odraz od pálek hráčů --- + # Abychom to jednoduše spočítali, vyrobíme si takzvané virtuální Obdélníky (Rect) + rect_micek = pygame.Rect(micek_x, micek_y, micek_velikost, micek_velikost) + + # Pálku Hráče 1 vykreslujeme fixně 30 pixelů od levého okraje + rect_hrac1 = pygame.Rect(30, hrac1_y, palka_sirka, palka_vyska) + # Pálku Hráče 2 fixně na pravé straně. (SIRKA - 30 od kraje - velikost pálky) + rect_hrac2 = pygame.Rect(SIRKA - 30 - palka_sirka, hrac2_y, palka_sirka, palka_vyska) + + # Metoda 'colliderect' doslova zkoumá, jestli se tyto obdélníky v daný moment nepřekrývají + if rect_micek.colliderect(rect_hrac1) or rect_micek.colliderect(rect_hrac2): + # Odrazil se od pálky! Obrátíme jeho směr po ose X a ještě ho mírně zrychlíme (* -1.1) + micek_rychlost_x *= -1.1 + + # --- Vyhodnocení Gólu --- + if micek_x < 0: + # Přeletěl za levý okraj (Hráč 1 ho nezachytil). Bod pro Hráče 2! + skore2 += 1 + micek_x, micek_y = SIRKA // 2, VYSKA // 2 # Teleportace míčku na prostředek + micek_rychlost_x = 5 # Reset rychlosti a ať letí k hráči co dostal gól (doprava) + elif micek_x > SIRKA: + # Přeletěl vpravo + skore1 += 1 + micek_x, micek_y = SIRKA // 2, VYSKA // 2 + micek_rychlost_x = -5 # Směr letu doleva + + # --- Konec Zápasu --- + # Zápas končí, jakmile někdo dosáhne 5 bodů + if skore1 >= 5 or skore2 >= 5: + stav = STAV_KONEC + + # 3. KRESLENÍ GRAFIKY + # Vždy smažeme starou stopu vyplněním okna čistě černou barvou + okno.fill(CERNA) + + # Co na obrazovce bude záleží zcela na tom, ve kterém STAVU náš Stavový Automat právě je! + if stav == STAV_MENU: + # Vykreslení Menu. .render převede nápis z textu do "razítka" + nadpis = font_velky.render("PONG", True, BILA) + navod = font_maly.render("Stiskni MEZERNÍK pro start", True, ZELENA) + + # Tyto razítka .blitnem (otiskneme) na plátno. Výpočet (SIRKA//2 - nadpis.get_width()//2) zarovná nápis čistě doprostřed obrazovky. + okno.blit(nadpis, (SIRKA//2 - nadpis.get_width()//2, 200)) + okno.blit(navod, (SIRKA//2 - navod.get_width()//2, 300)) + + elif stav == STAV_HRA: + # Jsme ve hře. Vykreslíme půlící čáru (síť v Pongu). 'aaline' je hladká čára. + pygame.draw.aaline(okno, BILA, (SIRKA // 2, 0), (SIRKA // 2, VYSKA)) + + # Nakreslíme pálky na místa, která předtím logika vypočítala + pygame.draw.rect(okno, BILA, rect_hrac1) + pygame.draw.rect(okno, BILA, rect_hrac2) + + # Míček vykreslíme jako 'ellipsu' napasovanou na ten neviditelný 'rect_micek' obdélník. Vznikne tak kruh. + pygame.draw.ellipse(okno, BILA, rect_micek) + + # Kreslení obou skóre úplně nahoru + text_skore = font_velky.render(f"{skore1} {skore2}", True, BILA) + okno.blit(text_skore, (SIRKA // 2 - text_skore.get_width() // 2, 20)) + + elif stav == STAV_KONEC: + # Zjištění, kdo vyhrál pomocí tzv. ternárního if (vítězem je "Hráč 1" POKUD má skore1>=5, JINAK je to "Hráč 2") + vitez = "Hráč 1" if skore1 >= 5 else "Hráč 2" + + # Razítka s nápisy + text_vitez = font_velky.render(f"{vitez} vyhrál!", True, ZELENA) + text_restart = font_maly.render("Stiskni MEZERNÍK pro novou hru", True, BILA) + + # Obtisknutí doprostřed okna + okno.blit(text_vitez, (SIRKA//2 - text_vitez.get_width()//2, 200)) + okno.blit(text_restart, (SIRKA//2 - text_restart.get_width()//2, 300)) + + # Obraz je složený nanečisto v paměti. .flip() ho teprve natvrdo pošle na monitor! + pygame.display.flip() + + # Pauza na udržení stabilních 60 FPS + hodiny.tick(60) + +# Konec programu +pygame.quit() +sys.exit() diff --git a/pygame/05_skakacka_gravitace.py b/pygame/05_skakacka_gravitace.py new file mode 100644 index 0000000..b257573 --- /dev/null +++ b/pygame/05_skakacka_gravitace.py @@ -0,0 +1,169 @@ +import pygame +import sys +import random + +pygame.init() + +# --- NASTAVENÍ OKNA A PROMĚNNÝCH PROSTŘEDÍ --- +SIRKA = 800 +VYSKA = 600 +okno = pygame.display.set_mode((SIRKA, VYSKA)) +pygame.display.set_caption("Skákačka přes překážky") + +# --- BARVY --- +BILA = (255, 255, 255) +CERNA = (0, 0, 0) +MODRA = (50, 150, 255) # Na modrou oblohu +ZELENA = (50, 200, 50) # Zelená pro plošinu trávy +CERVENA = (255, 0, 0) # Nebezpečné překážky v cestě + +hodiny = pygame.time.Clock() +font = pygame.font.SysFont("Arial", 40) +font_maly = pygame.font.SysFont("Arial", 25) + +# --- STAVOVÝ AUTOMAT HRY --- +STAV_MENU = 0 +STAV_HRA = 1 +STAV_KONEC = 2 +stav = STAV_MENU + +# --- FYZIKA A HERNÍ PROMĚNNÉ --- +podlaha_y = VYSKA - 50 # V jaké hloubce se nachází hrana země/podlahy? (od shora dolů) +hrac_sirka = 40 +hrac_vyska = 40 + +# Fyzika +# Gravitace způsobuje trvalé ZRYCHLOVÁNÍ pádu. Ne rychlost, zrychlení! +gravitace = 0.6 +# Skok není nic jiného, než extrémní rána do záporných hodnot na ose Y (odstřelení do stropu) +sila_skoku = -12 + +def reset_hry(): + """Funkce pro nahození proměnných do výchozího stavu pro start čisté hry""" + global hrac_x, hrac_y, rychlost_y, na_zemi, prekazky, skore, rychlost_hry + hrac_x = 100 # Hráč stojí celkem blízko levému kraji, aby měl čas reagovat + + # Hráče položíme tak, aby jeho nohy (y + výška) přesně seděly na 'podlaha_y' + hrac_y = podlaha_y - hrac_vyska + rychlost_y = 0 + na_zemi = True # Nyní stojí na zemi (a smí tedy zmáčknout Skok) + + # Místo abychom dělali překážku po překážce, uchováme je jako seznam (List) + prekazky = [] + skore = 0 + rychlost_hry = 6 # Jak rychle ubíhá terén směrem k hráči doleva? + +reset_hry() + +# --- VLASTNÍ ČASOVAČ (Custom Event) --- +# Trik z programování: Pygame neustále běží ve smyčce a "naslouchá" událostem (jako stisk myši). +# Zde si vyrobíme událost NAŠI VLASTNÍ. Pojmenujeme ji libovolně SPAWN_PREKAZKY. +SPAWN_PREKAZKY = pygame.USEREVENT + 1 +# Nastavíme pygame časovač tak, ať tuto 'neviditelnou klávesu SPAWN_PREKAZKY' pípne +# do fronty událostí přesně každých 1500 milisekund (1.5 sekundy). Úplně automaticky! +pygame.time.set_timer(SPAWN_PREKAZKY, 1500) + +bezime = True +while bezime: + + # 1. ZPRACOVÁNÍ UDÁLOSTÍ + for udalost in pygame.event.get(): + if udalost.type == pygame.QUIT: + bezime = False + + # Zkoumání stisku kláves jako POUHÁ UDÁLOST. To znamená "zmáčklo se to" + # neboli neřešíme, jestli se to zrovna drží stlačené. Ideální pro Starty a Skoky. + if udalost.type == pygame.KEYDOWN: + if stav == STAV_MENU and udalost.key == pygame.K_SPACE: + stav = STAV_HRA + elif stav == STAV_KONEC and udalost.key == pygame.K_SPACE: + reset_hry() + stav = STAV_HRA + + # Jak hráč skáče? Šipka nahoru! Ale MUSÍ zároveň stát na zemi (na_zemi == True), + # jinak bychom mohli skákat ve vzduchu jak pták (tzv. multi-jump) + elif stav == STAV_HRA and udalost.key == pygame.K_UP and na_zemi: + rychlost_y = sila_skoku # Tímto dáváme drtivý impulz rychlosti směrem NAHORU + na_zemi = False # Teď už jsme ve vzduchu! + + # Tady čekáme na PÍPNUTÍ z našeho automatického Custom Časovače!!! + if udalost.type == SPAWN_PREKAZKY and stav == STAV_HRA: + # Objevil se signál, že uplynulo 1.5 sekundy. + # Přidáme novou překážku (čtvereček červený) na konec obrazovky (SIRKA) + # Tyto překážky ukládáme rovnou jako Rect, protože se to pak hodí u kolizí + prekazky.append(pygame.Rect(SIRKA, podlaha_y - 40, 30, 40)) + + # Aby to nebylo nudné, pokaždé hru o malilinký kousíček zrychlíme. + rychlost_hry += 0.1 + + # 2. LOGIKA + if stav == STAV_HRA: + # --- FYZIKA SKÁKÁNÍ --- + # Neúprosná gravitace v každém milisekundovém snímku přidává směrem DOLŮ! + rychlost_y += gravitace + # Změníme opravdovou Y pozici hráče o tuto aktuální rychlost. + # Výsledek? Hráč zpomaluje směrem nahoru... zastaví se... a začne opět zrychlovat dolů k zemi! + hrac_y += rychlost_y + + # Musíme ale zabránit tomu, aby hráč propadl podlahou do hlubin! + if hrac_y + hrac_vyska >= podlaha_y: + # Opravíme jeho Y, posadíme ho přesně podrážkama na okraj podlahy + hrac_y = podlaha_y - hrac_vyska + rychlost_y = 0 # Rychlost dopadu zrušíme, stál by na místě + na_zemi = True # Oznámíme, že zase můžeme skákat, dotýkáme se + + # Vytvoření virtuálního obalu přes našeho hráče kvůli měření kolizí + hrac_rect = pygame.Rect(hrac_x, hrac_y, hrac_sirka, hrac_vyska) + + # --- LOGIKA VŠECH PŘEKÁŽEK NA TRATI --- + # For cyklus prekazky[:] zkoumá tzv. KOPII seznamu. + # Je to proto, abychom z originálu mohli prvek bezpečně vymazat a nic "nepřeskočili". + for p in prekazky[:]: + p.x -= int(rychlost_hry) # Každá jedna překážka jede nezadržitelně doleva směrem na nás + + # Co když se obdélníčky Hráče a Překážky překrývají? -> BOUM! + if p.colliderect(hrac_rect): + stav = STAV_KONEC + + # Pokud na nás nenarazila, zajela na levém okraji pod 0 a zmizela (p.x < -30) + if p.x < -30: + prekazky.remove(p) # Hráč ji s úspěchem přežil a překážka zajela za monitor. Smazat z RAM! + skore += 1 # Přičteme za ni bod. + + # 3. KRESLENÍ (na monitor) + okno.fill(MODRA) # Obloha + # Nakreslíme zelený pruh od čáry podlahy (podlaha_y) dolů až k zemi, bude dělat vizuál trávy + pygame.draw.rect(okno, ZELENA, (0, podlaha_y, SIRKA, VYSKA - podlaha_y)) + + if stav == STAV_MENU: + text = font.render("SKÁKAČKA", True, BILA) + start = font_maly.render("Stiskni MEZERNÍK. Skáče se šipkou NAHORU.", True, CERNA) + okno.blit(text, (SIRKA//2 - text.get_width()//2, 200)) + okno.blit(start, (SIRKA//2 - start.get_width()//2, 300)) + + elif stav == STAV_HRA: + # Nakreslení postavičky hráče - využijeme ten Rect obal, co už jsme si spočítali + pygame.draw.rect(okno, CERNA, hrac_rect) + + # Nakreslíme úplně všechny načítané nepřátelské Rect obdélníky jako červené objekty + for p in prekazky: + pygame.draw.rect(okno, CERVENA, p) + + skore_text = font.render(f"Skóre: {skore}", True, CERNA) + okno.blit(skore_text, (10, 10)) + + elif stav == STAV_KONEC: + text = font.render("KONEC HRY", True, CERVENA) + skore_text = font.render(f"Dosažené skóre: {skore}", True, BILA) + restart = font_maly.render("Stiskni MEZERNÍK pro novou hru", True, CERNA) + + okno.blit(text, (SIRKA//2 - text.get_width()//2, 150)) + okno.blit(skore_text, (SIRKA//2 - skore_text.get_width()//2, 220)) + okno.blit(restart, (SIRKA//2 - restart.get_width()//2, 300)) + + # .flip() překlopí to, co jsme nakreslili v paměti na obrazovku k hráči + pygame.display.flip() + hodiny.tick(60) # Cílíme na hladkých 60 FPS (Frames Per Second) + +pygame.quit() +sys.exit() diff --git a/pygame/06_vesmirna_strilecka.py b/pygame/06_vesmirna_strilecka.py new file mode 100644 index 0000000..9602ada --- /dev/null +++ b/pygame/06_vesmirna_strilecka.py @@ -0,0 +1,185 @@ +import pygame +import sys +import random + +pygame.init() + +# --- NASTAVENÍ OKNA --- +SIRKA = 800 +VYSKA = 600 +okno = pygame.display.set_mode((SIRKA, VYSKA)) +pygame.display.set_caption("Vesmírná střílečka (Space Invaders)") + +# --- BARVY --- +CERNA = (0, 0, 0) +ZELENA = (0, 255, 0) # Hráč (Vesmírná loď) +CERVENA = (255, 0, 0) # Nepřátelé (Mimozemšťani, Meteority) +ZLUCA = (255, 255, 0) # Projektily (Lasery) +BILA = (255, 255, 255) # Text a UI + +hodiny = pygame.time.Clock() +font_velky = pygame.font.SysFont("Arial", 50) +font_maly = pygame.font.SysFont("Arial", 30) + +# Herní stav 0,1,2 - stejná logika oddělení úvodního menu od zápasu +STAV_MENU = 0 +STAV_HRA = 1 +STAV_KONEC = 2 +stav = STAV_MENU + +# Rozměry vesmírné lodi hráče +hrac_sirka = 40 +hrac_vyska = 40 +rychlost_hrace = 6 +rychlost_projektilu = 10 # Lasery létají celkem svižně nahoru + +# Vytvoření vlastního časovače pro přidávání nepřátel, viz skákačka +SPAWN_NEPRITELE = pygame.USEREVENT + 1 + +def reset_hry(): + """Tato funkce srovná hru zpátky do prvního dne, když spustíme reset""" + global hrac_x, hrac_y, projektily, nepratele, skore, rychlost_nepritele, spawn_cas + + # Hráč je dole nad hranou obrazovky + hrac_x = SIRKA // 2 - hrac_sirka // 2 + hrac_y = VYSKA - 60 + + # Budou zde létat nezávisle na sobě desítky kulek i nepřátel. + # Abychom se v nich vyznali, naženeme je všechny do SEZNAMŮ. + projektily = [] + nepratele = [] + + skore = 0 + rychlost_nepritele = 2.0 + spawn_cas = 1000 # Počáteční čas (v milisekundách) k objevování padajících mimozemšťanů + + # Nastartování naší události (eventu), začne tikat... + pygame.time.set_timer(SPAWN_NEPRITELE, spawn_cas) + +reset_hry() + +bezime = True +while bezime: + # 1. ZPRACOVÁNÍ UDÁLOSTÍ + for udalost in pygame.event.get(): + if udalost.type == pygame.QUIT: + bezime = False + + # Zjišťujeme JEDNORÁZOVÉ stisknutí tlačítek. Například výstřel nebo posun v menu. + if udalost.type == pygame.KEYDOWN: + if stav == STAV_MENU and udalost.key == pygame.K_SPACE: + stav = STAV_HRA + elif stav == STAV_KONEC and udalost.key == pygame.K_SPACE: + reset_hry() + stav = STAV_HRA + elif stav == STAV_HRA and udalost.key == pygame.K_SPACE: + # --- VÝSTŘEL --- + # Hráč právě odpálil! Vypočítáme, kde zhruba leží střed jeho lodi (špička křídel) + projektil_x = hrac_x + hrac_sirka // 2 - 5 + # A přímo na těchto souřadnicích se narodí nová "KULKA" v podobě Rect. Přidáme do listu. + projektily.append(pygame.Rect(projektil_x, hrac_y, 10, 20)) + + # Zde časovač zakřičel (třeba každou sekundu), že na nás padá další nepřítel + if udalost.type == SPAWN_NEPRITELE and stav == STAV_HRA: + # Narodil se nový nepřítel nahoře mimo obraz (proto je osa y záporná: -40) na náhodném místě osy X. + n_x = random.randint(0, SIRKA - 40) + nepratele.append(pygame.Rect(n_x, -40, 40, 40)) + + # STUPŇOVÁNÍ OBTÍŽNOSTI (Nepřátelé padají čím dál rychleji) + rychlost_nepritele += 0.05 + + # Čím déle hrajeme, tím se také zkracuje ten časovač a nepřátel je hustší roj. + # Omezíme to na min 300ms, aby ta hra byla alespoň fyzicky dohratelná a nepřátelé nespadli z jednolité zdi. + if spawn_cas > 300: + spawn_cas -= 20 + # Musíme časovač s tímto novým o 20ms kratším časem znovu "nastartovat" + pygame.time.set_timer(SPAWN_NEPRITELE, spawn_cas) + + if stav == STAV_HRA: + # 2. LOGIKA + + # Ovládání vesmírné lodi doprava a doleva držením tlačítek + klavesy = pygame.key.get_pressed() + if klavesy[pygame.K_LEFT] and hrac_x > 0: + hrac_x -= rychlost_hrace + if klavesy[pygame.K_RIGHT] and hrac_x < SIRKA - hrac_sirka: + hrac_x += rychlost_hrace + + # --- POHYB VŠECH LASERŮ (KULEK) --- + # Projektily[:] dělá kopii listu, to se musí dělat vždy, když chci za běhu for-cyklu z toho pole + # věci rovnou odstraňovat! Kdybychom neodstraňovali kulky, list by narostl a hra spadla na paměť. + for p in projektily[:]: + p.y -= rychlost_projektilu # Y se ZMENŠUJE, protože kulka cestuje odspodu (např. Y=500) nahoru (Y=0) + + # Když kulka odcestuje nad okraj obrazovky do hlubin kosmu, smažeme ji + if p.y < 0: projektily.remove(p) + + # Hráč samotný obalený do neviditelného Rect rámečku pro vyhodnocování havárií + hrac_rect = pygame.Rect(hrac_x, hrac_y, hrac_sirka, hrac_vyska) + + # --- POHYB VŠECH NEPŘÁTEL & KOLIZE --- + for n in nepratele[:]: + n.y += int(rychlost_nepritele) # Zvyšujeme Y -> Meteorit letí strmě dolů z nebes k podlaze + + # 1. Havárie! Pokud meteorit doletí až úplně dolů přes obrazovku, NEBO narazí do Hráče + if n.y > VYSKA or n.colliderect(hrac_rect): + stav = STAV_KONEC + + # 2. Křížová kontrola, zda SE STŘETLA KULKA S NEPŘÍTELEM (Laser do Meteoritu) + # Každého meteorita porovnáme znovu se všemi létajícími lasery na scéně! + for p in projektily[:]: + # .colliderect znamená "prolnuly se tyhle dva čtverce?" + if p.colliderect(n): + # BUM! Nastal obrovský výbuch. + # Zmizí Laser i Meteorit, tak je oba bezpečně (jen pokud už nebyli smazáni) vymažeme + if p in projektily: projektily.remove(p) + if n in nepratele: nepratele.remove(n) + skore += 10 # +10 bodů do kasičky! + + # SLOVO 'break' ZMRAZÍ TENTO VNITŘNÍ FOR CYKLUS! + # Má to logiku - Pokud tento Nepřítel 'n' byl teď vteřinu zničen, už nedává smysl dál + # v tomto mikrosnímku procházet zbylé kulky a ptát se, jestli ho střelily taky. Přerušíme to. + break + + # 3. KRESLENÍ GRAFIKY + okno.fill(CERNA) + + if stav == STAV_MENU: + text = font_velky.render("VESMÍRNÁ STŘÍLEČKA", True, ZLUCA) + start = font_maly.render("Stiskni MEZERNÍK. Střílíš mezerníkem, pohyb šipkami.", True, BILA) + okno.blit(text, (SIRKA//2 - text.get_width()//2, 200)) + okno.blit(start, (SIRKA//2 - start.get_width()//2, 300)) + + elif stav == STAV_HRA: + # Jsme ve hře! Nyní se z paměti převedou čísla Rect rámečků do reálných obrazců na monitoru. + + # Naše loď + pygame.draw.rect(okno, ZELENA, hrac_rect) + + # Smyčka vykreslí všechny Lasery co jsou aktuálně ve vzduchu + for p in projektily: + pygame.draw.rect(okno, ZLUCA, p) + + # Ta samá smyčka vykreslí pluky všech padajících Nepřátel + for n in nepratele: + pygame.draw.rect(okno, CERVENA, n) + + # Zobrazení skóre + skore_text = font_maly.render(f"Skóre: {skore}", True, BILA) + okno.blit(skore_text, (10, 10)) + + elif stav == STAV_KONEC: + text = font_velky.render("ZEMŘEL JSI!", True, CERVENA) + skore_text = font_velky.render(f"Tvé skóre: {skore}", True, BILA) + restart = font_maly.render("Stiskni MEZERNÍK pro novou hru", True, ZLUCA) + + okno.blit(text, (SIRKA//2 - text.get_width()//2, 150)) + okno.blit(skore_text, (SIRKA//2 - skore_text.get_width()//2, 250)) + okno.blit(restart, (SIRKA//2 - restart.get_width()//2, 350)) + + # Obraz je spočítán. Posíláme do HDMI portu na monitor! (.flip) + pygame.display.flip() + hodiny.tick(60) + +pygame.quit() +sys.exit() diff --git a/pygame/07_had.py b/pygame/07_had.py new file mode 100644 index 0000000..8be7a3f --- /dev/null +++ b/pygame/07_had.py @@ -0,0 +1,174 @@ +import pygame +import random +import sys + +# Povinná příprava knihovny Pygame +pygame.init() + +# --- NASTAVENÍ OKNA A MŘÍŽKY --- +# Hra SNAKE (Had) většinou nefunguje na pixely jako ostatní hry, ale funguje na jakési neviditelné "Mřížce". +SIRKA_OKNA = 800 +VYSKA_OKNA = 600 +VELIKOST_DILKU = 20 # Velikost jednoho čtverečku na mřížce (dílku hada i jídla) +FPS = 15 # Rychlost hada. Zde je nižší 15, protože pohyb po skocích na mřížce nevyžaduje 60 FPS. + +# Definice Palety Barev (Red, Green, Blue) +CERNA = (0, 0, 0) +BILA = (255, 255, 255) +ZELENA = (0, 255, 0) +CERVENA = (255, 0, 0) + +okno = pygame.display.set_mode((SIRKA_OKNA, VYSKA_OKNA)) +pygame.display.set_caption("Klasický Had (Snake)") + +hodiny = pygame.time.Clock() +font = pygame.font.SysFont("arial", 36) + +# Pomocná funkce pro rychlé vykreslení textu na daných x, y. +# Zkracuje to kód, abychom pořád neopakovali metody render() a blit(). +def zobraz_text(text, barva, x, y): + text_plocha = font.render(text, True, barva) + okno.blit(text_plocha, (x, y)) + +# Veškerou logiku hry teď poprvé schováme do tzv. Hlavní Funkce. +# Proč? Jakmile funkce skončí (kvůli výhře/prohře), velmi jednoduše se tímto trikem dá celá hra resetovat, +# jelikož stačí funkci zavolat odznova. +def hlavni_smycka(): + + # --- POČÁTEČNÍ STAV HRY --- + # Nejdůležitější princip této hry! Tělo hada není jeden objekt, je to SEZNAM SOUŘADNIC (pole v poli). + # Každý článek jeho těla má své [x, y]. Ten ÚPLNĚ PRVNÍ prvek na pozici 0 je HLAVA HADA. + had_telo = [ + [SIRKA_OKNA // 2, VYSKA_OKNA // 2], # Hlava + [SIRKA_OKNA // 2 - VELIKOST_DILKU, VYSKA_OKNA // 2], # Druhý článek břicha + [SIRKA_OKNA // 2 - 2 * VELIKOST_DILKU, VYSKA_OKNA // 2] # Ocas + ] + + # Směr pohybu! Tohle číslo přidáme při každém snímku k souřadnicím HLAVY. + # Tím ji virtuálně posuneme vpřed. + smer_x = VELIKOST_DILKU # Z počátku letí had doprava, protože z osy X roste pozitivně + smer_y = 0 # Do vertikály Y mu zpočátku nepřidáváme nic, letí rovně + + # --- POZICE JÍDLA (ČERVENÝ ČTVEREČEK) --- + # Jídlo musíme nasměrovat přesně do nějaké buňky mřížky! + # Trik: random.randrange(od, do, krok) ... Jídlo padne například na X=20, 40, 60... ale NIKDY na 17, 33 atd. + # Kdyby nebylo zarovnané na mřížku, tak ho had miné! + jidlo_x = random.randrange(0, SIRKA_OKNA, VELIKOST_DILKU) + jidlo_y = random.randrange(0, VYSKA_OKNA, VELIKOST_DILKU) + + skore = 0 + konec_hry = False # Boolean kontrolka pro Game Over + + # Nekonečná smyčka tohoto jednoho konkrétního zápasu + while True: + + # 1. ZPRACOVÁNÍ UDÁLOSTÍ + for udalost in pygame.event.get(): + if udalost.type == pygame.QUIT: + pygame.quit() + sys.exit() + + # Detekce šipek pro změnu SMĚRU pohybu HADA + if udalost.type == pygame.KEYDOWN: + + # OCHRANA: Had nemůže provést fyzicky nemožný obrat o 180 stupňů a zajet si rovnou do těla! + # Tzn. pokud zmáčknul šipku DOLEVA, a had letí rovně/doprava (smer_x == 0), + # teprve pak si smí dovolit nastavit změnu směru. + if udalost.key == pygame.K_LEFT and smer_x == 0: + smer_x = -VELIKOST_DILKU # Záporná hodnota pro směr vlevo + smer_y = 0 # Vertikální se ruší + elif udalost.key == pygame.K_RIGHT and smer_x == 0: + smer_x = VELIKOST_DILKU # Kladná hodnota pro směr vpravo + smer_y = 0 + elif udalost.key == pygame.K_UP and smer_y == 0: + smer_x = 0 + smer_y = -VELIKOST_DILKU # Záporná hodnota směrem vzhůru k Y=0 + elif udalost.key == pygame.K_DOWN and smer_y == 0: + smer_x = 0 + smer_y = VELIKOST_DILKU + + # Pokud zemřel a bliká varování, čekáme na Mezerník + if udalost.key == pygame.K_SPACE and konec_hry: + # Pokud nastane RETURN, znamená to, že se celá tato 'hlavni_smycka()' okamžitě ukončí, + # její paměť (proměnné had_telo atd) se nenávratně vymaže. + # Následně ji však náš spouštěč úplně dole v souboru spustí naprosto na čisto znova. (RESTART) + return + + # LOGIKA HRY: Provede se jenom pokud žijeme + if not konec_hry: + + # --- ZÁKLADNÍ PRINCIP POHYBU HADA --- + # Jak hada posunout? + # 1. Spočítáme, kde se bude nacházet hadova hlava v PŘÍŠTÍM Snímku + # Vezmeme si pozici staré hlavy, neboli had_telo na nultém indexu + nova_hlava_x = had_telo[0][0] + smer_x + nova_hlava_y = had_telo[0][1] + smer_y + + # 2. Tuto ZCELA NOVOU POZICI vsuneme pomocí "insert" na ÚPLNÝ ZAČÁTEK (index 0) našeho Seznamu + # Náš had je najednou o kousek delší! (Natáhl hlavu tam, kam letí) + had_telo.insert(0, [nova_hlava_x, nova_hlava_y]) + + # --- SEŽRÁNÍ JÍDLA (Růst hada) --- + # Zjišťujeme, zda se souřadnice nové hlavy náhodou rovnou nerovnají pozici Jídla na mřížce. + # Nepoužíváme obdélníkové kolize, protože pracujeme s přesnou mřížkou! + if nova_hlava_x == jidlo_x and nova_hlava_y == jidlo_y: + skore += 1 # Bod do tabulky! + + # Zrušíme staré jídlo a najdeme mu na hracím plánu nové náhodné místo (zarovnané na mřížku) + jidlo_x = random.randrange(0, SIRKA_OKNA, VELIKOST_DILKU) + jidlo_y = random.randrange(0, VYSKA_OKNA, VELIKOST_DILKU) + + # TOHLE JE DŮLEŽITÉ: Náš hadí Seznam byl momentálně obohacen o přední novou "hlavu", tzn vyrostl, a + # a my mu ten starý OCAS NEZKRÁTÍME. Takže je opravdu objektivně o jedno políčko natrvalo větší! + else: + # Pokud jídlo na této pozici NEBYLO, my musíme zachovat hada stále stejně dlouhého. + # Nahoře jsme mu před chvílí přidali hlavičku. Tady dole mu z konce seznamu (ocásku) + # jeden prvek odebereme (pomocí .pop()), takže vlastně provedl POHYB A JE STÁLE STEJNĚ DLOUHÝ. + had_telo.pop() + + # --- SMRTELNÉ NÁRAZY (Stěna a Sebevražda) --- + + # Pokud vylétla nová hlava mimo rozměry Okna... + if (nova_hlava_x < 0 or nova_hlava_x >= SIRKA_OKNA or + nova_hlava_y < 0 or nova_hlava_y >= VYSKA_OKNA): + konec_hry = True # GAME OVER + + # Nebo pokud had sežral vlastního ocas! + # for-cyklus "for dilek in had_telo[1:]" prohlédne VŠE kromě samotné hlavy (začíná od indexu 1, čili tělo) + # A pokud se na jedné jediné z těchto pozic těla nachází nově nakreslená hlava, tak had do sebe kousl. + for dilek in had_telo[1:]: + if nova_hlava_x == dilek[0] and nova_hlava_y == dilek[1]: + konec_hry = True + + # --- VYKRESLOVÁNÍ (Obarvování monitoru) --- + okno.fill(CERNA) # Umytí tabule na černo + + # 1. Jídlo (Čtverec o rozměrech jedné buňky na mřížce) + pygame.draw.rect(okno, CERVENA, (jidlo_x, jidlo_y, VELIKOST_DILKU, VELIKOST_DILKU)) + + # 2. Celý samotný dlouhý had + # Projdeme seznam všech buněk a pro každičkou z nich na daném [X, Y] nakreslíme jeden zelený kvádr + for dilek in had_telo: + pygame.draw.rect(okno, ZELENA, (dilek[0], dilek[1], VELIKOST_DILKU, VELIKOST_DILKU)) + + zobraz_text(f"Skóre: {skore}", BILA, 10, 10) + + if konec_hry: + # Zásadní hláška uprostřed pole o tom, ať to zkusí hráč znovu. + zobraz_text("Konec hry! Stiskni MEZERNÍK pro novou hru.", CERVENA, 100, VYSKA_OKNA // 2) + + # Hotový frame se prohazuje s tím na monitoru + pygame.display.flip() + + # Omezení rychlosti + hodiny.tick(FPS) + +# Úplný spodek skriptu Pythonu +# Tento 'if' ověřuje, jestli Python zapnul tento soubor napřímo jako první. +if __name__ == "__main__": + + # NEKONEČNÁ SLUČKA ŽIVOTA. + # Jakmile uvnitř `hlavni_smycka` zavoláme 'return' kvůli Game Over + stisku Mezerníku, + # funkce se zničí, a tento while True ji opět vzkřísí z prachu k novému životu s čistým listem skóre. + while True: + hlavni_smycka() diff --git a/pygame/README.md b/pygame/README.md new file mode 100644 index 0000000..4f4349c --- /dev/null +++ b/pygame/README.md @@ -0,0 +1,58 @@ +# Pygame: Herní Engine v Pythonu + +Vítejte v sekci ukázek pro Pygame! Tato knihovna tvoří absolutní standard pro tvorbu jednoduchých, výkonných 2D her v Pythonu. Oproti klasickým konzolovým skriptům je v Pygame výjimečná jedna věc: používá se zde **Herní Smyčka (Game Loop)**. + +Cílem této série příkladů je poskytnout vám ucelené komentované vzory od úplných základů až po složitější arkády. Všechny příklady byly bohatě okomentovány, aby si začínající tvůrci z řad středoškoláků a začátečníků dokázali propojit teorii s praxí. + +## Kostra Pygame programu +Každý, i ten nejsložitější program v Pygame, stojí na nepsaných 4 pilířích, které se odehrávají ve nekonečném cyklu zvaném _Herní smyčka_: + +```python +import pygame +pygame.init() # Zapnutí modulů (NUTNOST) + +# 0. PŘÍPRAVA (Jednou před hrou) +okno = pygame.display.set_mode((800, 600)) +hodiny = pygame.time.Clock() + +bezime = True +while bezime: # TOTO JE HERNÍ SMYČKA, TOČÍ SE 60x ZA VTEŘINU + + # 1. ZPRACOVÁNÍ UDÁLOSTÍ (Event Handling) + # Tady čteme, jestli hráč nestiskl klávesu, myš, nebo nezavírá okno + for udalost in pygame.event.get(): + if udalost.type == pygame.QUIT: + bezime = False + + # 2. HERNÍ LOGIKA (Game Logic) + # Zde počítáme fyziku. Pokud loď letí, přičítáme XY. Pokud narazila do zdi, končíme hru atd. + # Tady se dělají všechny ty super výpočty a matematika v pozadí. + + # 3. KRESLENÍ GRAFIKY (Render) + # Nejdříve smažeme to, co bylo v předchozím milisekundovém kroku namalované + okno.fill((0, 0, 0)) # Černá + # Teď z vypočítaných čísel namalujeme obdélníčky, kolečka nebo obrázky postav. + + # 4. AKTUALIZACE OBRAZOVKY (Flip) + # Naší monitor o ničem z kroku 3 neví, dokud nezavoláme tuto finální klíčovou metodu, + # která vezme obraz z mezipaměti procesoru a mrskne jím do vaší obrazovky. + pygame.display.flip() + + # Kontrola na 60 FPS (snímků za vteřinu) + hodiny.tick(60) + +pygame.quit() # Korektní vypnutí +``` + +## Co se zde nachází +Všechny zdrojové kódy v této složce jsou plně hratelné, připravené k tomu, abyste v nich upravovali gravitaci, rychlost, nebo tvary! + +1. **`01_pexeso.py`** – Hra testující vaši paměť na barvy. Ideální příklad použití myši, "polí v polích" a takzvaného Objektově Orientovaného Programování. Každá karta si žije vlastním životem! +2. **`02_flappy_bird.py`** – Prototyp populární hry. Ukazuje jak naprogramovat "Stavový automat" (hra ví, jestli je v Menu nebo už se bojuje o život), kolize, generování nekonečných překážek a simulaci gravitace. +3. **`03_chytani_jablek.py`** – Zlatý standard. Chytání padajících předmětů pomocí pohybu zleva doprava a počítání skóre. Krásně ukazuje detekce kolizí (`.colliderect()`). +4. **`04_pong_dva_hraci.py`** – Klasika pro dva lidi u jedné klávesnice s míčkem. Je to čistá ukázka odrazové fyziky, měnění směru střely podle úhlů nárazu. +5. **`05_skakacka_gravitace.py`** – Modelová hra se skoky typu Dinosaur z Google Chrome při nefungujícím internetu. +6. **`06_vesmirna_strilecka.py`** – Znič nepřátele, co ti padají na hlavu, a nesmíš se s nimi srazit. Skvělý příklad pro správu seznamů desítek nezávislých střel a meteorů v RAM paměti! +7. **`07_had.py`** – Klasický had z mobilních telefonů. Geniální příklad, kde se neuvažuje v pixelech, ale v jakési teoretické matematické mřížce. Had tu roste díky posunům celých seznamů! + +Přejeme vám ohromnou zábavu s Pygame! S těmito dovednostmi je už opravdu jen krůček k vašemu vlastnímu obřímu RPG! diff --git a/pygame/assets/kenney_rpg-audio/Audio/beltHandle1.ogg b/pygame/assets/kenney_rpg-audio/Audio/beltHandle1.ogg new file mode 100644 index 0000000..041a19b Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/beltHandle1.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/beltHandle2.ogg b/pygame/assets/kenney_rpg-audio/Audio/beltHandle2.ogg new file mode 100644 index 0000000..d0af0a5 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/beltHandle2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/bookClose.ogg b/pygame/assets/kenney_rpg-audio/Audio/bookClose.ogg new file mode 100644 index 0000000..c520928 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/bookClose.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/bookFlip1.ogg b/pygame/assets/kenney_rpg-audio/Audio/bookFlip1.ogg new file mode 100644 index 0000000..7c0e80b Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/bookFlip1.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/bookFlip2.ogg b/pygame/assets/kenney_rpg-audio/Audio/bookFlip2.ogg new file mode 100644 index 0000000..f02b053 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/bookFlip2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/bookFlip3.ogg b/pygame/assets/kenney_rpg-audio/Audio/bookFlip3.ogg new file mode 100644 index 0000000..f229a27 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/bookFlip3.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/bookOpen.ogg b/pygame/assets/kenney_rpg-audio/Audio/bookOpen.ogg new file mode 100644 index 0000000..acdd272 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/bookOpen.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/bookPlace1.ogg b/pygame/assets/kenney_rpg-audio/Audio/bookPlace1.ogg new file mode 100644 index 0000000..49f10a3 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/bookPlace1.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/bookPlace2.ogg b/pygame/assets/kenney_rpg-audio/Audio/bookPlace2.ogg new file mode 100644 index 0000000..6636f8a Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/bookPlace2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/bookPlace3.ogg b/pygame/assets/kenney_rpg-audio/Audio/bookPlace3.ogg new file mode 100644 index 0000000..6d569d5 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/bookPlace3.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/chop.ogg b/pygame/assets/kenney_rpg-audio/Audio/chop.ogg new file mode 100644 index 0000000..a9d991f Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/chop.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/cloth1.ogg b/pygame/assets/kenney_rpg-audio/Audio/cloth1.ogg new file mode 100644 index 0000000..b76853a Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/cloth1.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/cloth2.ogg b/pygame/assets/kenney_rpg-audio/Audio/cloth2.ogg new file mode 100644 index 0000000..45e7839 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/cloth2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/cloth3.ogg b/pygame/assets/kenney_rpg-audio/Audio/cloth3.ogg new file mode 100644 index 0000000..f995ff2 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/cloth3.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/cloth4.ogg b/pygame/assets/kenney_rpg-audio/Audio/cloth4.ogg new file mode 100644 index 0000000..a7ad4aa Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/cloth4.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/clothBelt.ogg b/pygame/assets/kenney_rpg-audio/Audio/clothBelt.ogg new file mode 100644 index 0000000..ea7d877 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/clothBelt.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/clothBelt2.ogg b/pygame/assets/kenney_rpg-audio/Audio/clothBelt2.ogg new file mode 100644 index 0000000..9068fbd Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/clothBelt2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/creak1.ogg b/pygame/assets/kenney_rpg-audio/Audio/creak1.ogg new file mode 100644 index 0000000..4f6de6f Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/creak1.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/creak2.ogg b/pygame/assets/kenney_rpg-audio/Audio/creak2.ogg new file mode 100644 index 0000000..bfa3045 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/creak2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/creak3.ogg b/pygame/assets/kenney_rpg-audio/Audio/creak3.ogg new file mode 100644 index 0000000..0673845 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/creak3.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/doorClose_1.ogg b/pygame/assets/kenney_rpg-audio/Audio/doorClose_1.ogg new file mode 100644 index 0000000..21021c5 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/doorClose_1.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/doorClose_2.ogg b/pygame/assets/kenney_rpg-audio/Audio/doorClose_2.ogg new file mode 100644 index 0000000..f64212b Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/doorClose_2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/doorClose_3.ogg b/pygame/assets/kenney_rpg-audio/Audio/doorClose_3.ogg new file mode 100644 index 0000000..c08399c Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/doorClose_3.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/doorClose_4.ogg b/pygame/assets/kenney_rpg-audio/Audio/doorClose_4.ogg new file mode 100644 index 0000000..ef44236 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/doorClose_4.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/doorOpen_1.ogg b/pygame/assets/kenney_rpg-audio/Audio/doorOpen_1.ogg new file mode 100644 index 0000000..7df2826 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/doorOpen_1.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/doorOpen_2.ogg b/pygame/assets/kenney_rpg-audio/Audio/doorOpen_2.ogg new file mode 100644 index 0000000..d57087c Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/doorOpen_2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/drawKnife1.ogg b/pygame/assets/kenney_rpg-audio/Audio/drawKnife1.ogg new file mode 100644 index 0000000..4141dbf Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/drawKnife1.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/drawKnife2.ogg b/pygame/assets/kenney_rpg-audio/Audio/drawKnife2.ogg new file mode 100644 index 0000000..012be85 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/drawKnife2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/drawKnife3.ogg b/pygame/assets/kenney_rpg-audio/Audio/drawKnife3.ogg new file mode 100644 index 0000000..49edc99 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/drawKnife3.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/dropLeather.ogg b/pygame/assets/kenney_rpg-audio/Audio/dropLeather.ogg new file mode 100644 index 0000000..83e3cf6 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/dropLeather.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/footstep00.ogg b/pygame/assets/kenney_rpg-audio/Audio/footstep00.ogg new file mode 100644 index 0000000..ca5dd2b Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/footstep00.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/footstep01.ogg b/pygame/assets/kenney_rpg-audio/Audio/footstep01.ogg new file mode 100644 index 0000000..e784dbf Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/footstep01.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/footstep02.ogg b/pygame/assets/kenney_rpg-audio/Audio/footstep02.ogg new file mode 100644 index 0000000..fffa607 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/footstep02.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/footstep03.ogg b/pygame/assets/kenney_rpg-audio/Audio/footstep03.ogg new file mode 100644 index 0000000..32ec626 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/footstep03.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/footstep04.ogg b/pygame/assets/kenney_rpg-audio/Audio/footstep04.ogg new file mode 100644 index 0000000..da3d8ea Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/footstep04.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/footstep05.ogg b/pygame/assets/kenney_rpg-audio/Audio/footstep05.ogg new file mode 100644 index 0000000..ddf5ac6 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/footstep05.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/footstep06.ogg b/pygame/assets/kenney_rpg-audio/Audio/footstep06.ogg new file mode 100644 index 0000000..d4419f4 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/footstep06.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/footstep07.ogg b/pygame/assets/kenney_rpg-audio/Audio/footstep07.ogg new file mode 100644 index 0000000..2b2175e Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/footstep07.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/footstep08.ogg b/pygame/assets/kenney_rpg-audio/Audio/footstep08.ogg new file mode 100644 index 0000000..2b71f97 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/footstep08.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/footstep09.ogg b/pygame/assets/kenney_rpg-audio/Audio/footstep09.ogg new file mode 100644 index 0000000..52c39f5 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/footstep09.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/handleCoins.ogg b/pygame/assets/kenney_rpg-audio/Audio/handleCoins.ogg new file mode 100644 index 0000000..c84e27d Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/handleCoins.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/handleCoins2.ogg b/pygame/assets/kenney_rpg-audio/Audio/handleCoins2.ogg new file mode 100644 index 0000000..73d92c5 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/handleCoins2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/handleSmallLeather.ogg b/pygame/assets/kenney_rpg-audio/Audio/handleSmallLeather.ogg new file mode 100644 index 0000000..d98f77b Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/handleSmallLeather.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/handleSmallLeather2.ogg b/pygame/assets/kenney_rpg-audio/Audio/handleSmallLeather2.ogg new file mode 100644 index 0000000..80aa470 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/handleSmallLeather2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/knifeSlice.ogg b/pygame/assets/kenney_rpg-audio/Audio/knifeSlice.ogg new file mode 100644 index 0000000..8633843 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/knifeSlice.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/knifeSlice2.ogg b/pygame/assets/kenney_rpg-audio/Audio/knifeSlice2.ogg new file mode 100644 index 0000000..cf6098e Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/knifeSlice2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/metalClick.ogg b/pygame/assets/kenney_rpg-audio/Audio/metalClick.ogg new file mode 100644 index 0000000..1a9ee4b Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/metalClick.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/metalLatch.ogg b/pygame/assets/kenney_rpg-audio/Audio/metalLatch.ogg new file mode 100644 index 0000000..509c68f Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/metalLatch.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/metalPot1.ogg b/pygame/assets/kenney_rpg-audio/Audio/metalPot1.ogg new file mode 100644 index 0000000..1c5143d Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/metalPot1.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/metalPot2.ogg b/pygame/assets/kenney_rpg-audio/Audio/metalPot2.ogg new file mode 100644 index 0000000..1be5078 Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/metalPot2.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Audio/metalPot3.ogg b/pygame/assets/kenney_rpg-audio/Audio/metalPot3.ogg new file mode 100644 index 0000000..e97002e Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Audio/metalPot3.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/License.txt b/pygame/assets/kenney_rpg-audio/License.txt new file mode 100644 index 0000000..2f61cec --- /dev/null +++ b/pygame/assets/kenney_rpg-audio/License.txt @@ -0,0 +1,21 @@ + + + RPG Audio + + by Kenney Vleugels (Kenney.nl) + + ------------------------------ + + License (Creative Commons Zero, CC0) + http://creativecommons.org/publicdomain/zero/1.0/ + + You may use these assets in personal and commercial projects. + Credit (Kenney or www.kenney.nl) would be nice but is not mandatory. + + ------------------------------ + + Donate: http://support.kenney.nl + Request: http://request.kenney.nl + + Follow on Twitter for updates: + @KenneyNL \ No newline at end of file diff --git a/pygame/assets/kenney_rpg-audio/Preview.ogg b/pygame/assets/kenney_rpg-audio/Preview.ogg new file mode 100644 index 0000000..b6cd48a Binary files /dev/null and b/pygame/assets/kenney_rpg-audio/Preview.ogg differ diff --git a/pygame/assets/kenney_rpg-audio/Visit Kenney.url b/pygame/assets/kenney_rpg-audio/Visit Kenney.url new file mode 100644 index 0000000..fbdde43 --- /dev/null +++ b/pygame/assets/kenney_rpg-audio/Visit Kenney.url @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=http://www.kenney.nl/ \ No newline at end of file diff --git a/pygame/assets/kenney_rpg-audio/Visit Patreon.url b/pygame/assets/kenney_rpg-audio/Visit Patreon.url new file mode 100644 index 0000000..439ef26 --- /dev/null +++ b/pygame/assets/kenney_rpg-audio/Visit Patreon.url @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=https://www.patreon.com/kenney/ \ No newline at end of file diff --git a/renpy/README.md b/renpy/README.md new file mode 100644 index 0000000..a6bfc8e --- /dev/null +++ b/renpy/README.md @@ -0,0 +1,41 @@ +# Ren'Py: Tvorba Vizuálních Novel + +Vítejte u příkladů pro Ren'Py! Ren'Py je oblíbený nástroj (engine) pro tvorbu vizuálních novel (VN) a her založených na příběhu. Používá jednoduchý skriptovací jazyk založený na Pythonu. + +Tato složka obsahuje tři příklady, které vás provedou od úplných základů až po pokročilejší funkce. + +## Jak začít +1. Stáhněte si Ren'Py z [oficiálních stránek](https://www.renpy.org/). +2. Otevřete Ren'Py Launcher. +3. V nastavení (Preferences) nastavte "Projects Directory" na složku, ve které se nacházíte (`C:\gitprojekty_skola\python_gamejam_examples\renpy`). +4. V levém menu uvidíte projekty `renpy_example_01`, `renpy_example_02` a `renpy_example_03`. +5. Klikněte na projekt a zvolte "Launch Project" (Spustit projekt) pro hraní. Pro úpravu kódu zvolte "script.rpy" v sekci "Edit File". + +--- + +## 📖 Příklad 1: Základy (renpy_example_01) +Tento příklad ukazuje naprosté základy tvorby příběhu. +- **Definice postav:** Jak vytvořit postavu, která mluví určitou barvou. +- **Změna pozadí:** Jak přepínat scény pomocí příkazu `scene`. +- **Dialogy:** Jak nechat postavy mluvit. +- **Přechody (Transitions):** Použití `with fade` (zatmívání) a `with dissolve` (prolínání). + +## 🔀 Příklad 2: Volby a proměnné (renpy_example_02) +Ve hrách je klíčové, aby hráč mohl ovlivňovat děj! +- **Menu:** Tvorba interaktivních voleb (tlačítek). +- **Proměnné:** Jak si hra pamatuje, co hráč udělal (např. `$ ma_mec = True`). +- **Podmínky (if/else):** Jak se příběh větví na základě předchozích rozhodnutí. +- **Skákání (jump):** Přesun mezi různými částmi kódu (labely). + +## 🚀 Příklad 3: Pokročilé funkce (renpy_example_03) +Pro ty, kteří chtějí jít dál a přidat do hry složitější prvky. +- **Obrazovky (Screens):** Vytvoření vlastního uživatelského rozhraní (např. trvalý ukazatel skóre). +- **Animace (ATL):** Pohybování s obrázky, změna jejich velikosti, rotace nebo průhlednosti. +- **Python bloky (`python:`):** Vložení klasického Python kódu pro složitější matematiku, náhodná čísla nebo logiku miniher. + +--- + +### Užitečné tipy pro GameJam +- **Média:** Ren'Py umí přehrávat hudbu (`play music "hudba.ogg"`) i zvuky (`play sound "klik.ogg"`). Média ukládejte do složek `audio/` a `images/` uvnitř složky `game/`. +- **Obrázky:** Stačí vložit obrázek (např. `les.jpg`) do složky `images/` a Ren'Py ho automaticky rozpozná a umožní vám napsat `scene les`. +- **Chyby:** Pokud uděláte v kódu chybu, Ren'Py vám ukáže šedou obrazovku s informacemi o tom, na kterém řádku chyba nastala. Často jde jen o chybějící dvojtečku nebo špatné odsazení! diff --git a/renpy/renpy_example_01/.gitignore b/renpy/renpy_example_01/.gitignore new file mode 100644 index 0000000..21e7266 --- /dev/null +++ b/renpy/renpy_example_01/.gitignore @@ -0,0 +1,26 @@ +# Directories that Ren'Py changes files in. +/game/saves +/game/cache + +# Compiled script files. These are important for saving, and so should +# be preserved by developer and build systems after the game has been released. +/game/**/*.rpyc +/game/**/*.rpymc + +# Files Ren'Py can generate. +/game/**/*.bak +/game/**/*.new +/game/**/*.old + +# Error, log, and output files. +/errors.txt +/files.txt +/image_cache.txt +/log.txt +/save_dump.txt +/traceback.txt + +# Launcher-generated files. +/dialogue.tab +/dialogue.txt +/strings.json diff --git a/renpy/renpy_example_01/game/gui.rpy b/renpy/renpy_example_01/game/gui.rpy new file mode 100644 index 0000000..ec36c02 --- /dev/null +++ b/renpy/renpy_example_01/game/gui.rpy @@ -0,0 +1,480 @@ +################################################################################ +## Initialization +################################################################################ + +## The init offset statement causes the initialization statements in this file +## to run before init statements in any other file. +init offset = -2 + +## Calling gui.init resets the styles to sensible default values, and sets the +## width and height of the game. +init python: + gui.init(1280, 720) + +## Enable checks for invalid or unstable properties in screens or transforms +define config.check_conflicting_properties = True + + +################################################################################ +## GUI Configuration Variables +################################################################################ + + +## Colors ###################################################################### +## +## The colors of text in the interface. + +## An accent color used throughout the interface to label and highlight text. +define gui.accent_color = '#9933ff' + +## The color used for a text button when it is neither selected nor hovered. +define gui.idle_color = '#888888' + +## The small color is used for small text, which needs to be brighter/darker to +## achieve the same effect. +define gui.idle_small_color = '#aaaaaa' + +## The color that is used for buttons and bars that are hovered. +define gui.hover_color = '#c184ff' + +## The color used for a text button when it is selected but not focused. A +## button is selected if it is the current screen or preference value. +define gui.selected_color = '#ffffff' + +## The color used for a text button when it cannot be selected. +define gui.insensitive_color = '#8888887f' + +## Colors used for the portions of bars that are not filled in. These are not +## used directly, but are used when re-generating bar image files. +define gui.muted_color = '#3d1466' +define gui.hover_muted_color = '#5b1e99' + +## The colors used for dialogue and menu choice text. +define gui.text_color = '#ffffff' +define gui.interface_text_color = '#ffffff' + + +## Fonts and Font Sizes ######################################################## + +## The font used for in-game text. +define gui.text_font = "DejaVuSans.ttf" + +## The font used for character names. +define gui.name_text_font = "DejaVuSans.ttf" + +## The font used for out-of-game text. +define gui.interface_text_font = "DejaVuSans.ttf" + +## The size of normal dialogue text. +define gui.text_size = 22 + +## The size of character names. +define gui.name_text_size = 30 + +## The size of text in the game's user interface. +define gui.interface_text_size = 22 + +## The size of labels in the game's user interface. +define gui.label_text_size = 24 + +## The size of text on the notify screen. +define gui.notify_text_size = 16 + +## The size of the game's title. +define gui.title_text_size = 50 + + +## Main and Game Menus ######################################################### + +## The images used for the main and game menus. +define gui.main_menu_background = "gui/main_menu.png" +define gui.game_menu_background = "gui/game_menu.png" + + +## Dialogue #################################################################### +## +## These variables control how dialogue is displayed on the screen one line at a +## time. + +## The height of the textbox containing dialogue. +define gui.textbox_height = 185 + +## The placement of the textbox vertically on the screen. 0.0 is the top, 0.5 is +## center, and 1.0 is the bottom. +define gui.textbox_yalign = 1.0 + + +## The placement of the speaking character's name, relative to the textbox. +## These can be a whole number of pixels from the left or top, or 0.5 to center. +define gui.name_xpos = 240 +define gui.name_ypos = 0 + +## The horizontal alignment of the character's name. This can be 0.0 for left- +## aligned, 0.5 for centered, and 1.0 for right-aligned. +define gui.name_xalign = 0.0 + +## The width, height, and borders of the box containing the character's name, or +## None to automatically size it. +define gui.namebox_width = None +define gui.namebox_height = None + +## The borders of the box containing the character's name, in left, top, right, +## bottom order. +define gui.namebox_borders = Borders(5, 5, 5, 5) + +## If True, the background of the namebox will be tiled, if False, the +## background of the namebox will be scaled. +define gui.namebox_tile = False + + +## The placement of dialogue relative to the textbox. These can be a whole +## number of pixels relative to the left or top side of the textbox, or 0.5 to +## center. +define gui.dialogue_xpos = 268 +define gui.dialogue_ypos = 50 + +## The maximum width of dialogue text, in pixels. +define gui.dialogue_width = 744 + +## The horizontal alignment of the dialogue text. This can be 0.0 for left- +## aligned, 0.5 for centered, and 1.0 for right-aligned. +define gui.dialogue_text_xalign = 0.0 + + +## Buttons ##################################################################### +## +## These variables, along with the image files in gui/button, control aspects of +## how buttons are displayed. + +## The width and height of a button, in pixels. If None, Ren'Py computes a size. +define gui.button_width = None +define gui.button_height = None + +## The borders on each side of the button, in left, top, right, bottom order. +define gui.button_borders = Borders(4, 4, 4, 4) + +## If True, the background image will be tiled. If False, the background image +## will be linearly scaled. +define gui.button_tile = False + +## The font used by the button. +define gui.button_text_font = gui.interface_text_font + +## The size of the text used by the button. +define gui.button_text_size = gui.interface_text_size + +## The color of button text in various states. +define gui.button_text_idle_color = gui.idle_color +define gui.button_text_hover_color = gui.hover_color +define gui.button_text_selected_color = gui.selected_color +define gui.button_text_insensitive_color = gui.insensitive_color + +## The horizontal alignment of the button text. (0.0 is left, 0.5 is center, 1.0 +## is right). +define gui.button_text_xalign = 0.0 + + +## These variables override settings for different kinds of buttons. Please see +## the gui documentation for the kinds of buttons available, and what each is +## used for. +## +## These customizations are used by the default interface: + +define gui.radio_button_borders = Borders(18, 4, 4, 4) + +define gui.check_button_borders = Borders(18, 4, 4, 4) + +define gui.confirm_button_text_xalign = 0.5 + +define gui.page_button_borders = Borders(10, 4, 10, 4) + +define gui.quick_button_borders = Borders(10, 4, 10, 0) +define gui.quick_button_text_size = 14 +define gui.quick_button_text_idle_color = gui.idle_small_color +define gui.quick_button_text_selected_color = gui.accent_color + +## You can also add your own customizations, by adding properly-named variables. +## For example, you can uncomment the following line to set the width of a +## navigation button. + +# define gui.navigation_button_width = 250 + + +## Choice Buttons ############################################################## +## +## Choice buttons are used in the in-game menus. + +define gui.choice_button_width = 790 +define gui.choice_button_height = None +define gui.choice_button_tile = False +define gui.choice_button_borders = Borders(100, 5, 100, 5) +define gui.choice_button_text_font = gui.text_font +define gui.choice_button_text_size = gui.text_size +define gui.choice_button_text_xalign = 0.5 +define gui.choice_button_text_idle_color = '#888888' +define gui.choice_button_text_hover_color = "#ffffff" +define gui.choice_button_text_insensitive_color = '#8888887f' + + +## File Slot Buttons ########################################################### +## +## A file slot button is a special kind of button. It contains a thumbnail +## image, and text describing the contents of the save slot. A save slot uses +## image files in gui/button, like the other kinds of buttons. + +## The save slot button. +define gui.slot_button_width = 276 +define gui.slot_button_height = 206 +define gui.slot_button_borders = Borders(10, 10, 10, 10) +define gui.slot_button_text_size = 14 +define gui.slot_button_text_xalign = 0.5 +define gui.slot_button_text_idle_color = gui.idle_small_color +define gui.slot_button_text_selected_idle_color = gui.selected_color +define gui.slot_button_text_selected_hover_color = gui.hover_color + +## The width and height of thumbnails used by the save slots. +define config.thumbnail_width = 256 +define config.thumbnail_height = 144 + +## The number of columns and rows in the grid of save slots. +define gui.file_slot_cols = 3 +define gui.file_slot_rows = 2 + + +## Positioning and Spacing ##################################################### +## +## These variables control the positioning and spacing of various user interface +## elements. + +## The position of the left side of the navigation buttons, relative to the left +## side of the screen. +define gui.navigation_xpos = 40 + +## The vertical position of the skip indicator. +define gui.skip_ypos = 10 + +## The vertical position of the notify screen. +define gui.notify_ypos = 45 + +## The spacing between menu choices. +define gui.choice_spacing = 22 + +## Buttons in the navigation section of the main and game menus. +define gui.navigation_spacing = 4 + +## Controls the amount of spacing between preferences. +define gui.pref_spacing = 10 + +## Controls the amount of spacing between preference buttons. +define gui.pref_button_spacing = 0 + +## The spacing between file page buttons. +define gui.page_spacing = 0 + +## The spacing between file slots. +define gui.slot_spacing = 10 + +## The position of the main menu text. +define gui.main_menu_text_xalign = 1.0 + + +## Frames ###################################################################### +## +## These variables control the look of frames that can contain user interface +## components when an overlay or window is not present. + +## Generic frames. +define gui.frame_borders = Borders(4, 4, 4, 4) + +## The frame that is used as part of the confirm screen. +define gui.confirm_frame_borders = Borders(40, 40, 40, 40) + +## The frame that is used as part of the skip screen. +define gui.skip_frame_borders = Borders(16, 5, 50, 5) + +## The frame that is used as part of the notify screen. +define gui.notify_frame_borders = Borders(16, 5, 40, 5) + +## Should frame backgrounds be tiled? +define gui.frame_tile = False + + +## Bars, Scrollbars, and Sliders ############################################### +## +## These control the look and size of bars, scrollbars, and sliders. +## +## The default GUI only uses sliders and vertical scrollbars. All of the other +## bars are only used in creator-written screens. + +## The height of horizontal bars, scrollbars, and sliders. The width of vertical +## bars, scrollbars, and sliders. +define gui.bar_size = 25 +define gui.scrollbar_size = 12 +define gui.slider_size = 25 + +## True if bar images should be tiled. False if they should be linearly scaled. +define gui.bar_tile = False +define gui.scrollbar_tile = False +define gui.slider_tile = False + +## Horizontal borders. +define gui.bar_borders = Borders(4, 4, 4, 4) +define gui.scrollbar_borders = Borders(4, 4, 4, 4) +define gui.slider_borders = Borders(4, 4, 4, 4) + +## Vertical borders. +define gui.vbar_borders = Borders(4, 4, 4, 4) +define gui.vscrollbar_borders = Borders(4, 4, 4, 4) +define gui.vslider_borders = Borders(4, 4, 4, 4) + +## What to do with unscrollable scrollbars in the game menu. "hide" hides them, +## while None shows them. +define gui.unscrollable = "hide" + + +## History ##################################################################### +## +## The history screen displays dialogue that the player has already dismissed. + +## The number of blocks of dialogue history Ren'Py will keep. +define config.history_length = 250 + +## The height of a history screen entry, or None to make the height variable at +## the cost of performance. +define gui.history_height = 140 + +## Additional space to add between history screen entries. +define gui.history_spacing = 0 + +## The position, width, and alignment of the label giving the name of the +## speaking character. +define gui.history_name_xpos = 155 +define gui.history_name_ypos = 0 +define gui.history_name_width = 155 +define gui.history_name_xalign = 1.0 + +## The position, width, and alignment of the dialogue text. +define gui.history_text_xpos = 170 +define gui.history_text_ypos = 2 +define gui.history_text_width = 740 +define gui.history_text_xalign = 0.0 + + +## NVL-Mode #################################################################### +## +## The NVL-mode screen displays the dialogue spoken by NVL-mode characters. + +## The borders of the background of the NVL-mode background window. +define gui.nvl_borders = Borders(0, 10, 0, 20) + +## The maximum number of NVL-mode entries Ren'Py will display. When more entries +## than this are to be show, the oldest entry will be removed. +define gui.nvl_list_length = 6 + +## The height of an NVL-mode entry. Set this to None to have the entries +## dynamically adjust height. +define gui.nvl_height = 115 + +## The spacing between NVL-mode entries when gui.nvl_height is None, and between +## NVL-mode entries and an NVL-mode menu. +define gui.nvl_spacing = 10 + +## The position, width, and alignment of the label giving the name of the +## speaking character. +define gui.nvl_name_xpos = 430 +define gui.nvl_name_ypos = 0 +define gui.nvl_name_width = 150 +define gui.nvl_name_xalign = 1.0 + +## The position, width, and alignment of the dialogue text. +define gui.nvl_text_xpos = 450 +define gui.nvl_text_ypos = 8 +define gui.nvl_text_width = 590 +define gui.nvl_text_xalign = 0.0 + +## The position, width, and alignment of nvl_thought text (the text said by the +## nvl_narrator character.) +define gui.nvl_thought_xpos = 240 +define gui.nvl_thought_ypos = 0 +define gui.nvl_thought_width = 780 +define gui.nvl_thought_xalign = 0.0 + +## The position of nvl menu_buttons. +define gui.nvl_button_xpos = 450 +define gui.nvl_button_xalign = 0.0 + + +## Localization ################################################################ + +## This controls where a line break is permitted. The default is suitable +## for most languages. A list of available values can be found at https:// +## www.renpy.org/doc/html/style_properties.html#style-property-language + +define gui.language = "unicode" + + +################################################################################ +## Mobile devices +################################################################################ + +init python: + + ## This increases the size of the quick buttons to make them easier to touch + ## on tablets and phones. + @gui.variant + def touch(): + + gui.quick_button_borders = Borders(40, 14, 40, 0) + + ## This changes the size and spacing of various GUI elements to ensure they + ## are easily visible on phones. + @gui.variant + def small(): + + ## Font sizes. + gui.text_size = 30 + gui.name_text_size = 36 + gui.notify_text_size = 25 + gui.interface_text_size = 30 + gui.button_text_size = 30 + gui.label_text_size = 34 + + ## Adjust the location of the textbox. + gui.textbox_height = 240 + gui.name_xpos = 80 + gui.dialogue_xpos = 90 + gui.dialogue_width = 1100 + + ## Change the size and spacing of various things. + gui.slider_size = 36 + + gui.choice_button_width = 1240 + gui.choice_button_text_size = 30 + + gui.navigation_spacing = 20 + gui.pref_button_spacing = 10 + + gui.history_height = 190 + gui.history_text_width = 690 + + gui.quick_button_text_size = 20 + + ## File button layout. + gui.file_slot_cols = 2 + gui.file_slot_rows = 2 + + ## NVL-mode. + gui.nvl_height = 170 + + gui.nvl_name_width = 305 + gui.nvl_name_xpos = 325 + + gui.nvl_text_width = 915 + gui.nvl_text_xpos = 345 + gui.nvl_text_ypos = 5 + + gui.nvl_thought_width = 1240 + gui.nvl_thought_xpos = 20 + + gui.nvl_button_width = 1240 + gui.nvl_button_xpos = 20 diff --git a/renpy/renpy_example_01/game/gui/bar/bottom.png b/renpy/renpy_example_01/game/gui/bar/bottom.png new file mode 100644 index 0000000..65d9c52 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/bar/bottom.png differ diff --git a/renpy/renpy_example_01/game/gui/bar/left.png b/renpy/renpy_example_01/game/gui/bar/left.png new file mode 100644 index 0000000..8c9d039 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/bar/left.png differ diff --git a/renpy/renpy_example_01/game/gui/bar/right.png b/renpy/renpy_example_01/game/gui/bar/right.png new file mode 100644 index 0000000..ff49440 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/bar/right.png differ diff --git a/renpy/renpy_example_01/game/gui/bar/top.png b/renpy/renpy_example_01/game/gui/bar/top.png new file mode 100644 index 0000000..882d7ca Binary files /dev/null and b/renpy/renpy_example_01/game/gui/bar/top.png differ diff --git a/renpy/renpy_example_01/game/gui/bubble.png b/renpy/renpy_example_01/game/gui/bubble.png new file mode 100644 index 0000000..3b23ff3 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/bubble.png differ diff --git a/renpy/renpy_example_01/game/gui/button/check_foreground.png b/renpy/renpy_example_01/game/gui/button/check_foreground.png new file mode 100644 index 0000000..9ba7a3b Binary files /dev/null and b/renpy/renpy_example_01/game/gui/button/check_foreground.png differ diff --git a/renpy/renpy_example_01/game/gui/button/check_selected_foreground.png b/renpy/renpy_example_01/game/gui/button/check_selected_foreground.png new file mode 100644 index 0000000..985d43b Binary files /dev/null and b/renpy/renpy_example_01/game/gui/button/check_selected_foreground.png differ diff --git a/renpy/renpy_example_01/game/gui/button/choice_hover_background.png b/renpy/renpy_example_01/game/gui/button/choice_hover_background.png new file mode 100644 index 0000000..b9d2757 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/button/choice_hover_background.png differ diff --git a/renpy/renpy_example_01/game/gui/button/choice_idle_background.png b/renpy/renpy_example_01/game/gui/button/choice_idle_background.png new file mode 100644 index 0000000..632758a Binary files /dev/null and b/renpy/renpy_example_01/game/gui/button/choice_idle_background.png differ diff --git a/renpy/renpy_example_01/game/gui/button/hover_background.png b/renpy/renpy_example_01/game/gui/button/hover_background.png new file mode 100644 index 0000000..390198c Binary files /dev/null and b/renpy/renpy_example_01/game/gui/button/hover_background.png differ diff --git a/renpy/renpy_example_01/game/gui/button/idle_background.png b/renpy/renpy_example_01/game/gui/button/idle_background.png new file mode 100644 index 0000000..390198c Binary files /dev/null and b/renpy/renpy_example_01/game/gui/button/idle_background.png differ diff --git a/renpy/renpy_example_01/game/gui/button/quick_hover_background.png b/renpy/renpy_example_01/game/gui/button/quick_hover_background.png new file mode 100644 index 0000000..e98b76b Binary files /dev/null and b/renpy/renpy_example_01/game/gui/button/quick_hover_background.png differ diff --git a/renpy/renpy_example_01/game/gui/button/quick_idle_background.png b/renpy/renpy_example_01/game/gui/button/quick_idle_background.png new file mode 100644 index 0000000..e98b76b Binary files /dev/null and b/renpy/renpy_example_01/game/gui/button/quick_idle_background.png differ diff --git a/renpy/renpy_example_01/game/gui/button/radio_foreground.png b/renpy/renpy_example_01/game/gui/button/radio_foreground.png new file mode 100644 index 0000000..9ba7a3b Binary files /dev/null and b/renpy/renpy_example_01/game/gui/button/radio_foreground.png differ diff --git a/renpy/renpy_example_01/game/gui/button/radio_selected_foreground.png b/renpy/renpy_example_01/game/gui/button/radio_selected_foreground.png new file mode 100644 index 0000000..985d43b Binary files /dev/null and b/renpy/renpy_example_01/game/gui/button/radio_selected_foreground.png differ diff --git a/renpy/renpy_example_01/game/gui/button/slot_hover_background.png b/renpy/renpy_example_01/game/gui/button/slot_hover_background.png new file mode 100644 index 0000000..c839458 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/button/slot_hover_background.png differ diff --git a/renpy/renpy_example_01/game/gui/button/slot_idle_background.png b/renpy/renpy_example_01/game/gui/button/slot_idle_background.png new file mode 100644 index 0000000..abd75b1 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/button/slot_idle_background.png differ diff --git a/renpy/renpy_example_01/game/gui/frame.png b/renpy/renpy_example_01/game/gui/frame.png new file mode 100644 index 0000000..71fe8d8 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/frame.png differ diff --git a/renpy/renpy_example_01/game/gui/game_menu.png b/renpy/renpy_example_01/game/gui/game_menu.png new file mode 100644 index 0000000..6d6600e Binary files /dev/null and b/renpy/renpy_example_01/game/gui/game_menu.png differ diff --git a/renpy/renpy_example_01/game/gui/main_menu.png b/renpy/renpy_example_01/game/gui/main_menu.png new file mode 100644 index 0000000..6d6600e Binary files /dev/null and b/renpy/renpy_example_01/game/gui/main_menu.png differ diff --git a/renpy/renpy_example_01/game/gui/namebox.png b/renpy/renpy_example_01/game/gui/namebox.png new file mode 100644 index 0000000..98a69ec Binary files /dev/null and b/renpy/renpy_example_01/game/gui/namebox.png differ diff --git a/renpy/renpy_example_01/game/gui/notify.png b/renpy/renpy_example_01/game/gui/notify.png new file mode 100644 index 0000000..afdd0e3 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/notify.png differ diff --git a/renpy/renpy_example_01/game/gui/nvl.png b/renpy/renpy_example_01/game/gui/nvl.png new file mode 100644 index 0000000..9bbe5d4 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/nvl.png differ diff --git a/renpy/renpy_example_01/game/gui/overlay/confirm.png b/renpy/renpy_example_01/game/gui/overlay/confirm.png new file mode 100644 index 0000000..5ab43e8 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/overlay/confirm.png differ diff --git a/renpy/renpy_example_01/game/gui/overlay/game_menu.png b/renpy/renpy_example_01/game/gui/overlay/game_menu.png new file mode 100644 index 0000000..3ac2175 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/overlay/game_menu.png differ diff --git a/renpy/renpy_example_01/game/gui/overlay/main_menu.png b/renpy/renpy_example_01/game/gui/overlay/main_menu.png new file mode 100644 index 0000000..75f8356 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/overlay/main_menu.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/bar/bottom.png b/renpy/renpy_example_01/game/gui/phone/bar/bottom.png new file mode 100644 index 0000000..65d9c52 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/bar/bottom.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/bar/left.png b/renpy/renpy_example_01/game/gui/phone/bar/left.png new file mode 100644 index 0000000..8c9d039 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/bar/left.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/bar/right.png b/renpy/renpy_example_01/game/gui/phone/bar/right.png new file mode 100644 index 0000000..ff49440 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/bar/right.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/bar/top.png b/renpy/renpy_example_01/game/gui/phone/bar/top.png new file mode 100644 index 0000000..882d7ca Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/bar/top.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/button/check_foreground.png b/renpy/renpy_example_01/game/gui/phone/button/check_foreground.png new file mode 100644 index 0000000..6ae65b6 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/button/check_foreground.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/button/check_selected_foreground.png b/renpy/renpy_example_01/game/gui/phone/button/check_selected_foreground.png new file mode 100644 index 0000000..747f2f7 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/button/check_selected_foreground.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/button/choice_hover_background.png b/renpy/renpy_example_01/game/gui/phone/button/choice_hover_background.png new file mode 100644 index 0000000..b9d2757 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/button/choice_hover_background.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/button/choice_idle_background.png b/renpy/renpy_example_01/game/gui/phone/button/choice_idle_background.png new file mode 100644 index 0000000..632758a Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/button/choice_idle_background.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/button/hover_background.png b/renpy/renpy_example_01/game/gui/phone/button/hover_background.png new file mode 100644 index 0000000..900c145 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/button/hover_background.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/button/idle_background.png b/renpy/renpy_example_01/game/gui/phone/button/idle_background.png new file mode 100644 index 0000000..900c145 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/button/idle_background.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/button/radio_foreground.png b/renpy/renpy_example_01/game/gui/phone/button/radio_foreground.png new file mode 100644 index 0000000..6ae65b6 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/button/radio_foreground.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/button/radio_selected_foreground.png b/renpy/renpy_example_01/game/gui/phone/button/radio_selected_foreground.png new file mode 100644 index 0000000..747f2f7 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/button/radio_selected_foreground.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/button/slot_hover_background.png b/renpy/renpy_example_01/game/gui/phone/button/slot_hover_background.png new file mode 100644 index 0000000..c839458 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/button/slot_hover_background.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/button/slot_idle_background.png b/renpy/renpy_example_01/game/gui/phone/button/slot_idle_background.png new file mode 100644 index 0000000..abd75b1 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/button/slot_idle_background.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/nvl.png b/renpy/renpy_example_01/game/gui/phone/nvl.png new file mode 100644 index 0000000..f6d4289 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/nvl.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/overlay/game_menu.png b/renpy/renpy_example_01/game/gui/phone/overlay/game_menu.png new file mode 100644 index 0000000..7035958 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/overlay/game_menu.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/overlay/main_menu.png b/renpy/renpy_example_01/game/gui/phone/overlay/main_menu.png new file mode 100644 index 0000000..d0897ce Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/overlay/main_menu.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/scrollbar/horizontal_hover_bar.png b/renpy/renpy_example_01/game/gui/phone/scrollbar/horizontal_hover_bar.png new file mode 100644 index 0000000..ba015f7 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/scrollbar/horizontal_hover_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/scrollbar/horizontal_hover_thumb.png b/renpy/renpy_example_01/game/gui/phone/scrollbar/horizontal_hover_thumb.png new file mode 100644 index 0000000..bd07c31 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/scrollbar/horizontal_hover_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/scrollbar/horizontal_idle_bar.png b/renpy/renpy_example_01/game/gui/phone/scrollbar/horizontal_idle_bar.png new file mode 100644 index 0000000..b57f8e6 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/scrollbar/horizontal_idle_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/scrollbar/horizontal_idle_thumb.png b/renpy/renpy_example_01/game/gui/phone/scrollbar/horizontal_idle_thumb.png new file mode 100644 index 0000000..7b72065 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/scrollbar/horizontal_idle_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/scrollbar/vertical_hover_bar.png b/renpy/renpy_example_01/game/gui/phone/scrollbar/vertical_hover_bar.png new file mode 100644 index 0000000..e380c6b Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/scrollbar/vertical_hover_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/scrollbar/vertical_hover_thumb.png b/renpy/renpy_example_01/game/gui/phone/scrollbar/vertical_hover_thumb.png new file mode 100644 index 0000000..424bf69 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/scrollbar/vertical_hover_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/scrollbar/vertical_idle_bar.png b/renpy/renpy_example_01/game/gui/phone/scrollbar/vertical_idle_bar.png new file mode 100644 index 0000000..1c63a5e Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/scrollbar/vertical_idle_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/scrollbar/vertical_idle_thumb.png b/renpy/renpy_example_01/game/gui/phone/scrollbar/vertical_idle_thumb.png new file mode 100644 index 0000000..7c52860 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/scrollbar/vertical_idle_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/slider/horizontal_hover_bar.png b/renpy/renpy_example_01/game/gui/phone/slider/horizontal_hover_bar.png new file mode 100644 index 0000000..91a403d Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/slider/horizontal_hover_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/slider/horizontal_hover_thumb.png b/renpy/renpy_example_01/game/gui/phone/slider/horizontal_hover_thumb.png new file mode 100644 index 0000000..8eda1fe Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/slider/horizontal_hover_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/slider/horizontal_idle_bar.png b/renpy/renpy_example_01/game/gui/phone/slider/horizontal_idle_bar.png new file mode 100644 index 0000000..b705b60 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/slider/horizontal_idle_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/slider/horizontal_idle_thumb.png b/renpy/renpy_example_01/game/gui/phone/slider/horizontal_idle_thumb.png new file mode 100644 index 0000000..fee479a Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/slider/horizontal_idle_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/slider/vertical_hover_bar.png b/renpy/renpy_example_01/game/gui/phone/slider/vertical_hover_bar.png new file mode 100644 index 0000000..32b9a47 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/slider/vertical_hover_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/slider/vertical_hover_thumb.png b/renpy/renpy_example_01/game/gui/phone/slider/vertical_hover_thumb.png new file mode 100644 index 0000000..8296db4 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/slider/vertical_hover_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/slider/vertical_idle_bar.png b/renpy/renpy_example_01/game/gui/phone/slider/vertical_idle_bar.png new file mode 100644 index 0000000..555e79f Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/slider/vertical_idle_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/slider/vertical_idle_thumb.png b/renpy/renpy_example_01/game/gui/phone/slider/vertical_idle_thumb.png new file mode 100644 index 0000000..b7dc2b8 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/slider/vertical_idle_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/phone/textbox.png b/renpy/renpy_example_01/game/gui/phone/textbox.png new file mode 100644 index 0000000..ed7b0a6 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/phone/textbox.png differ diff --git a/renpy/renpy_example_01/game/gui/scrollbar/horizontal_hover_bar.png b/renpy/renpy_example_01/game/gui/scrollbar/horizontal_hover_bar.png new file mode 100644 index 0000000..ba015f7 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/scrollbar/horizontal_hover_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/scrollbar/horizontal_hover_thumb.png b/renpy/renpy_example_01/game/gui/scrollbar/horizontal_hover_thumb.png new file mode 100644 index 0000000..bd07c31 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/scrollbar/horizontal_hover_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/scrollbar/horizontal_idle_bar.png b/renpy/renpy_example_01/game/gui/scrollbar/horizontal_idle_bar.png new file mode 100644 index 0000000..b57f8e6 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/scrollbar/horizontal_idle_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/scrollbar/horizontal_idle_thumb.png b/renpy/renpy_example_01/game/gui/scrollbar/horizontal_idle_thumb.png new file mode 100644 index 0000000..7b72065 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/scrollbar/horizontal_idle_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/scrollbar/vertical_hover_bar.png b/renpy/renpy_example_01/game/gui/scrollbar/vertical_hover_bar.png new file mode 100644 index 0000000..e380c6b Binary files /dev/null and b/renpy/renpy_example_01/game/gui/scrollbar/vertical_hover_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/scrollbar/vertical_hover_thumb.png b/renpy/renpy_example_01/game/gui/scrollbar/vertical_hover_thumb.png new file mode 100644 index 0000000..424bf69 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/scrollbar/vertical_hover_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/scrollbar/vertical_idle_bar.png b/renpy/renpy_example_01/game/gui/scrollbar/vertical_idle_bar.png new file mode 100644 index 0000000..1c63a5e Binary files /dev/null and b/renpy/renpy_example_01/game/gui/scrollbar/vertical_idle_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/scrollbar/vertical_idle_thumb.png b/renpy/renpy_example_01/game/gui/scrollbar/vertical_idle_thumb.png new file mode 100644 index 0000000..7c52860 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/scrollbar/vertical_idle_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/skip.png b/renpy/renpy_example_01/game/gui/skip.png new file mode 100644 index 0000000..734b21e Binary files /dev/null and b/renpy/renpy_example_01/game/gui/skip.png differ diff --git a/renpy/renpy_example_01/game/gui/slider/horizontal_hover_bar.png b/renpy/renpy_example_01/game/gui/slider/horizontal_hover_bar.png new file mode 100644 index 0000000..eabacf7 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/slider/horizontal_hover_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/slider/horizontal_hover_thumb.png b/renpy/renpy_example_01/game/gui/slider/horizontal_hover_thumb.png new file mode 100644 index 0000000..a3492d8 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/slider/horizontal_hover_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/slider/horizontal_idle_bar.png b/renpy/renpy_example_01/game/gui/slider/horizontal_idle_bar.png new file mode 100644 index 0000000..ff49440 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/slider/horizontal_idle_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/slider/horizontal_idle_thumb.png b/renpy/renpy_example_01/game/gui/slider/horizontal_idle_thumb.png new file mode 100644 index 0000000..e5726a8 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/slider/horizontal_idle_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/slider/vertical_hover_bar.png b/renpy/renpy_example_01/game/gui/slider/vertical_hover_bar.png new file mode 100644 index 0000000..5760449 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/slider/vertical_hover_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/slider/vertical_hover_thumb.png b/renpy/renpy_example_01/game/gui/slider/vertical_hover_thumb.png new file mode 100644 index 0000000..5615af8 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/slider/vertical_hover_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/slider/vertical_idle_bar.png b/renpy/renpy_example_01/game/gui/slider/vertical_idle_bar.png new file mode 100644 index 0000000..882d7ca Binary files /dev/null and b/renpy/renpy_example_01/game/gui/slider/vertical_idle_bar.png differ diff --git a/renpy/renpy_example_01/game/gui/slider/vertical_idle_thumb.png b/renpy/renpy_example_01/game/gui/slider/vertical_idle_thumb.png new file mode 100644 index 0000000..02cdb5f Binary files /dev/null and b/renpy/renpy_example_01/game/gui/slider/vertical_idle_thumb.png differ diff --git a/renpy/renpy_example_01/game/gui/textbox.png b/renpy/renpy_example_01/game/gui/textbox.png new file mode 100644 index 0000000..618bcb8 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/textbox.png differ diff --git a/renpy/renpy_example_01/game/gui/thoughtbubble.png b/renpy/renpy_example_01/game/gui/thoughtbubble.png new file mode 100644 index 0000000..8d5d44b Binary files /dev/null and b/renpy/renpy_example_01/game/gui/thoughtbubble.png differ diff --git a/renpy/renpy_example_01/game/gui/window_icon.png b/renpy/renpy_example_01/game/gui/window_icon.png new file mode 100644 index 0000000..ff62e68 Binary files /dev/null and b/renpy/renpy_example_01/game/gui/window_icon.png differ diff --git a/renpy/renpy_example_01/game/images/bg_mapa.png b/renpy/renpy_example_01/game/images/bg_mapa.png new file mode 100644 index 0000000..ab92f01 Binary files /dev/null and b/renpy/renpy_example_01/game/images/bg_mapa.png differ diff --git a/renpy/renpy_example_01/game/images/boss.png b/renpy/renpy_example_01/game/images/boss.png new file mode 100644 index 0000000..951c21e Binary files /dev/null and b/renpy/renpy_example_01/game/images/boss.png differ diff --git a/renpy/renpy_example_01/game/libs/libs.txt b/renpy/renpy_example_01/game/libs/libs.txt new file mode 100644 index 0000000..12acf12 --- /dev/null +++ b/renpy/renpy_example_01/game/libs/libs.txt @@ -0,0 +1,6 @@ +The game/libs/ directory is meant for third-party libraries that ask to be +put in game/libs. + +When this file (game/libs/libs.txt) is present, Ren'Py will load all files +in libs before any other file in game/, and will ignore the first directory +name under game/libs when determining the order to load files. diff --git a/renpy/renpy_example_01/game/options.rpy b/renpy/renpy_example_01/game/options.rpy new file mode 100644 index 0000000..9dc35da --- /dev/null +++ b/renpy/renpy_example_01/game/options.rpy @@ -0,0 +1,209 @@ +## This file contains options that can be changed to customize your game. +## +## Lines beginning with two '#' marks are comments, and you shouldn't uncomment +## them. Lines beginning with a single '#' mark are commented-out code, and you +## may want to uncomment them when appropriate. + + +## Basics ###################################################################### + +## A human-readable name of the game. This is used to set the default window +## title, and shows up in the interface and error reports. +## +## The _() surrounding the string marks it as eligible for translation. + +define config.name = _("renpy_example_01") + + +## Determines if the title given above is shown on the main menu screen. Set +## this to False to hide the title. + +define gui.show_name = True + + +## The version of the game. + +define config.version = "1.0" + + +## Text that is placed on the game's about screen. Place the text between the +## triple-quotes, and leave a blank line between paragraphs. + +define gui.about = _p(""" +""") + + +## A short name for the game used for executables and directories in the built +## distribution. This must be ASCII-only, and must not contain spaces, colons, +## or semicolons. + +define build.name = "renpy_example_01" + + +## Sounds and music ############################################################ + +## These three variables control, among other things, which mixers are shown +## to the player by default. Setting one of these to False will hide the +## appropriate mixer. + +define config.has_sound = True +define config.has_music = True +define config.has_voice = True + + +## To allow the user to play a test sound on the sound or voice channel, +## uncomment a line below and use it to set a sample sound to play. + +# define config.sample_sound = "sample-sound.ogg" +# define config.sample_voice = "sample-voice.ogg" + + +## Uncomment the following line to set an audio file that will be played while +## the player is at the main menu. This file will continue playing into the +## game, until it is stopped or another file is played. + +# define config.main_menu_music = "main-menu-theme.ogg" + + +## Transitions ################################################################# +## +## These variables set transitions that are used when certain events occur. +## Each variable should be set to a transition, or None to indicate that no +## transition should be used. + +## Entering or exiting the game menu. + +define config.enter_transition = dissolve +define config.exit_transition = dissolve + + +## Between screens of the game menu. + +define config.intra_transition = dissolve + + +## A transition that is used after a game has been loaded. + +define config.after_load_transition = None + + +## Used when entering the main menu after the game has ended. + +define config.end_game_transition = None + + +## A variable to set the transition used when the game starts does not exist. +## Instead, use a with statement after showing the initial scene. + + +## Window management ########################################################### +## +## This controls when the dialogue window is displayed. If "show", it is always +## displayed. If "hide", it is only displayed when dialogue is present. If +## "auto", the window is hidden before scene statements and shown again once +## dialogue is displayed. +## +## After the game has started, this can be changed with the "window show", +## "window hide", and "window auto" statements. + +define config.window = "auto" + + +## Transitions used to show and hide the dialogue window + +define config.window_show_transition = Dissolve(.2) +define config.window_hide_transition = Dissolve(.2) + + +## Preference defaults ######################################################### + +## Controls the default text speed. The default, 0, is infinite, while any other +## number is the number of characters per second to type out. + +default preferences.text_cps = 0 + + +## The default auto-forward delay. Larger numbers lead to longer waits, with 0 +## to 30 being the valid range. + +default preferences.afm_time = 15 + + +## Save directory ############################################################## +## +## Controls the platform-specific place Ren'Py will place the save files for +## this game. The save files will be placed in: +## +## Windows: %APPDATA\RenPy\ +## +## Macintosh: $HOME/Library/RenPy/ +## +## Linux: $HOME/.renpy/ +## +## This generally should not be changed, and if it is, should always be a +## literal string, not an expression. + +define config.save_directory = "renpy_example_01-1780314358" + + +## Icon ######################################################################## +## +## The icon displayed on the taskbar or dock. + +define config.window_icon = "gui/window_icon.png" + + +## Build configuration ######################################################### +## +## This section controls how Ren'Py turns your project into distribution files. + +init python: + + ## The following functions take file patterns. File patterns are case- + ## insensitive, and matched against the path relative to the base directory, + ## with and without a leading /. If multiple patterns match, the first is + ## used. + ## + ## In a pattern: + ## + ## / is the directory separator. + ## + ## * matches all characters, except the directory separator. + ## + ## ** matches all characters, including the directory separator. + ## + ## For example, "*.txt" matches txt files in the base directory, "game/ + ## **.ogg" matches ogg files in the game directory or any of its + ## subdirectories, and "**.psd" matches psd files anywhere in the project. + + ## Classify files as None to exclude them from the built distributions. + + build.classify('**~', None) + build.classify('**.bak', None) + build.classify('**/.**', None) + build.classify('**/#**', None) + build.classify('**/thumbs.db', None) + + ## To archive files, classify them as 'archive'. + + # build.classify('game/**.png', 'archive') + # build.classify('game/**.jpg', 'archive') + + ## Files matching documentation patterns are duplicated in a mac app build, + ## so they appear in both the app and the zip file. + + build.documentation('*.html') + build.documentation('*.txt') + + +## A Google Play license key is required to perform in-app purchases. It can be +## found in the Google Play developer console, under "Monetize" > "Monetization +## Setup" > "Licensing". + +# define build.google_play_key = "..." + + +## The username and project name associated with an itch.io project, separated +## by a slash. + +# define build.itch_project = "renpytom/test-project" diff --git a/renpy/renpy_example_01/game/screens.rpy b/renpy/renpy_example_01/game/screens.rpy new file mode 100644 index 0000000..85cfb9f --- /dev/null +++ b/renpy/renpy_example_01/game/screens.rpy @@ -0,0 +1,1621 @@ +################################################################################ +## Initialization +################################################################################ + +init offset = -1 + + +################################################################################ +## Styles +################################################################################ + +style default: + properties gui.text_properties() + language gui.language + +style input: + properties gui.text_properties("input", accent=True) + adjust_spacing False + +style hyperlink_text: + properties gui.text_properties("hyperlink", accent=True) + hover_underline True + +style gui_text: + properties gui.text_properties("interface") + + +style button: + properties gui.button_properties("button") + +style button_text is gui_text: + properties gui.text_properties("button") + yalign 0.5 + + +style label_text is gui_text: + properties gui.text_properties("label", accent=True) + +style prompt_text is gui_text: + properties gui.text_properties("prompt") + + +style bar: + ysize gui.bar_size + left_bar Frame("gui/bar/left.png", gui.bar_borders, tile=gui.bar_tile) + right_bar Frame("gui/bar/right.png", gui.bar_borders, tile=gui.bar_tile) + +style vbar: + xsize gui.bar_size + top_bar Frame("gui/bar/top.png", gui.vbar_borders, tile=gui.bar_tile) + bottom_bar Frame("gui/bar/bottom.png", gui.vbar_borders, tile=gui.bar_tile) + +style scrollbar: + ysize gui.scrollbar_size + base_bar Frame("gui/scrollbar/horizontal_[prefix_]bar.png", gui.scrollbar_borders, tile=gui.scrollbar_tile) + thumb Frame("gui/scrollbar/horizontal_[prefix_]thumb.png", gui.scrollbar_borders, tile=gui.scrollbar_tile) + +style vscrollbar: + xsize gui.scrollbar_size + base_bar Frame("gui/scrollbar/vertical_[prefix_]bar.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile) + thumb Frame("gui/scrollbar/vertical_[prefix_]thumb.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile) + +style slider: + ysize gui.slider_size + base_bar Frame("gui/slider/horizontal_[prefix_]bar.png", gui.slider_borders, tile=gui.slider_tile) + thumb "gui/slider/horizontal_[prefix_]thumb.png" + +style vslider: + xsize gui.slider_size + base_bar Frame("gui/slider/vertical_[prefix_]bar.png", gui.vslider_borders, tile=gui.slider_tile) + thumb "gui/slider/vertical_[prefix_]thumb.png" + + +style frame: + padding gui.frame_borders.padding + background Frame("gui/frame.png", gui.frame_borders, tile=gui.frame_tile) + + + +################################################################################ +## In-game screens +################################################################################ + + +## Say screen ################################################################## +## +## The say screen is used to display dialogue to the player. It takes two +## parameters, who and what, which are the name of the speaking character and +## the text to be displayed, respectively. (The who parameter can be None if no +## name is given.) +## +## This screen must create a text displayable with id "what", as Ren'Py uses +## this to manage text display. It can also create displayables with id "who" +## and id "window" to apply style properties. +## +## https://www.renpy.org/doc/html/screen_special.html#say + +screen say(who, what): + + window: + id "window" + + if who is not None: + + window: + id "namebox" + style "namebox" + text who id "who" + + text what id "what" + + + ## If there's a side image, display it above the text. Do not display on the + ## phone variant - there's no room. + if not renpy.variant("small"): + add SideImage() xalign 0.0 yalign 1.0 + + +## Make the namebox available for styling through the Character object. +init python: + config.character_id_prefixes.append('namebox') + +style window is default +style say_label is default +style say_dialogue is default +style say_thought is say_dialogue + +style namebox is default +style namebox_label is say_label + + +style window: + xalign 0.5 + xfill True + yalign gui.textbox_yalign + ysize gui.textbox_height + + background Image("gui/textbox.png", xalign=0.5, yalign=1.0) + +style namebox: + xpos gui.name_xpos + xanchor gui.name_xalign + xsize gui.namebox_width + ypos gui.name_ypos + ysize gui.namebox_height + + background Frame("gui/namebox.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign) + padding gui.namebox_borders.padding + +style say_label: + properties gui.text_properties("name", accent=True) + xalign gui.name_xalign + yalign 0.5 + +style say_dialogue: + properties gui.text_properties("dialogue") + + xpos gui.dialogue_xpos + xsize gui.dialogue_width + ypos gui.dialogue_ypos + + adjust_spacing False + +## Input screen ################################################################ +## +## This screen is used to display renpy.input. The prompt parameter is used to +## pass a text prompt in. +## +## This screen must create an input displayable with id "input" to accept the +## various input parameters. +## +## https://www.renpy.org/doc/html/screen_special.html#input + +screen input(prompt): + style_prefix "input" + + window: + + vbox: + xanchor gui.dialogue_text_xalign + xpos gui.dialogue_xpos + xsize gui.dialogue_width + ypos gui.dialogue_ypos + + text prompt style "input_prompt" + input id "input" + +style input_prompt is default + +style input_prompt: + xalign gui.dialogue_text_xalign + properties gui.text_properties("input_prompt") + +style input: + xalign gui.dialogue_text_xalign + xmaximum gui.dialogue_width + + +## Choice screen ############################################################### +## +## This screen is used to display the in-game choices presented by the menu +## statement. The one parameter, items, is a list of objects, each with caption +## and action fields. +## +## https://www.renpy.org/doc/html/screen_special.html#choice + +screen choice(items): + style_prefix "choice" + + vbox: + for i in items: + textbutton i.caption action i.action + + +style choice_vbox is vbox +style choice_button is button +style choice_button_text is button_text + +style choice_vbox: + xalign 0.5 + ypos 270 + yanchor 0.5 + + spacing gui.choice_spacing + +style choice_button is default: + properties gui.button_properties("choice_button") + +style choice_button_text is default: + properties gui.text_properties("choice_button") + + +## Quick Menu screen ########################################################### +## +## The quick menu is displayed in-game to provide easy access to the out-of-game +## menus. + +screen quick_menu(): + + ## Ensure this appears on top of other screens. + zorder 100 + + if quick_menu: + + hbox: + style_prefix "quick" + style "quick_menu" + + textbutton _("Back") action Rollback() + textbutton _("History") action ShowMenu('history') + textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True) + textbutton _("Auto") action Preference("auto-forward", "toggle") + textbutton _("Save") action ShowMenu('save') + textbutton _("Q.Save") action QuickSave() + textbutton _("Q.Load") action QuickLoad() + textbutton _("Prefs") action ShowMenu('preferences') + + +## This code ensures that the quick_menu screen is displayed in-game, whenever +## the player has not explicitly hidden the interface. +init python: + config.overlay_screens.append("quick_menu") + +default quick_menu = True + +style quick_menu is hbox +style quick_button is default +style quick_button_text is button_text + +style quick_menu: + xalign 0.5 + yalign 1.0 + +style quick_button: + properties gui.button_properties("quick_button") + +style quick_button_text: + properties gui.text_properties("quick_button") + + +################################################################################ +## Main and Game Menu Screens +################################################################################ + +## Navigation screen ########################################################### +## +## This screen is included in the main and game menus, and provides navigation +## to other menus, and to start the game. + +screen navigation(): + + vbox: + style_prefix "navigation" + + xpos gui.navigation_xpos + yalign 0.5 + + spacing gui.navigation_spacing + + if main_menu: + + textbutton _("Start") action Start() + + else: + + textbutton _("History") action ShowMenu("history") + + textbutton _("Save") action ShowMenu("save") + + textbutton _("Load") action ShowMenu("load") + + textbutton _("Preferences") action ShowMenu("preferences") + + if _in_replay: + + textbutton _("End Replay") action EndReplay(confirm=True) + + elif not main_menu: + + textbutton _("Main Menu") action MainMenu() + + textbutton _("About") action ShowMenu("about") + + if renpy.variant("pc") or (renpy.variant("web") and not renpy.variant("mobile")): + + ## Help isn't necessary or relevant to mobile devices. + textbutton _("Help") action ShowMenu("help") + + if renpy.variant("pc"): + + ## The quit button is banned on iOS and unnecessary on Android and + ## Web. + textbutton _("Quit") action Quit(confirm=not main_menu) + + +style navigation_button is gui_button +style navigation_button_text is gui_button_text + +style navigation_button: + size_group "navigation" + properties gui.button_properties("navigation_button") + +style navigation_button_text: + properties gui.text_properties("navigation_button") + + +## Main Menu screen ############################################################ +## +## Used to display the main menu when Ren'Py starts. +## +## https://www.renpy.org/doc/html/screen_special.html#main-menu + +screen main_menu(): + + ## This ensures that any other menu screen is replaced. + tag menu + + add gui.main_menu_background + + ## This empty frame darkens the main menu. + frame: + style "main_menu_frame" + + ## The use statement includes another screen inside this one. The actual + ## contents of the main menu are in the navigation screen. + use navigation + + if gui.show_name: + + vbox: + style "main_menu_vbox" + + text "[config.name!t]": + style "main_menu_title" + + text "[config.version]": + style "main_menu_version" + + +style main_menu_frame is empty +style main_menu_vbox is vbox +style main_menu_text is gui_text +style main_menu_title is main_menu_text +style main_menu_version is main_menu_text + +style main_menu_frame: + xsize 280 + yfill True + + background "gui/overlay/main_menu.png" + +style main_menu_vbox: + xalign 1.0 + xoffset -20 + xmaximum 800 + yalign 1.0 + yoffset -20 + +style main_menu_text: + properties gui.text_properties("main_menu", accent=True) + +style main_menu_title: + properties gui.text_properties("title") + +style main_menu_version: + properties gui.text_properties("version") + + +## Game Menu screen ############################################################ +## +## This lays out the basic common structure of a game menu screen. It's called +## with the screen title, and displays the background, title, and navigation. +## +## The scroll parameter can be None, or one of "viewport" or "vpgrid". +## This screen is intended to be used with one or more children, which are +## transcluded (placed) inside it. + +screen game_menu(title, scroll=None, yinitial=0.0, spacing=0): + + style_prefix "game_menu" + + if main_menu: + add gui.main_menu_background + else: + add gui.game_menu_background + + frame: + style "game_menu_outer_frame" + + hbox: + + ## Reserve space for the navigation section. + frame: + style "game_menu_navigation_frame" + + frame: + style "game_menu_content_frame" + + if scroll == "viewport": + + viewport: + yinitial yinitial + scrollbars "vertical" + mousewheel True + draggable True + pagekeys True + + side_yfill True + + vbox: + spacing spacing + + transclude + + elif scroll == "vpgrid": + + vpgrid: + cols 1 + yinitial yinitial + + scrollbars "vertical" + mousewheel True + draggable True + pagekeys True + + side_yfill True + + spacing spacing + + transclude + + else: + + transclude + + use navigation + + textbutton _("Return"): + style "return_button" + + action Return() + + label title + + if main_menu: + key "game_menu" action ShowMenu("main_menu") + + +style game_menu_outer_frame is empty +style game_menu_navigation_frame is empty +style game_menu_content_frame is empty +style game_menu_viewport is gui_viewport +style game_menu_side is gui_side +style game_menu_scrollbar is gui_vscrollbar + +style game_menu_label is gui_label +style game_menu_label_text is gui_label_text + +style return_button is navigation_button +style return_button_text is navigation_button_text + +style game_menu_outer_frame: + bottom_padding 30 + top_padding 120 + + background "gui/overlay/game_menu.png" + +style game_menu_navigation_frame: + xsize 280 + yfill True + +style game_menu_content_frame: + left_margin 40 + right_margin 20 + top_margin 10 + +style game_menu_viewport: + xsize 920 + +style game_menu_vscrollbar: + unscrollable gui.unscrollable + +style game_menu_side: + spacing 10 + +style game_menu_label: + xpos 50 + ysize 120 + +style game_menu_label_text: + size 50 + color gui.accent_color + yalign 0.5 + +style return_button: + xpos gui.navigation_xpos + yalign 1.0 + yoffset -30 + + +## About screen ################################################################ +## +## This screen gives credit and copyright information about the game and Ren'Py. +## +## There's nothing special about this screen, and hence it also serves as an +## example of how to make a custom screen. + +screen about(): + + tag menu + + ## This use statement includes the game_menu screen inside this one. The + ## vbox child is then included inside the viewport inside the game_menu + ## screen. + use game_menu(_("About"), scroll="viewport"): + + style_prefix "about" + + vbox: + + label "[config.name!t]" + text _("Version [config.version!t]\n") + + ## gui.about is usually set in options.rpy. + if gui.about: + text "[gui.about!t]\n" + + text _("Made with {a=https://www.renpy.org/}Ren'Py{/a} [renpy.version_only].\n\n[renpy.license!t]") + + +style about_label is gui_label +style about_label_text is gui_label_text +style about_text is gui_text + +style about_label_text: + size gui.label_text_size + + +## Load and Save screens ####################################################### +## +## These screens are responsible for letting the player save the game and load +## it again. Since they share nearly everything in common, both are implemented +## in terms of a third screen, file_slots. +## +## https://www.renpy.org/doc/html/screen_special.html#save https:// +## www.renpy.org/doc/html/screen_special.html#load + +screen save(): + + tag menu + + use file_slots(_("Save")) + + +screen load(): + + tag menu + + use file_slots(_("Load")) + + +screen file_slots(title): + + default page_name_value = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves")) + + use game_menu(title): + + fixed: + + ## This ensures the input will get the enter event before any of the + ## buttons do. + order_reverse True + + ## The page name, which can be edited by clicking on a button. + button: + style "page_label" + + key_events True + xalign 0.5 + action page_name_value.Toggle() + + input: + style "page_label_text" + value page_name_value + + ## The grid of file slots. + grid gui.file_slot_cols gui.file_slot_rows: + style_prefix "slot" + + xalign 0.5 + yalign 0.5 + + spacing gui.slot_spacing + + for i in range(gui.file_slot_cols * gui.file_slot_rows): + + $ slot = i + 1 + + button: + action FileAction(slot) + + has vbox + + add FileScreenshot(slot) xalign 0.5 + + text FileTime(slot, format=_("{#file_time}%A, %B %d %Y, %H:%M"), empty=_("empty slot")): + style "slot_time_text" + + text FileSaveName(slot): + style "slot_name_text" + + key "save_delete" action FileDelete(slot) + + ## Buttons to access other pages. + vbox: + style_prefix "page" + + xalign 0.5 + yalign 1.0 + + hbox: + xalign 0.5 + + spacing gui.page_spacing + + textbutton _("<") action FilePagePrevious() + key "save_page_prev" action FilePagePrevious() + + if config.has_autosave: + textbutton _("{#auto_page}A") action FilePage("auto") + + if config.has_quicksave: + textbutton _("{#quick_page}Q") action FilePage("quick") + + ## range(1, 10) gives the numbers from 1 to 9. + for page in range(1, 10): + textbutton "[page]" action FilePage(page) + + textbutton _(">") action FilePageNext() + key "save_page_next" action FilePageNext() + + if config.has_sync: + if CurrentScreenName() == "save": + textbutton _("Upload Sync"): + action UploadSync() + xalign 0.5 + else: + textbutton _("Download Sync"): + action DownloadSync() + xalign 0.5 + + +style page_label is gui_label +style page_label_text is gui_label_text +style page_button is gui_button +style page_button_text is gui_button_text + +style slot_button is gui_button +style slot_button_text is gui_button_text +style slot_time_text is slot_button_text +style slot_name_text is slot_button_text + +style page_label: + xpadding 50 + ypadding 3 + xalign 0.5 + +style page_label_text: + textalign 0.5 + layout "subtitle" + hover_color gui.hover_color + +style page_button: + properties gui.button_properties("page_button") + +style page_button_text: + properties gui.text_properties("page_button") + +style slot_button: + properties gui.button_properties("slot_button") + +style slot_button_text: + properties gui.text_properties("slot_button") + + +## Preferences screen ########################################################## +## +## The preferences screen allows the player to configure the game to better suit +## themselves. +## +## https://www.renpy.org/doc/html/screen_special.html#preferences + +screen preferences(): + + tag menu + + use game_menu(_("Preferences"), scroll="viewport"): + + vbox: + + hbox: + box_wrap True + + if renpy.variant("pc") or renpy.variant("web"): + + vbox: + style_prefix "radio" + label _("Display") + textbutton _("Window") action Preference("display", "window") + textbutton _("Fullscreen") action Preference("display", "fullscreen") + + vbox: + style_prefix "check" + label _("Skip") + textbutton _("Unseen Text") action Preference("skip", "toggle") + textbutton _("After Choices") action Preference("after choices", "toggle") + textbutton _("Transitions") action InvertSelected(Preference("transitions", "toggle")) + + ## Additional vboxes of type "radio_pref" or "check_pref" can be + ## added here, to add additional creator-defined preferences. + + null height (4 * gui.pref_spacing) + + hbox: + style_prefix "slider" + box_wrap True + + vbox: + + label _("Text Speed") + + bar value Preference("text speed") + + label _("Auto-Forward Time") + + bar value Preference("auto-forward time") + + vbox: + + if config.has_music: + label _("Music Volume") + + hbox: + bar value Preference("music volume") + + if config.has_sound: + + label _("Sound Volume") + + hbox: + bar value Preference("sound volume") + + if config.sample_sound: + textbutton _("Test") action Play("sound", config.sample_sound) + + + if config.has_voice: + label _("Voice Volume") + + hbox: + bar value Preference("voice volume") + + if config.sample_voice: + textbutton _("Test") action Play("voice", config.sample_voice) + + if config.has_music or config.has_sound or config.has_voice: + null height gui.pref_spacing + + textbutton _("Mute All"): + action Preference("all mute", "toggle") + style "mute_all_button" + + +style pref_label is gui_label +style pref_label_text is gui_label_text +style pref_vbox is vbox + +style radio_label is pref_label +style radio_label_text is pref_label_text +style radio_button is gui_button +style radio_button_text is gui_button_text +style radio_vbox is pref_vbox + +style check_label is pref_label +style check_label_text is pref_label_text +style check_button is gui_button +style check_button_text is gui_button_text +style check_vbox is pref_vbox + +style slider_label is pref_label +style slider_label_text is pref_label_text +style slider_slider is gui_slider +style slider_button is gui_button +style slider_button_text is gui_button_text +style slider_pref_vbox is pref_vbox + +style mute_all_button is check_button +style mute_all_button_text is check_button_text + +style pref_label: + top_margin gui.pref_spacing + bottom_margin 2 + +style pref_label_text: + yalign 1.0 + +style pref_vbox: + xsize 225 + +style radio_vbox: + spacing gui.pref_button_spacing + +style radio_button: + properties gui.button_properties("radio_button") + foreground "gui/button/radio_[prefix_]foreground.png" + +style radio_button_text: + properties gui.text_properties("radio_button") + +style check_vbox: + spacing gui.pref_button_spacing + +style check_button: + properties gui.button_properties("check_button") + foreground "gui/button/check_[prefix_]foreground.png" + +style check_button_text: + properties gui.text_properties("check_button") + +style slider_slider: + xsize 350 + +style slider_button: + properties gui.button_properties("slider_button") + yalign 0.5 + left_margin 10 + +style slider_button_text: + properties gui.text_properties("slider_button") + +style slider_vbox: + xsize 450 + + +## History screen ############################################################## +## +## This is a screen that displays the dialogue history to the player. While +## there isn't anything special about this screen, it does have to access the +## dialogue history stored in _history_list. +## +## https://www.renpy.org/doc/html/history.html + +screen history(): + + tag menu + + ## Avoid predicting this screen, as it can be very large. + predict False + + use game_menu(_("History"), scroll=("vpgrid" if gui.history_height else "viewport"), yinitial=1.0, spacing=gui.history_spacing): + + style_prefix "history" + + for h in _history_list: + + window: + + ## This lays things out properly if history_height is None. + has fixed: + yfit True + + if h.who: + + label h.who: + style "history_name" + substitute False + + ## Take the color of the who text from the Character, if + ## set. + if "color" in h.who_args: + text_color h.who_args["color"] + + $ what = renpy.filter_text_tags(h.what, allow=gui.history_allow_tags) + text what: + substitute False + + if not _history_list: + label _("The dialogue history is empty.") + + +## This determines what tags are allowed to be displayed on the history screen. + +define gui.history_allow_tags = { "alt", "noalt", "rt", "rb", "art" } + + +style history_window is empty + +style history_name is gui_label +style history_name_text is gui_label_text +style history_text is gui_text + +style history_label is gui_label +style history_label_text is gui_label_text + +style history_window: + xfill True + ysize gui.history_height + +style history_name: + xpos gui.history_name_xpos + xanchor gui.history_name_xalign + ypos gui.history_name_ypos + xsize gui.history_name_width + +style history_name_text: + min_width gui.history_name_width + textalign gui.history_name_xalign + +style history_text: + xpos gui.history_text_xpos + ypos gui.history_text_ypos + xanchor gui.history_text_xalign + xsize gui.history_text_width + min_width gui.history_text_width + textalign gui.history_text_xalign + layout ("subtitle" if gui.history_text_xalign else "tex") + +style history_label: + xfill True + +style history_label_text: + xalign 0.5 + + +## Help screen ################################################################# +## +## A screen that gives information about key and mouse bindings. It uses other +## screens (keyboard_help, mouse_help, and gamepad_help) to display the actual +## help. + +screen help(): + + tag menu + + default device = "keyboard" + + use game_menu(_("Help"), scroll="viewport"): + + style_prefix "help" + + vbox: + spacing 15 + + hbox: + + textbutton _("Keyboard") action SetScreenVariable("device", "keyboard") + textbutton _("Mouse") action SetScreenVariable("device", "mouse") + + if GamepadExists(): + textbutton _("Gamepad") action SetScreenVariable("device", "gamepad") + + if device == "keyboard": + use keyboard_help + elif device == "mouse": + use mouse_help + elif device == "gamepad": + use gamepad_help + + +screen keyboard_help(): + + hbox: + label _("Enter") + text _("Advances dialogue and activates the interface.") + + hbox: + label _("Space") + text _("Advances dialogue without selecting choices.") + + hbox: + label _("Arrow Keys") + text _("Navigate the interface.") + + hbox: + label _("Escape") + text _("Accesses the game menu.") + + hbox: + label _("Ctrl") + text _("Skips dialogue while held down.") + + hbox: + label _("Tab") + text _("Toggles dialogue skipping.") + + hbox: + label _("Page Up") + text _("Rolls back to earlier dialogue.") + + hbox: + label _("Page Down") + text _("Rolls forward to later dialogue.") + + hbox: + label "H" + text _("Hides the user interface.") + + hbox: + label "S" + text _("Takes a screenshot.") + + hbox: + label "V" + text _("Toggles assistive {a=https://www.renpy.org/l/voicing}self-voicing{/a}.") + + hbox: + label "Shift+A" + text _("Opens the accessibility menu.") + + +screen mouse_help(): + + hbox: + label _("Left Click") + text _("Advances dialogue and activates the interface.") + + hbox: + label _("Middle Click") + text _("Hides the user interface.") + + hbox: + label _("Right Click") + text _("Accesses the game menu.") + + hbox: + label _("Mouse Wheel Up") + text _("Rolls back to earlier dialogue.") + + hbox: + label _("Mouse Wheel Down") + text _("Rolls forward to later dialogue.") + + +screen gamepad_help(): + + hbox: + label _("Right Trigger\nA/Bottom Button") + text _("Advances dialogue and activates the interface.") + + hbox: + label _("Left Trigger\nLeft Shoulder") + text _("Rolls back to earlier dialogue.") + + hbox: + label _("Right Shoulder") + text _("Rolls forward to later dialogue.") + + hbox: + label _("D-Pad, Sticks") + text _("Navigate the interface.") + + hbox: + label _("Start, Guide, B/Right Button") + text _("Accesses the game menu.") + + hbox: + label _("Y/Top Button") + text _("Hides the user interface.") + + textbutton _("Calibrate") action GamepadCalibrate() + + +style help_button is gui_button +style help_button_text is gui_button_text +style help_label is gui_label +style help_label_text is gui_label_text +style help_text is gui_text + +style help_button: + properties gui.button_properties("help_button") + xmargin 8 + +style help_button_text: + properties gui.text_properties("help_button") + +style help_label: + xsize 250 + right_padding 20 + +style help_label_text: + size gui.text_size + xalign 1.0 + textalign 1.0 + + + +################################################################################ +## Additional screens +################################################################################ + + +## Confirm screen ############################################################## +## +## The confirm screen is called when Ren'Py wants to ask the player a yes or no +## question. +## +## https://www.renpy.org/doc/html/screen_special.html#confirm + +screen confirm(message, yes_action, no_action): + + ## Ensure other screens do not get input while this screen is displayed. + modal True + + zorder 200 + + style_prefix "confirm" + + add "gui/overlay/confirm.png" + + frame: + + vbox: + xalign .5 + yalign .5 + spacing 30 + + label _(message): + style "confirm_prompt" + xalign 0.5 + + hbox: + xalign 0.5 + spacing 100 + + textbutton _("Yes") action yes_action + textbutton _("No") action no_action + + ## Right-click and escape answer "no". + key "game_menu" action no_action + + +style confirm_frame is gui_frame +style confirm_prompt is gui_prompt +style confirm_prompt_text is gui_prompt_text +style confirm_button is gui_medium_button +style confirm_button_text is gui_medium_button_text + +style confirm_frame: + background Frame([ "gui/confirm_frame.png", "gui/frame.png"], gui.confirm_frame_borders, tile=gui.frame_tile) + padding gui.confirm_frame_borders.padding + xalign .5 + yalign .5 + +style confirm_prompt_text: + textalign 0.5 + layout "subtitle" + +style confirm_button: + properties gui.button_properties("confirm_button") + +style confirm_button_text: + properties gui.text_properties("confirm_button") + + +## Skip indicator screen ####################################################### +## +## The skip_indicator screen is displayed to indicate that skipping is in +## progress. +## +## https://www.renpy.org/doc/html/screen_special.html#skip-indicator + +screen skip_indicator(): + + zorder 100 + style_prefix "skip" + + frame: + + hbox: + spacing 6 + + text _("Skipping") + + text "▸" at delayed_blink(0.0, 1.0) style "skip_triangle" + text "▸" at delayed_blink(0.2, 1.0) style "skip_triangle" + text "▸" at delayed_blink(0.4, 1.0) style "skip_triangle" + + +## This transform is used to blink the arrows one after another. +transform delayed_blink(delay, cycle): + alpha .5 + + pause delay + + block: + linear .2 alpha 1.0 + pause .2 + linear .2 alpha 0.5 + pause (cycle - .4) + repeat + + +style skip_frame is empty +style skip_text is gui_text +style skip_triangle is skip_text + +style skip_frame: + ypos gui.skip_ypos + background Frame("gui/skip.png", gui.skip_frame_borders, tile=gui.frame_tile) + padding gui.skip_frame_borders.padding + +style skip_text: + size gui.notify_text_size + +style skip_triangle: + ## We have to use a font that has the BLACK RIGHT-POINTING SMALL TRIANGLE + ## glyph in it. + font "DejaVuSans.ttf" + + +## Notify screen ############################################################### +## +## The notify screen is used to show the player a message. (For example, when +## the game is quicksaved or a screenshot has been taken.) +## +## https://www.renpy.org/doc/html/screen_special.html#notify-screen + +screen notify(message): + + zorder 100 + style_prefix "notify" + + frame at notify_appear: + text "[message!tq]" + + timer 3.25 action Hide('notify') + + +transform notify_appear: + on show: + alpha 0 + linear .25 alpha 1.0 + on hide: + linear .5 alpha 0.0 + + +style notify_frame is empty +style notify_text is gui_text + +style notify_frame: + ypos gui.notify_ypos + + background Frame("gui/notify.png", gui.notify_frame_borders, tile=gui.frame_tile) + padding gui.notify_frame_borders.padding + +style notify_text: + properties gui.text_properties("notify") + + +## NVL screen ################################################################## +## +## This screen is used for NVL-mode dialogue and menus. +## +## https://www.renpy.org/doc/html/screen_special.html#nvl + + +screen nvl(dialogue, items=None): + + window: + style "nvl_window" + + has vbox: + spacing gui.nvl_spacing + + ## Displays dialogue in either a vpgrid or the vbox. + if gui.nvl_height: + + vpgrid: + cols 1 + yinitial 1.0 + + use nvl_dialogue(dialogue) + + else: + + use nvl_dialogue(dialogue) + + ## Displays the menu, if given. The menu may be displayed incorrectly if + ## config.narrator_menu is set to True. + for i in items: + + textbutton i.caption: + action i.action + style "nvl_button" + + add SideImage() xalign 0.0 yalign 1.0 + + +screen nvl_dialogue(dialogue): + + for d in dialogue: + + window: + id d.window_id + + fixed: + yfit gui.nvl_height is None + + if d.who is not None: + + text d.who: + id d.who_id + + text d.what: + id d.what_id + + +## This controls the maximum number of NVL-mode entries that can be displayed at +## once. +define config.nvl_list_length = gui.nvl_list_length + +style nvl_window is default +style nvl_entry is default + +style nvl_label is say_label +style nvl_dialogue is say_dialogue + +style nvl_button is button +style nvl_button_text is button_text + +style nvl_window: + xfill True + yfill True + + background "gui/nvl.png" + padding gui.nvl_borders.padding + +style nvl_entry: + xfill True + ysize gui.nvl_height + +style nvl_label: + xpos gui.nvl_name_xpos + xanchor gui.nvl_name_xalign + ypos gui.nvl_name_ypos + yanchor 0.0 + xsize gui.nvl_name_width + min_width gui.nvl_name_width + textalign gui.nvl_name_xalign + +style nvl_dialogue: + xpos gui.nvl_text_xpos + xanchor gui.nvl_text_xalign + ypos gui.nvl_text_ypos + xsize gui.nvl_text_width + min_width gui.nvl_text_width + textalign gui.nvl_text_xalign + layout ("subtitle" if gui.nvl_text_xalign else "tex") + +style nvl_thought: + xpos gui.nvl_thought_xpos + xanchor gui.nvl_thought_xalign + ypos gui.nvl_thought_ypos + xsize gui.nvl_thought_width + min_width gui.nvl_thought_width + textalign gui.nvl_thought_xalign + layout ("subtitle" if gui.nvl_text_xalign else "tex") + +style nvl_button: + properties gui.button_properties("nvl_button") + xpos gui.nvl_button_xpos + xanchor gui.nvl_button_xalign + +style nvl_button_text: + properties gui.text_properties("nvl_button") + + +## Bubble screen ############################################################### +## +## The bubble screen is used to display dialogue to the player when using speech +## bubbles. The bubble screen takes the same parameters as the say screen, must +## create a displayable with the id of "what", and can create displayables with +## the "namebox", "who", and "window" ids. +## +## https://www.renpy.org/doc/html/bubble.html#bubble-screen + +screen bubble(who, what): + style_prefix "bubble" + + window: + id "window" + + if who is not None: + + window: + id "namebox" + style "bubble_namebox" + + text who: + id "who" + + text what: + id "what" + + default ctc = None + showif ctc: + add ctc + +style bubble_window is empty +style bubble_namebox is empty +style bubble_who is default +style bubble_what is default + +style bubble_window: + xpadding 30 + top_padding 5 + bottom_padding 5 + +style bubble_namebox: + xalign 0.5 + +style bubble_who: + xalign 0.5 + textalign 0.5 + color "#000" + +style bubble_what: + align (0.5, 0.5) + text_align 0.5 + layout "subtitle" + color "#000" + +define bubble.frame = Frame("gui/bubble.png", 55, 55, 55, 95) +define bubble.thoughtframe = Frame("gui/thoughtbubble.png", 55, 55, 55, 55) + +define bubble.properties = { + "bottom_left" : { + "window_background" : Transform(bubble.frame, xzoom=1, yzoom=1), + "window_bottom_padding" : 27, + }, + + "bottom_right" : { + "window_background" : Transform(bubble.frame, xzoom=-1, yzoom=1), + "window_bottom_padding" : 27, + }, + + "top_left" : { + "window_background" : Transform(bubble.frame, xzoom=1, yzoom=-1), + "window_top_padding" : 27, + }, + + "top_right" : { + "window_background" : Transform(bubble.frame, xzoom=-1, yzoom=-1), + "window_top_padding" : 27, + }, + + "thought" : { + "window_background" : bubble.thoughtframe, + } +} + +define bubble.expand_area = { + "bottom_left" : (0, 0, 0, 22), + "bottom_right" : (0, 0, 0, 22), + "top_left" : (0, 22, 0, 0), + "top_right" : (0, 22, 0, 0), + "thought" : (0, 0, 0, 0), +} + + + +################################################################################ +## Mobile Variants +################################################################################ + +style pref_vbox: + variant "medium" + xsize 450 + +## Since a mouse may not be present, we replace the quick menu with a version +## that uses fewer and bigger buttons that are easier to touch. +screen quick_menu(): + variant "touch" + + zorder 100 + + if quick_menu: + + hbox: + style "quick_menu" + style_prefix "quick" + + textbutton _("Back") action Rollback() + textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True) + textbutton _("Auto") action Preference("auto-forward", "toggle") + textbutton _("Menu") action ShowMenu() + + +style window: + variant "small" + background "gui/phone/textbox.png" + +style radio_button: + variant "small" + foreground "gui/phone/button/radio_[prefix_]foreground.png" + +style check_button: + variant "small" + foreground "gui/phone/button/check_[prefix_]foreground.png" + +style nvl_window: + variant "small" + background "gui/phone/nvl.png" + +style main_menu_frame: + variant "small" + background "gui/phone/overlay/main_menu.png" + +style game_menu_outer_frame: + variant "small" + background "gui/phone/overlay/game_menu.png" + +style game_menu_navigation_frame: + variant "small" + xsize 340 + +style game_menu_content_frame: + variant "small" + top_margin 0 + +style game_menu_viewport: + variant "small" + xsize 870 + +style pref_vbox: + variant "small" + xsize 400 + +style bar: + variant "small" + ysize gui.bar_size + left_bar Frame("gui/phone/bar/left.png", gui.bar_borders, tile=gui.bar_tile) + right_bar Frame("gui/phone/bar/right.png", gui.bar_borders, tile=gui.bar_tile) + +style vbar: + variant "small" + xsize gui.bar_size + top_bar Frame("gui/phone/bar/top.png", gui.vbar_borders, tile=gui.bar_tile) + bottom_bar Frame("gui/phone/bar/bottom.png", gui.vbar_borders, tile=gui.bar_tile) + +style scrollbar: + variant "small" + ysize gui.scrollbar_size + base_bar Frame("gui/phone/scrollbar/horizontal_[prefix_]bar.png", gui.scrollbar_borders, tile=gui.scrollbar_tile) + thumb Frame("gui/phone/scrollbar/horizontal_[prefix_]thumb.png", gui.scrollbar_borders, tile=gui.scrollbar_tile) + +style vscrollbar: + variant "small" + xsize gui.scrollbar_size + base_bar Frame("gui/phone/scrollbar/vertical_[prefix_]bar.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile) + thumb Frame("gui/phone/scrollbar/vertical_[prefix_]thumb.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile) + +style slider: + variant "small" + ysize gui.slider_size + base_bar Frame("gui/phone/slider/horizontal_[prefix_]bar.png", gui.slider_borders, tile=gui.slider_tile) + thumb "gui/phone/slider/horizontal_[prefix_]thumb.png" + +style vslider: + variant "small" + xsize gui.slider_size + base_bar Frame("gui/phone/slider/vertical_[prefix_]bar.png", gui.vslider_borders, tile=gui.slider_tile) + thumb "gui/phone/slider/vertical_[prefix_]thumb.png" + +style slider_vbox: + variant "small" + xsize None + +style slider_slider: + variant "small" + xsize 600 diff --git a/renpy/renpy_example_01/game/script.rpy b/renpy/renpy_example_01/game/script.rpy new file mode 100644 index 0000000..6813370 --- /dev/null +++ b/renpy/renpy_example_01/game/script.rpy @@ -0,0 +1,70 @@ +# Definice postav (jméno a barva textu) +define k = Character("Karel", color="#3498db") +define p = Character("Petra", color="#e74c3c") +define v = Character("Vypravěč", color="#95a5a6") +define b = Character("Boss", color="#ff0000") + +# Zástupné obrázky pro pozadí (hrad nahradíme skutečnou mapou ze složky 'images') +image bg les = Solid("#228B22") # Zelená barva jako les +image bg jeskyně = Solid("#696969") # Šedá barva jako jeskyně + +# Hra začíná zde +label start: + + # Zobrazí pozadí lesa + scene bg les + with fade + + v "Byl krásný slunečný den a Karel se rozhodl jít na procházku do lesa." + + k "Dnes je opravdu nádherně. Možná najdu nějaké houby." + + v "Najednou uslyšel zapraskání větviček." + + p "Ahoj Karle! Co tady děláš?" + + k "Petro! Ty jsi mě vyděsila. Jen se tu procházím." + + p "Slyšela jsem, že v nedaleké jeskyni je ukrytý poklad. Půjdeme se podívat?" + + k "Zní to nebezpečně, ale proč ne." + + # Přesun do jeskyně + scene bg jeskyně + with dissolve + + v "Karel a Petra dorazili k temné jeskyni." + + k "Tady je hrozná tma. Nevidím na krok." + + p "Neboj se, mám baterku. Podívej, tamhle něco svítí!" + + v "V rohu jeskyně našli starou kouzelnou mapu." + + k "To je nádherná mapa celého kraje! A je na ní vyznačený poklad!" + + # Zobrazíme naši novou mapu ze složky images + scene bg_mapa + with fade + + v "Mapa se před nimi rozvinula v celé své kráse. V tu chvíli se ale zničehonic objevil mocný strážce!" + + # Pomocí bloku můžeme obrázek zmenšit, aby nebyl přes celou obrazovku + show boss: + zoom 0.5 + yalign 1.0 + with dissolve + + b "MUAHAHA! Já jsem Boss! A tahle mapa patří mně!" + + p "Páni, to je ale hrozivý nepřítel. Vypadá jako... nějaký temný stín!" + + k "Neboj se Petro! Utíkámeee!" + + hide boss + with fade + + v "Karel a Petra sice nenašli poklad, ale odnesli si zážitek na celý život. A přízrak dál stráží svou mapu." + + # Konec hry + return diff --git a/renpy/renpy_example_01/game/tl/None/common.rpym b/renpy/renpy_example_01/game/tl/None/common.rpym new file mode 100644 index 0000000..3dce218 --- /dev/null +++ b/renpy/renpy_example_01/game/tl/None/common.rpym @@ -0,0 +1,1535 @@ + +translate None strings: + + # renpy/common/000statements.rpy:28 + old "Click to play the video." + new "Click to play the video." + + # renpy/common/00accessibility.rpy:28 + old "Self-voicing disabled." + new "Self-voicing disabled." + + # renpy/common/00accessibility.rpy:29 + old "Clipboard voicing enabled. " + new "Clipboard voicing enabled. " + + # renpy/common/00accessibility.rpy:30 + old "Self-voicing enabled. " + new "Self-voicing enabled. " + + # renpy/common/00accessibility.rpy:32 + old "bar" + new "bar" + + # renpy/common/00accessibility.rpy:33 + old "selected" + new "selected" + + # renpy/common/00accessibility.rpy:34 + old "viewport" + new "viewport" + + # renpy/common/00accessibility.rpy:35 + old "horizontal scroll" + new "horizontal scroll" + + # renpy/common/00accessibility.rpy:36 + old "vertical scroll" + new "vertical scroll" + + # renpy/common/00accessibility.rpy:37 + old "activate" + new "activate" + + # renpy/common/00accessibility.rpy:38 + old "deactivate" + new "deactivate" + + # renpy/common/00accessibility.rpy:39 + old "increase" + new "increase" + + # renpy/common/00accessibility.rpy:40 + old "decrease" + new "decrease" + + # renpy/common/00accessibility.rpy:134 + old "Self-Voicing" + new "Self-Voicing" + + # renpy/common/00accessibility.rpy:137 + old "Self-voicing support is limited when using a touch screen." + new "Self-voicing support is limited when using a touch screen." + + # renpy/common/00accessibility.rpy:139 + old "Off" + new "Off" + + # renpy/common/00accessibility.rpy:143 + old "Text-to-speech" + new "Text-to-speech" + + # renpy/common/00accessibility.rpy:147 + old "Clipboard" + new "Clipboard" + + # renpy/common/00accessibility.rpy:151 + old "Debug" + new "Debug" + + # renpy/common/00accessibility.rpy:155 + old "Voice Volume" + new "Voice Volume" + + # renpy/common/00accessibility.rpy:163 + old "Reset" + new "Reset" + + # renpy/common/00accessibility.rpy:167 + old "Self-Voicing Volume Drop" + new "Self-Voicing Volume Drop" + + # renpy/common/00accessibility.rpy:180 + old "Mono Audio" + new "Mono Audio" + + # renpy/common/00accessibility.rpy:182 + old "Enable" + new "Enable" + + # renpy/common/00accessibility.rpy:186 + old "Disable" + new "Disable" + + # renpy/common/00accessibility.rpy:198 + old "Font Override" + new "Font Override" + + # renpy/common/00accessibility.rpy:200 + old "Default" + new "Default" + + # renpy/common/00accessibility.rpy:204 + old "DejaVu Sans" + new "DejaVu Sans" + + # renpy/common/00accessibility.rpy:208 + old "Opendyslexic" + new "Opendyslexic" + + # renpy/common/00accessibility.rpy:212 + old "High Contrast Text" + new "High Contrast Text" + + # renpy/common/00accessibility.rpy:224 + old "Text Size Scaling" + new "Text Size Scaling" + + # renpy/common/00accessibility.rpy:235 + old "Line Spacing Scaling" + new "Line Spacing Scaling" + + # renpy/common/00accessibility.rpy:246 + old "Kerning" + new "Kerning" + + # renpy/common/00accessibility.rpy:267 + old "Accessibility Menu. Use up and down arrows to navigate, and enter to activate buttons and bars." + new "Accessibility Menu. Use up and down arrows to navigate, and enter to activate buttons and bars." + + # renpy/common/00accessibility.rpy:288 + old "Self-Voicing and Audio" + new "Self-Voicing and Audio" + + # renpy/common/00accessibility.rpy:292 + old "Text" + new "Text" + + # renpy/common/00accessibility.rpy:296 + old "Return" + new "Return" + + # renpy/common/00accessibility.rpy:306 + old "The options on this menu are intended to improve accessibility. They may not work with all games, and some combinations of options may render the game unplayable. This is not an issue with the game or engine. For the best results when changing fonts, try to keep the text size the same as it originally was." + new "The options on this menu are intended to improve accessibility. They may not work with all games, and some combinations of options may render the game unplayable. This is not an issue with the game or engine. For the best results when changing fonts, try to keep the text size the same as it originally was." + + # renpy/common/00action_file.rpy:26 + old "{#weekday}Monday" + new "{#weekday}Monday" + + # renpy/common/00action_file.rpy:26 + old "{#weekday}Tuesday" + new "{#weekday}Tuesday" + + # renpy/common/00action_file.rpy:26 + old "{#weekday}Wednesday" + new "{#weekday}Wednesday" + + # renpy/common/00action_file.rpy:26 + old "{#weekday}Thursday" + new "{#weekday}Thursday" + + # renpy/common/00action_file.rpy:26 + old "{#weekday}Friday" + new "{#weekday}Friday" + + # renpy/common/00action_file.rpy:26 + old "{#weekday}Saturday" + new "{#weekday}Saturday" + + # renpy/common/00action_file.rpy:26 + old "{#weekday}Sunday" + new "{#weekday}Sunday" + + # renpy/common/00action_file.rpy:37 + old "{#weekday_short}Mon" + new "{#weekday_short}Mon" + + # renpy/common/00action_file.rpy:37 + old "{#weekday_short}Tue" + new "{#weekday_short}Tue" + + # renpy/common/00action_file.rpy:37 + old "{#weekday_short}Wed" + new "{#weekday_short}Wed" + + # renpy/common/00action_file.rpy:37 + old "{#weekday_short}Thu" + new "{#weekday_short}Thu" + + # renpy/common/00action_file.rpy:37 + old "{#weekday_short}Fri" + new "{#weekday_short}Fri" + + # renpy/common/00action_file.rpy:37 + old "{#weekday_short}Sat" + new "{#weekday_short}Sat" + + # renpy/common/00action_file.rpy:37 + old "{#weekday_short}Sun" + new "{#weekday_short}Sun" + + # renpy/common/00action_file.rpy:47 + old "{#month}January" + new "{#month}January" + + # renpy/common/00action_file.rpy:47 + old "{#month}February" + new "{#month}February" + + # renpy/common/00action_file.rpy:47 + old "{#month}March" + new "{#month}March" + + # renpy/common/00action_file.rpy:47 + old "{#month}April" + new "{#month}April" + + # renpy/common/00action_file.rpy:47 + old "{#month}May" + new "{#month}May" + + # renpy/common/00action_file.rpy:47 + old "{#month}June" + new "{#month}June" + + # renpy/common/00action_file.rpy:47 + old "{#month}July" + new "{#month}July" + + # renpy/common/00action_file.rpy:47 + old "{#month}August" + new "{#month}August" + + # renpy/common/00action_file.rpy:47 + old "{#month}September" + new "{#month}September" + + # renpy/common/00action_file.rpy:47 + old "{#month}October" + new "{#month}October" + + # renpy/common/00action_file.rpy:47 + old "{#month}November" + new "{#month}November" + + # renpy/common/00action_file.rpy:47 + old "{#month}December" + new "{#month}December" + + # renpy/common/00action_file.rpy:63 + old "{#month_short}Jan" + new "{#month_short}Jan" + + # renpy/common/00action_file.rpy:63 + old "{#month_short}Feb" + new "{#month_short}Feb" + + # renpy/common/00action_file.rpy:63 + old "{#month_short}Mar" + new "{#month_short}Mar" + + # renpy/common/00action_file.rpy:63 + old "{#month_short}Apr" + new "{#month_short}Apr" + + # renpy/common/00action_file.rpy:63 + old "{#month_short}May" + new "{#month_short}May" + + # renpy/common/00action_file.rpy:63 + old "{#month_short}Jun" + new "{#month_short}Jun" + + # renpy/common/00action_file.rpy:63 + old "{#month_short}Jul" + new "{#month_short}Jul" + + # renpy/common/00action_file.rpy:63 + old "{#month_short}Aug" + new "{#month_short}Aug" + + # renpy/common/00action_file.rpy:63 + old "{#month_short}Sep" + new "{#month_short}Sep" + + # renpy/common/00action_file.rpy:63 + old "{#month_short}Oct" + new "{#month_short}Oct" + + # renpy/common/00action_file.rpy:63 + old "{#month_short}Nov" + new "{#month_short}Nov" + + # renpy/common/00action_file.rpy:63 + old "{#month_short}Dec" + new "{#month_short}Dec" + + # renpy/common/00action_file.rpy:258 + old "%b %d, %H:%M" + new "%b %d, %H:%M" + + # renpy/common/00action_file.rpy:395 + old "Save slot %s: [text]" + new "Save slot %s: [text]" + + # renpy/common/00action_file.rpy:481 + old "Load slot %s: [text]" + new "Load slot %s: [text]" + + # renpy/common/00action_file.rpy:534 + old "Delete slot [text]" + new "Delete slot [text]" + + # renpy/common/00action_file.rpy:613 + old "File page auto" + new "File page auto" + + # renpy/common/00action_file.rpy:615 + old "File page quick" + new "File page quick" + + # renpy/common/00action_file.rpy:617 + old "File page [text]" + new "File page [text]" + + # renpy/common/00action_file.rpy:675 + old "Page {}" + new "Page {}" + + # renpy/common/00action_file.rpy:675 + old "Automatic saves" + new "Automatic saves" + + # renpy/common/00action_file.rpy:675 + old "Quick saves" + new "Quick saves" + + # renpy/common/00action_file.rpy:816 + old "Next file page." + new "Next file page." + + # renpy/common/00action_file.rpy:888 + old "Previous file page." + new "Previous file page." + + # renpy/common/00action_file.rpy:949 + old "Quick save complete." + new "Quick save complete." + + # renpy/common/00action_file.rpy:964 + old "Quick save." + new "Quick save." + + # renpy/common/00action_file.rpy:983 + old "Quick load." + new "Quick load." + + # renpy/common/00action_other.rpy:416 + old "Language [text]" + new "Language [text]" + + # renpy/common/00action_other.rpy:786 + old "Open [text] directory." + new "Open [text] directory." + + # renpy/common/00director.rpy:712 + old "The interactive director is not enabled here." + new "The interactive director is not enabled here." + + # renpy/common/00director.rpy:1512 + old "⬆" + new "⬆" + + # renpy/common/00director.rpy:1518 + old "⬇" + new "⬇" + + # renpy/common/00director.rpy:1582 + old "Done" + new "Done" + + # renpy/common/00director.rpy:1592 + old "(statement)" + new "(statement)" + + # renpy/common/00director.rpy:1593 + old "(tag)" + new "(tag)" + + # renpy/common/00director.rpy:1594 + old "(attributes)" + new "(attributes)" + + # renpy/common/00director.rpy:1595 + old "(transform)" + new "(transform)" + + # renpy/common/00director.rpy:1620 + old "(transition)" + new "(transition)" + + # renpy/common/00director.rpy:1632 + old "(channel)" + new "(channel)" + + # renpy/common/00director.rpy:1633 + old "(filename)" + new "(filename)" + + # renpy/common/00director.rpy:1662 + old "Change" + new "Change" + + # renpy/common/00director.rpy:1664 + old "Add" + new "Add" + + # renpy/common/00director.rpy:1667 + old "Cancel" + new "Cancel" + + # renpy/common/00director.rpy:1670 + old "Remove" + new "Remove" + + # renpy/common/00director.rpy:1705 + old "Statement:" + new "Statement:" + + # renpy/common/00director.rpy:1726 + old "Tag:" + new "Tag:" + + # renpy/common/00director.rpy:1742 + old "Attributes:" + new "Attributes:" + + # renpy/common/00director.rpy:1753 + old "Click to toggle attribute, right click to toggle negative attribute." + new "Click to toggle attribute, right click to toggle negative attribute." + + # renpy/common/00director.rpy:1765 + old "Transforms:" + new "Transforms:" + + # renpy/common/00director.rpy:1776 + old "Click to set transform, right click to add to transform list." + new "Click to set transform, right click to add to transform list." + + # renpy/common/00director.rpy:1777 + old "Customize director.transforms to add more transforms." + new "Customize director.transforms to add more transforms." + + # renpy/common/00director.rpy:1789 + old "Behind:" + new "Behind:" + + # renpy/common/00director.rpy:1800 + old "Click to set, right click to add to behind list." + new "Click to set, right click to add to behind list." + + # renpy/common/00director.rpy:1812 + old "Transition:" + new "Transition:" + + # renpy/common/00director.rpy:1822 + old "Click to set." + new "Click to set." + + # renpy/common/00director.rpy:1823 + old "Customize director.transitions to add more transitions." + new "Customize director.transitions to add more transitions." + + # renpy/common/00director.rpy:1835 + old "Channel:" + new "Channel:" + + # renpy/common/00director.rpy:1846 + old "Customize director.audio_channels to add more channels." + new "Customize director.audio_channels to add more channels." + + # renpy/common/00director.rpy:1858 + old "Audio Filename:" + new "Audio Filename:" + + # renpy/common/00gui.rpy:448 + old "Are you sure?" + new "Are you sure?" + + # renpy/common/00gui.rpy:449 + old "Are you sure you want to delete this save?" + new "Are you sure you want to delete this save?" + + # renpy/common/00gui.rpy:450 + old "Are you sure you want to overwrite your save?" + new "Are you sure you want to overwrite your save?" + + # renpy/common/00gui.rpy:451 + old "Loading will lose unsaved progress.\nAre you sure you want to do this?" + new "Loading will lose unsaved progress.\nAre you sure you want to do this?" + + # renpy/common/00gui.rpy:452 + old "Are you sure you want to quit?" + new "Are you sure you want to quit?" + + # renpy/common/00gui.rpy:453 + old "Are you sure you want to return to the main menu?\nThis will lose unsaved progress." + new "Are you sure you want to return to the main menu?\nThis will lose unsaved progress." + + # renpy/common/00gui.rpy:454 + old "Are you sure you want to continue where you left off?" + new "Are you sure you want to continue where you left off?" + + # renpy/common/00gui.rpy:455 + old "Are you sure you want to end the replay?" + new "Are you sure you want to end the replay?" + + # renpy/common/00gui.rpy:456 + old "Are you sure you want to begin skipping?" + new "Are you sure you want to begin skipping?" + + # renpy/common/00gui.rpy:457 + old "Are you sure you want to skip to the next choice?" + new "Are you sure you want to skip to the next choice?" + + # renpy/common/00gui.rpy:458 + old "Are you sure you want to skip unseen dialogue to the next choice?" + new "Are you sure you want to skip unseen dialogue to the next choice?" + + # renpy/common/00gui.rpy:459 + old "This save was created on a different device. Maliciously constructed save files can harm your computer. Do you trust this save's creator and everyone who could have changed the file?" + new "This save was created on a different device. Maliciously constructed save files can harm your computer. Do you trust this save's creator and everyone who could have changed the file?" + + # renpy/common/00gui.rpy:460 + old "Do you trust the device the save was created on? You should only choose yes if you are the device's sole user." + new "Do you trust the device the save was created on? You should only choose yes if you are the device's sole user." + + # renpy/common/00keymap.rpy:325 + old "Failed to save screenshot as %s." + new "Failed to save screenshot as %s." + + # renpy/common/00keymap.rpy:346 + old "Saved screenshot as %s." + new "Saved screenshot as %s." + + # renpy/common/00library.rpy:257 + old "Skip Mode" + new "Skip Mode" + + # renpy/common/00library.rpy:344 + old "This program contains free software under a number of licenses, including the MIT License and GNU Lesser General Public License. A complete list of software, including links to full source code, can be found {a=https://www.renpy.org/l/license}here{/a}." + new "This program contains free software under a number of licenses, including the MIT License and GNU Lesser General Public License. A complete list of software, including links to full source code, can be found {a=https://www.renpy.org/l/license}here{/a}." + + # renpy/common/00preferences.rpy:295 + old "display" + new "display" + + # renpy/common/00preferences.rpy:315 + old "transitions" + new "transitions" + + # renpy/common/00preferences.rpy:324 + old "skip transitions" + new "skip transitions" + + # renpy/common/00preferences.rpy:326 + old "video sprites" + new "video sprites" + + # renpy/common/00preferences.rpy:335 + old "show empty window" + new "show empty window" + + # renpy/common/00preferences.rpy:344 + old "text speed" + new "text speed" + + # renpy/common/00preferences.rpy:352 + old "joystick" + new "joystick" + + # renpy/common/00preferences.rpy:352 + old "joystick..." + new "joystick..." + + # renpy/common/00preferences.rpy:359 + old "skip" + new "skip" + + # renpy/common/00preferences.rpy:362 + old "skip unseen [text]" + new "skip unseen [text]" + + # renpy/common/00preferences.rpy:367 + old "skip unseen text" + new "skip unseen text" + + # renpy/common/00preferences.rpy:369 + old "begin skipping" + new "begin skipping" + + # renpy/common/00preferences.rpy:373 + old "after choices" + new "after choices" + + # renpy/common/00preferences.rpy:380 + old "skip after choices" + new "skip after choices" + + # renpy/common/00preferences.rpy:382 + old "auto-forward time" + new "auto-forward time" + + # renpy/common/00preferences.rpy:396 + old "auto-forward" + new "auto-forward" + + # renpy/common/00preferences.rpy:403 + old "Auto forward" + new "Auto forward" + + # renpy/common/00preferences.rpy:406 + old "auto-forward after click" + new "auto-forward after click" + + # renpy/common/00preferences.rpy:415 + old "automatic move" + new "automatic move" + + # renpy/common/00preferences.rpy:424 + old "wait for voice" + new "wait for voice" + + # renpy/common/00preferences.rpy:433 + old "voice sustain" + new "voice sustain" + + # renpy/common/00preferences.rpy:442 + old "self voicing" + new "self voicing" + + # renpy/common/00preferences.rpy:445 + old "self voicing enable" + new "self voicing enable" + + # renpy/common/00preferences.rpy:447 + old "self voicing disable" + new "self voicing disable" + + # renpy/common/00preferences.rpy:451 + old "self voicing volume drop" + new "self voicing volume drop" + + # renpy/common/00preferences.rpy:459 + old "clipboard voicing" + new "clipboard voicing" + + # renpy/common/00preferences.rpy:462 + old "clipboard voicing enable" + new "clipboard voicing enable" + + # renpy/common/00preferences.rpy:464 + old "clipboard voicing disable" + new "clipboard voicing disable" + + # renpy/common/00preferences.rpy:468 + old "debug voicing" + new "debug voicing" + + # renpy/common/00preferences.rpy:471 + old "debug voicing enable" + new "debug voicing enable" + + # renpy/common/00preferences.rpy:473 + old "debug voicing disable" + new "debug voicing disable" + + # renpy/common/00preferences.rpy:477 + old "emphasize audio" + new "emphasize audio" + + # renpy/common/00preferences.rpy:486 + old "rollback side" + new "rollback side" + + # renpy/common/00preferences.rpy:496 + old "gl powersave" + new "gl powersave" + + # renpy/common/00preferences.rpy:502 + old "gl framerate" + new "gl framerate" + + # renpy/common/00preferences.rpy:505 + old "gl tearing" + new "gl tearing" + + # renpy/common/00preferences.rpy:508 + old "font transform" + new "font transform" + + # renpy/common/00preferences.rpy:511 + old "font size" + new "font size" + + # renpy/common/00preferences.rpy:519 + old "font line spacing" + new "font line spacing" + + # renpy/common/00preferences.rpy:527 + old "system cursor" + new "system cursor" + + # renpy/common/00preferences.rpy:536 + old "renderer menu" + new "renderer menu" + + # renpy/common/00preferences.rpy:539 + old "accessibility menu" + new "accessibility menu" + + # renpy/common/00preferences.rpy:542 + old "high contrast text" + new "high contrast text" + + # renpy/common/00preferences.rpy:551 + old "audio when minimized" + new "audio when minimized" + + # renpy/common/00preferences.rpy:560 + old "audio when unfocused" + new "audio when unfocused" + + # renpy/common/00preferences.rpy:569 + old "web cache preload" + new "web cache preload" + + # renpy/common/00preferences.rpy:584 + old "voice after game menu" + new "voice after game menu" + + # renpy/common/00preferences.rpy:593 + old "restore window position" + new "restore window position" + + # renpy/common/00preferences.rpy:602 + old "mono audio" + new "mono audio" + + # renpy/common/00preferences.rpy:611 + old "font kerning" + new "font kerning" + + # renpy/common/00preferences.rpy:619 + old "reset" + new "reset" + + # renpy/common/00preferences.rpy:632 + old "main volume" + new "main volume" + + # renpy/common/00preferences.rpy:633 + old "music volume" + new "music volume" + + # renpy/common/00preferences.rpy:634 + old "sound volume" + new "sound volume" + + # renpy/common/00preferences.rpy:635 + old "voice volume" + new "voice volume" + + # renpy/common/00preferences.rpy:636 + old "mute main" + new "mute main" + + # renpy/common/00preferences.rpy:637 + old "mute music" + new "mute music" + + # renpy/common/00preferences.rpy:638 + old "mute sound" + new "mute sound" + + # renpy/common/00preferences.rpy:639 + old "mute voice" + new "mute voice" + + # renpy/common/00preferences.rpy:640 + old "mute all" + new "mute all" + + # renpy/common/00preferences.rpy:723 + old "Clipboard voicing enabled. Press 'shift+C' to disable." + new "Clipboard voicing enabled. Press 'shift+C' to disable." + + # renpy/common/00preferences.rpy:725 + old "Self-voicing would say \"[renpy.display.tts.last]\". Press 'alt+shift+V' to disable." + new "Self-voicing would say \"[renpy.display.tts.last]\". Press 'alt+shift+V' to disable." + + # renpy/common/00preferences.rpy:727 + old "Self-voicing enabled. Press 'v' to disable." + new "Self-voicing enabled. Press 'v' to disable." + + # renpy/common/00speechbubble.rpy:420 + old "Speech Bubble Editor" + new "Speech Bubble Editor" + + # renpy/common/00speechbubble.rpy:425 + old "(hide)" + new "(hide)" + + # renpy/common/00speechbubble.rpy:436 + old "(clear retained bubbles)" + new "(clear retained bubbles)" + + # renpy/common/00sync.rpy:70 + old "Sync downloaded." + new "Sync downloaded." + + # renpy/common/00sync.rpy:184 + old "Could not connect to the Ren'Py Sync server." + new "Could not connect to the Ren'Py Sync server." + + # renpy/common/00sync.rpy:186 + old "The Ren'Py Sync server timed out." + new "The Ren'Py Sync server timed out." + + # renpy/common/00sync.rpy:188 + old "An unknown error occurred while connecting to the Ren'Py Sync server." + new "An unknown error occurred while connecting to the Ren'Py Sync server." + + # renpy/common/00sync.rpy:204 + old "The Ren'Py Sync server does not have a copy of this sync. The sync ID may be invalid, or it may have timed out." + new "The Ren'Py Sync server does not have a copy of this sync. The sync ID may be invalid, or it may have timed out." + + # renpy/common/00sync.rpy:305 + old "Please enter the sync ID you generated.\nNever enter a sync ID you didn't create yourself." + new "Please enter the sync ID you generated.\nNever enter a sync ID you didn't create yourself." + + # renpy/common/00sync.rpy:324 + old "The sync ID is not in the correct format." + new "The sync ID is not in the correct format." + + # renpy/common/00sync.rpy:344 + old "The sync could not be decrypted." + new "The sync could not be decrypted." + + # renpy/common/00sync.rpy:367 + old "The sync belongs to a different game." + new "The sync belongs to a different game." + + # renpy/common/00sync.rpy:372 + old "The sync contains a file with an invalid name." + new "The sync contains a file with an invalid name." + + # renpy/common/00sync.rpy:425 + old "This will upload your saves to the {a=https://sync.renpy.org}Ren'Py Sync Server{/a}.\nDo you want to continue?" + new "This will upload your saves to the {a=https://sync.renpy.org}Ren'Py Sync Server{/a}.\nDo you want to continue?" + + # renpy/common/00sync.rpy:433 + old "Yes" + new "Yes" + + # renpy/common/00sync.rpy:434 + old "No" + new "No" + + # renpy/common/00sync.rpy:457 + old "Enter Sync ID" + new "Enter Sync ID" + + # renpy/common/00sync.rpy:468 + old "This will contact the {a=https://sync.renpy.org}Ren'Py Sync Server{/a}." + new "This will contact the {a=https://sync.renpy.org}Ren'Py Sync Server{/a}." + + # renpy/common/00sync.rpy:498 + old "Sync Success" + new "Sync Success" + + # renpy/common/00sync.rpy:501 + old "The Sync ID is:" + new "The Sync ID is:" + + # renpy/common/00sync.rpy:507 + old "You can use this ID to download your save on another device.\nThis sync will expire in an hour.\nRen'Py Sync is supported by {a=https://www.renpy.org/sponsors.html}Ren'Py's Sponsors{/a}." + new "You can use this ID to download your save on another device.\nThis sync will expire in an hour.\nRen'Py Sync is supported by {a=https://www.renpy.org/sponsors.html}Ren'Py's Sponsors{/a}." + + # renpy/common/00sync.rpy:511 + old "Continue" + new "Continue" + + # renpy/common/00sync.rpy:536 + old "Sync Error" + new "Sync Error" + + # renpy/common/00translation.rpy:63 + old "Translation identifier: [identifier]" + new "Translation identifier: [identifier]" + + # renpy/common/00translation.rpy:84 + old " translates [tl.filename]:[tl.linenumber]" + new " translates [tl.filename]:[tl.linenumber]" + + # renpy/common/00translation.rpy:101 + old "\n{color=#fff}Copied to clipboard.{/color}" + new "\n{color=#fff}Copied to clipboard.{/color}" + + # renpy/common/00iap.rpy:231 + old "Contacting App Store\nPlease Wait..." + new "Contacting App Store\nPlease Wait..." + + # renpy/common/00updater.rpy:415 + old "No update methods found." + new "No update methods found." + + # renpy/common/00updater.rpy:462 + old "Could not download file list: " + new "Could not download file list: " + + # renpy/common/00updater.rpy:465 + old "File list digest does not match." + new "File list digest does not match." + + # renpy/common/00updater.rpy:675 + old "An error is being simulated." + new "An error is being simulated." + + # renpy/common/00updater.rpy:863 + old "Either this project does not support updating, or the update status file was deleted." + new "Either this project does not support updating, or the update status file was deleted." + + # renpy/common/00updater.rpy:877 + old "This account does not have permission to perform an update." + new "This account does not have permission to perform an update." + + # renpy/common/00updater.rpy:880 + old "This account does not have permission to write the update log." + new "This account does not have permission to write the update log." + + # renpy/common/00updater.rpy:966 + old "Could not verify update signature." + new "Could not verify update signature." + + # renpy/common/00updater.rpy:1289 + old "The update file was not downloaded." + new "The update file was not downloaded." + + # renpy/common/00updater.rpy:1307 + old "The update file does not have the correct digest - it may have been corrupted." + new "The update file does not have the correct digest - it may have been corrupted." + + # renpy/common/00updater.rpy:1457 + old "While unpacking {}, unknown type {}." + new "While unpacking {}, unknown type {}." + + # renpy/common/00updater.rpy:1928 + old "Updater" + new "Updater" + + # renpy/common/00updater.rpy:1935 + old "An error has occurred:" + new "An error has occurred:" + + # renpy/common/00updater.rpy:1937 + old "Checking for updates." + new "Checking for updates." + + # renpy/common/00updater.rpy:1939 + old "This program is up to date." + new "This program is up to date." + + # renpy/common/00updater.rpy:1941 + old "[u.version] is available. Do you want to install it?" + new "[u.version] is available. Do you want to install it?" + + # renpy/common/00updater.rpy:1943 + old "Preparing to download the updates." + new "Preparing to download the updates." + + # renpy/common/00updater.rpy:1945 + old "Downloading the updates." + new "Downloading the updates." + + # renpy/common/00updater.rpy:1947 + old "Unpacking the updates." + new "Unpacking the updates." + + # renpy/common/00updater.rpy:1949 + old "Finishing up." + new "Finishing up." + + # renpy/common/00updater.rpy:1951 + old "The updates have been installed. The program will restart." + new "The updates have been installed. The program will restart." + + # renpy/common/00updater.rpy:1953 + old "The updates have been installed." + new "The updates have been installed." + + # renpy/common/00updater.rpy:1955 + old "The updates were cancelled." + new "The updates were cancelled." + + # renpy/common/00updater.rpy:1970 + old "Proceed" + new "Proceed" + + # renpy/common/00updater.rpy:1986 + old "Preparing to download the game data." + new "Preparing to download the game data." + + # renpy/common/00updater.rpy:1988 + old "Downloading the game data." + new "Downloading the game data." + + # renpy/common/00updater.rpy:1990 + old "The game data has been downloaded." + new "The game data has been downloaded." + + # renpy/common/00updater.rpy:1992 + old "An error occurred when trying to download game data:" + new "An error occurred when trying to download game data:" + + # renpy/common/00updater.rpy:1997 + old "This game cannot be run until the game data has been downloaded." + new "This game cannot be run until the game data has been downloaded." + + # renpy/common/00updater.rpy:2004 + old "Retry" + new "Retry" + + # renpy/common/00compat.rpy:467 + old "Fullscreen" + new "Fullscreen" + + # renpy/common/00gallery.rpy:676 + old "Image [index] of [count] locked." + new "Image [index] of [count] locked." + + # renpy/common/00gallery.rpy:696 + old "prev" + new "prev" + + # renpy/common/00gallery.rpy:697 + old "next" + new "next" + + # renpy/common/00gallery.rpy:698 + old "slideshow" + new "slideshow" + + # renpy/common/00gallery.rpy:699 + old "return" + new "return" + + # renpy/common/00gltest.rpy:89 + old "Renderer" + new "Renderer" + + # renpy/common/00gltest.rpy:91 + old "Automatically Choose" + new "Automatically Choose" + + # renpy/common/00gltest.rpy:96 + old "Force GL2 Renderer" + new "Force GL2 Renderer" + + # renpy/common/00gltest.rpy:101 + old "Force ANGLE2 Renderer" + new "Force ANGLE2 Renderer" + + # renpy/common/00gltest.rpy:106 + old "Force GLES2 Renderer" + new "Force GLES2 Renderer" + + # renpy/common/00gltest.rpy:110 + old "Gamepad" + new "Gamepad" + + # renpy/common/00gltest.rpy:112 + old "Enable (No Blocklist)" + new "Enable (No Blocklist)" + + # renpy/common/00gltest.rpy:126 + old "Calibrate" + new "Calibrate" + + # renpy/common/00gltest.rpy:135 + old "Powersave" + new "Powersave" + + # renpy/common/00gltest.rpy:145 + old "Framerate" + new "Framerate" + + # renpy/common/00gltest.rpy:147 + old "Screen" + new "Screen" + + # renpy/common/00gltest.rpy:151 + old "60" + new "60" + + # renpy/common/00gltest.rpy:155 + old "30" + new "30" + + # renpy/common/00gltest.rpy:159 + old "Tearing" + new "Tearing" + + # renpy/common/00gltest.rpy:171 + old "Changes will take effect the next time this program is run." + new "Changes will take effect the next time this program is run." + + # renpy/common/00gltest.rpy:178 + old "Quit" + new "Quit" + + # renpy/common/00gltest.rpy:207 + old "Performance Warning" + new "Performance Warning" + + # renpy/common/00gltest.rpy:212 + old "This computer is using software rendering." + new "This computer is using software rendering." + + # renpy/common/00gltest.rpy:214 + old "This game requires use of GL2 that can't be initialised." + new "This game requires use of GL2 that can't be initialised." + + # renpy/common/00gltest.rpy:216 + old "This computer has a problem displaying graphics: [problem]." + new "This computer has a problem displaying graphics: [problem]." + + # renpy/common/00gltest.rpy:220 + old "Its graphics drivers may be out of date or not operating correctly. This can lead to slow or incorrect graphics display." + new "Its graphics drivers may be out of date or not operating correctly. This can lead to slow or incorrect graphics display." + + # renpy/common/00gltest.rpy:224 + old "The {a=edit:1:log.txt}log.txt{/a} file may contain information to help you determine what is wrong with your computer." + new "The {a=edit:1:log.txt}log.txt{/a} file may contain information to help you determine what is wrong with your computer." + + # renpy/common/00gltest.rpy:229 + old "More details on how to fix this can be found in the {a=[url]}documentation{/a}." + new "More details on how to fix this can be found in the {a=[url]}documentation{/a}." + + # renpy/common/00gltest.rpy:234 + old "Continue, Show this warning again" + new "Continue, Show this warning again" + + # renpy/common/00gltest.rpy:238 + old "Continue, Don't show warning again" + new "Continue, Don't show warning again" + + # renpy/common/00gltest.rpy:246 + old "Change render options" + new "Change render options" + + # renpy/common/00gamepad.rpy:33 + old "Select Gamepad to Calibrate" + new "Select Gamepad to Calibrate" + + # renpy/common/00gamepad.rpy:36 + old "No Gamepads Available" + new "No Gamepads Available" + + # renpy/common/00gamepad.rpy:56 + old "Calibrating [name] ([i]/[total])" + new "Calibrating [name] ([i]/[total])" + + # renpy/common/00gamepad.rpy:60 + old "Press or move the '[control!s]' [kind]." + new "Press or move the '[control!s]' [kind]." + + # renpy/common/00gamepad.rpy:70 + old "Skip (A)" + new "Skip (A)" + + # renpy/common/00gamepad.rpy:73 + old "Back (B)" + new "Back (B)" + + # renpy/common/_errorhandling.rpym:764 + old "Open" + new "Open" + + # renpy/common/_errorhandling.rpym:766 + old "Opens the traceback.txt file in a text editor." + new "Opens the traceback.txt file in a text editor." + + # renpy/common/_errorhandling.rpym:768 + old "Copy BBCode" + new "Copy BBCode" + + # renpy/common/_errorhandling.rpym:770 + old "Copies the traceback.txt file to the clipboard as BBcode for forums like https://lemmasoft.renai.us/." + new "Copies the traceback.txt file to the clipboard as BBcode for forums like https://lemmasoft.renai.us/." + + # renpy/common/_errorhandling.rpym:772 + old "Copy Markdown" + new "Copy Markdown" + + # renpy/common/_errorhandling.rpym:774 + old "Copies the traceback.txt file to the clipboard as Markdown for Discord." + new "Copies the traceback.txt file to the clipboard as Markdown for Discord." + + # renpy/common/_errorhandling.rpym:806 + old "An exception has occurred." + new "An exception has occurred." + + # renpy/common/_errorhandling.rpym:835 + old "Rollback" + new "Rollback" + + # renpy/common/_errorhandling.rpym:837 + old "Attempts a roll back to a prior time, allowing you to save or choose a different choice." + new "Attempts a roll back to a prior time, allowing you to save or choose a different choice." + + # renpy/common/_errorhandling.rpym:840 + old "Ignore" + new "Ignore" + + # renpy/common/_errorhandling.rpym:844 + old "Ignores the exception, allowing you to continue." + new "Ignores the exception, allowing you to continue." + + # renpy/common/_errorhandling.rpym:846 + old "Ignores the exception, allowing you to continue. This often leads to additional errors." + new "Ignores the exception, allowing you to continue. This often leads to additional errors." + + # renpy/common/_errorhandling.rpym:850 + old "Reload" + new "Reload" + + # renpy/common/_errorhandling.rpym:852 + old "Reloads the game from disk, saving and restoring game state if possible." + new "Reloads the game from disk, saving and restoring game state if possible." + + # renpy/common/_errorhandling.rpym:855 + old "Console" + new "Console" + + # renpy/common/_errorhandling.rpym:857 + old "Opens a console to allow debugging the problem." + new "Opens a console to allow debugging the problem." + + # renpy/common/_errorhandling.rpym:870 + old "Quits the game." + new "Quits the game." + + # renpy/common/_errorhandling.rpym:892 + old "Parsing the script failed." + new "Parsing the script failed." + + # renpy/common/_developer/developer.rpym:39 + old "Developer Menu" + new "Developer Menu" + + # renpy/common/_developer/developer.rpym:44 + old "Interactive Director (D)" + new "Interactive Director (D)" + + # renpy/common/_developer/developer.rpym:46 + old "Reload Game (Shift+R)" + new "Reload Game (Shift+R)" + + # renpy/common/_developer/developer.rpym:48 + old "Console (Shift+O)" + new "Console (Shift+O)" + + # renpy/common/_developer/developer.rpym:50 + old "Variable Viewer" + new "Variable Viewer" + + # renpy/common/_developer/developer.rpym:52 + old "Persistent Viewer" + new "Persistent Viewer" + + # renpy/common/_developer/developer.rpym:54 + old "Image Location Picker" + new "Image Location Picker" + + # renpy/common/_developer/developer.rpym:56 + old "Filename List" + new "Filename List" + + # renpy/common/_developer/developer.rpym:60 + old "Show Image Load Log (F4)" + new "Show Image Load Log (F4)" + + # renpy/common/_developer/developer.rpym:63 + old "Hide Image Load Log (F4)" + new "Hide Image Load Log (F4)" + + # renpy/common/_developer/developer.rpym:66 + old "Image Attributes" + new "Image Attributes" + + # renpy/common/_developer/developer.rpym:70 + old "Show Translation Info" + new "Show Translation Info" + + # renpy/common/_developer/developer.rpym:73 + old "Hide Translation Info" + new "Hide Translation Info" + + # renpy/common/_developer/developer.rpym:78 + old "Speech Bubble Editor (Shift+B)" + new "Speech Bubble Editor (Shift+B)" + + # renpy/common/_developer/developer.rpym:82 + old "Show Filename and Line" + new "Show Filename and Line" + + # renpy/common/_developer/developer.rpym:85 + old "Hide Filename and Line" + new "Hide Filename and Line" + + # renpy/common/_developer/developer.rpym:141 + old "Layer [l]:" + new "Layer [l]:" + + # renpy/common/_developer/developer.rpym:144 + old " (transforms: [', '.join(transform_list)])" + new " (transforms: [', '.join(transform_list)])" + + # renpy/common/_developer/developer.rpym:148 + old " [name!q] [attributes!q] (hidden)" + new " [name!q] [attributes!q] (hidden)" + + # renpy/common/_developer/developer.rpym:152 + old " [name!q] [attributes!q]" + new " [name!q] [attributes!q]" + + # renpy/common/_developer/developer.rpym:205 + old "Nothing to inspect." + new "Nothing to inspect." + + # renpy/common/_developer/developer.rpym:216 + old "Hide deleted" + new "Hide deleted" + + # renpy/common/_developer/developer.rpym:216 + old "Show deleted" + new "Show deleted" + + # renpy/common/_developer/developer.rpym:367 + old "Rectangle copied to clipboard." + new "Rectangle copied to clipboard." + + # renpy/common/_developer/developer.rpym:370 + old "Position copied to clipboard." + new "Position copied to clipboard." + + # renpy/common/_developer/developer.rpym:382 + old "Rectangle: %r" + new "Rectangle: %r" + + # renpy/common/_developer/developer.rpym:385 + old "Mouse position: %r" + new "Mouse position: %r" + + # renpy/common/_developer/developer.rpym:390 + old "Right-click or escape to quit." + new "Right-click or escape to quit." + + # renpy/common/_developer/developer.rpym:440 + old "Type to filter: " + new "Type to filter: " + + # renpy/common/_developer/developer.rpym:556 + old "Textures: [tex_count] ([tex_size_mb:.1f] MB)" + new "Textures: [tex_count] ([tex_size_mb:.1f] MB)" + + # renpy/common/_developer/developer.rpym:560 + old "Image cache: [cache_pct:.1f]% ([cache_size_mb:.1f] MB)" + new "Image cache: [cache_pct:.1f]% ([cache_size_mb:.1f] MB)" + + # renpy/common/_developer/developer.rpym:570 + old "✔ " + new "✔ " + + # renpy/common/_developer/developer.rpym:573 + old "✘ " + new "✘ " + + # renpy/common/_developer/developer.rpym:578 + old "\n{color=#cfc}✔ predicted image (good){/color}\n{color=#fcc}✘ unpredicted image (bad){/color}\n{color=#fff}Drag to move.{/color}" + new "\n{color=#cfc}✔ predicted image (good){/color}\n{color=#fcc}✘ unpredicted image (bad){/color}\n{color=#fff}Drag to move.{/color}" + + # renpy/common/_developer/developer.rpym:628 + old "Click to open in editor." + new "Click to open in editor." + + # renpy/common/_developer/inspector.rpym:39 + old "Displayable Inspector" + new "Displayable Inspector" + + # renpy/common/_developer/inspector.rpym:62 + old "Size" + new "Size" + + # renpy/common/_developer/inspector.rpym:66 + old "Style" + new "Style" + + # renpy/common/_developer/inspector.rpym:72 + old "Location" + new "Location" + + # renpy/common/_developer/inspector.rpym:124 + old "Inspecting Styles of [displayable_name!q]" + new "Inspecting Styles of [displayable_name!q]" + + # renpy/common/_developer/inspector.rpym:141 + old "displayable:" + new "displayable:" + + # renpy/common/_developer/inspector.rpym:147 + old " (no properties affect the displayable)" + new " (no properties affect the displayable)" + + # renpy/common/_developer/inspector.rpym:149 + old " (default properties omitted)" + new " (default properties omitted)" + + # renpy/common/_developer/inspector.rpym:187 + old "" + new "" + + # renpy/common/00console.rpy:501 + old "Press to exit console. Type help for help.\n" + new "Press to exit console. Type help for help.\n" + + # renpy/common/00console.rpy:505 + old "Ren'Py script enabled." + new "Ren'Py script enabled." + + # renpy/common/00console.rpy:507 + old "Ren'Py script disabled." + new "Ren'Py script disabled." + + # renpy/common/00console.rpy:690 + old "The console is using short representations. To disable this, type 'long', and to re-enable, type 'short'" + new "The console is using short representations. To disable this, type 'long', and to re-enable, type 'short'" + + # renpy/common/00console.rpy:762 + old "help: show this help\n help : show signature and documentation of " + new "help: show this help\n help : show signature and documentation of " + + # renpy/common/00console.rpy:786 + old "Help may display undocumented functions. Please check that the function or\nclass you want to use is documented.\n\n" + new "Help may display undocumented functions. Please check that the function or\nclass you want to use is documented.\n\n" + + # renpy/common/00console.rpy:795 + old "commands:\n" + new "commands:\n" + + # renpy/common/00console.rpy:805 + old " : run the statement\n" + new " : run the statement\n" + + # renpy/common/00console.rpy:807 + old " : run the expression or statement" + new " : run the expression or statement" + + # renpy/common/00console.rpy:815 + old "clear: clear the console history" + new "clear: clear the console history" + + # renpy/common/00console.rpy:819 + old "exit: exit the console" + new "exit: exit the console" + + # renpy/common/00console.rpy:827 + old "stack: print the return stack" + new "stack: print the return stack" + + # renpy/common/00console.rpy:849 + old "load : loads the game from slot" + new "load : loads the game from slot" + + # renpy/common/00console.rpy:862 + old "save : saves the game in slot" + new "save : saves the game in slot" + + # renpy/common/00console.rpy:873 + old "reload: reloads the game, refreshing the scripts" + new "reload: reloads the game, refreshing the scripts" + + # renpy/common/00console.rpy:881 + old "watch : watch a python expression\n watch short: makes the representation of traced expressions short (default)\n watch long: makes the representation of traced expressions as is" + new "watch : watch a python expression\n watch short: makes the representation of traced expressions short (default)\n watch long: makes the representation of traced expressions as is" + + # renpy/common/00console.rpy:918 + old "unwatch : stop watching an expression" + new "unwatch : stop watching an expression" + + # renpy/common/00console.rpy:964 + old "unwatchall: stop watching all expressions" + new "unwatchall: stop watching all expressions" + + # renpy/common/00console.rpy:985 + old "jump