Return to repo list

heart-of-gold

Tactical RPG written in python, using pygame.
Return to HMagellan.com

commit fb2614839923399f1621c9ee2092077c958bcf0b
parent d4f9a85b1e193e38d2419a8892deffc6414a4c3f
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Sat, 17 Oct 2020 00:27:23 -0500

Mostly new images for still scenes

Diffstat:
MLICENSE | 1+
Adata/img/continue_prompt_1.png | 0
Adata/img/still_scene_name_box_1.png | 0
Adata/img/still_scene_text_box_1.png | 0
Mdata/json/sheets.json | 15+++++++++++++++
Msrc/scene.py | 20+++++++++++++++++++-
6 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/LICENSE b/LICENSE @@ -7,6 +7,7 @@ Licensing details for Heart of Gold: MEDIA EXCEPTIONS: The following files are derived from other free sources, and are released under different licenses noted here: 1) data/img/jisella_1.png - CC0, Derived from "Dungeon Crawl Supplemental Tiles" taken from here: http://opengameart.org/content/dungeon-crawl-32x32-tiles-supplemental + 2) data/img/{still_scene_text_box_1.png,still_scene_name_box_1.png,continue_prompt_1.png} - CC0, Derived from "GUI Elements" taken from here: https://opengameart.org/content/gui-elements Following is the text of all licenses mentioned above: diff --git a/data/img/continue_prompt_1.png b/data/img/continue_prompt_1.png Binary files differ. diff --git a/data/img/still_scene_name_box_1.png b/data/img/still_scene_name_box_1.png Binary files differ. diff --git a/data/img/still_scene_text_box_1.png b/data/img/still_scene_text_box_1.png Binary files differ. diff --git a/data/json/sheets.json b/data/json/sheets.json @@ -9,6 +9,21 @@ "dimensions" : [100, 50], "total_sprites" : 16 }, + "still_scene_text_box_1" : { + "filename" : "still_scene_text_box_1.png", + "dimensions" : [1024, 260], + "total_sprites" : 1 + }, + "still_scene_name_box_1" : { + "filename" : "still_scene_name_box_1.png", + "dimensions" : [150, 54], + "total_sprites" : 1 + }, + "continue_prompt_1" : { + "filename" : "continue_prompt_1.png", + "dimensions" : [32, 13], + "total_sprites" : 9 + }, "jisella_1" : { "filename" : "jisella_1.png", "dimensions" : [64, 64], diff --git a/src/scene.py b/src/scene.py @@ -38,7 +38,7 @@ class SceneManager(manager.Manager): """ if surface != None: if isinstance(self.current_scene, StillScene): - pass + self.current_scene.update(surface) else: pass @@ -66,6 +66,11 @@ class StillScene(object): self.text_speed = 10 self.text_write_timer = 0 + # Universal elements + self.name_box = None + self.text_box = None + self.continue_prompt = None + # Swap-in values self.displayed_characters = pygame.sprite.LayeredDirty() self.current_text_string = "" @@ -80,6 +85,11 @@ class StillScene(object): """ Load a scene from file. """ + # Load univeral elements + self.name_box = vgo.VGO(self.game.sheet_manager.loaded_sheets["still_scene_name_box_1"]) + self.text_box = vgo.VGO(self.game.sheet_manager.loaded_sheets["still_scene_text_box_1"]) + + # Load from scene definition JSON scenedef = json.load(open(os.path.join(SCENE_JSON_PATH, scenefile))) self.name = scenedef["name"] @@ -90,3 +100,11 @@ class StillScene(object): nc = vgo.VGO(self.game.sheet_manager.loaded_sheets[scenedef["characters"][c]["sheet"]], tuple(scenedef["characters"][c]["sprite"])) nc.custom_flags = c # TODO: Hacky solution for now, fix later self.characters[scenedef["characters"][c]["name"]] = nc + + def update(self, surface = None): + """ + Update the StillScene and draw visible elements. + """ + if surface != None: + self.displayed_characters.update(surface) +