Return to repo list

heart-of-gold

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

commit 09e95f907aa11b5b578cdf145d0a67857508c475
parent d4a1a38f99a9d6d80a7b813d6dcfd72bbf80ee04
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Mon, 23 Nov 2020 21:56:41 -0600

added level and exp display

Diffstat:
Msrc/status.py | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/status.py b/src/status.py @@ -36,6 +36,10 @@ class StatusDisplay(entity.Entity): self.name_surface_rect = None self.class_surface = None self.class_surface_rect = None + self.level_surface = None + self.level_surface_rect = None + self.exp_surface = None + self.exp_surface_rec = None self.stat_surfaces = { i: None for i in self.stat_def["normal_stats"].keys() } self.stat_surface_rects = { i: None for i in self.stat_def["normal_stats"].keys() } self.equipment_surfaces = { i: None for i in self.stat_def["equipment"].keys() } @@ -46,6 +50,8 @@ class StatusDisplay(entity.Entity): self.affinity_icon_position = (504, 84) self.name_surface_position = (94, 95) self.class_surface_position = (94, 152) + self.level_surface_rect_position = (800, 620) + self.exp_surface_rect_position = (790, 640) self.stat_surfaces_position = (140, 218) self.equipment_surfaces_position = (510, 224) @@ -73,6 +79,12 @@ class StatusDisplay(entity.Entity): self.class_surface = self.font.render(self.stat_def["class"], False, (0, 0, 0)).convert() self.class_surface_rect = self.class_surface.get_rect() self.class_surface_rect.topleft = self.class_surface_position + self.level_surface = self.font.render("LVL: " + str(self.stat_def["level"]), False, (0, 0, 0)).convert() + self.level_surface_rect = self.level_surface.get_rect() + self.level_surface_rect.topleft = self.level_surface_rect_position + self.exp_surface = self.font.render("EXP: " + str(self.stat_def["exp"]), False, (0, 0, 0)).convert() + self.exp_surface_rect = self.exp_surface.get_rect() + self.exp_surface_rect.topleft = self.exp_surface_rect_position self.stat_surfaces["ATK"] = self.font.render(str(self.stat_def["active_stats"]["ATK"]), False, (0, 0, 0)).convert() self.stat_surface_rects["ATK"] = self.stat_surfaces["ATK"].get_rect() self.stat_surface_rects["ATK"].topleft = self.stat_surfaces_position @@ -137,6 +149,8 @@ class StatusDisplay(entity.Entity): super().update(surface) surface.blit(self.name_surface, self.name_surface_rect) surface.blit(self.class_surface, self.class_surface_rect) + surface.blit(self.level_surface, self.level_surface_rect) + surface.blit(self.exp_surface, self.exp_surface_rect) for s in self.stat_surfaces: if self.stat_surfaces[s] != None: surface.blit(self.stat_surfaces[s], self.stat_surface_rects[s])