From 67a0937c4b99225b111925d781f27f5657f35caf Mon Sep 17 00:00:00 2001 From: SpagettiFisch <63868515+SpagettiFisch@users.noreply.github.com> Date: Sun, 10 Mar 2024 12:42:09 +0100 Subject: [PATCH] changed NPC talking key to f Signed-off-by: SpagettiFisch <63868515+SpagettiFisch@users.noreply.github.com> --- viecher.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/viecher.py b/viecher.py index 5d11e6c..43c37e3 100644 --- a/viecher.py +++ b/viecher.py @@ -74,9 +74,17 @@ class NPC(Objects): if self.talking: self.conversation.draw(screen) - def update(self, keys, objects): - if self.talking: - self.conversation.update(keys, objects) + def update(self, keys, objects): + if self.lastUpdate + 200 < pg.time.get_ticks(): + if self.talking: + self.conversation.update(keys, objects) + self.lastUpdate = pg.time.get_ticks() + else: + touches = pg.sprite.spritecollideany(self, objects[0]) + if touches is not None and keys[pg.K_f] and isinstance(touches, MainCharacter): + self.talk(objects) + self.lastUpdate = pg.time.get_ticks() + class Convo(Label): def __init__(self, text, convo_act, person, x = 140, y = 600, width = 1000, height = 100, font='simple', font_size = 20) -> None: -- 2.45.3