Compare commits

...

3 commits

Author SHA1 Message Date
4a47efe94d Merge pull request 'changed NPC talk key to f and resolved merge conflicts' (#77) from Spafi/game:main into Development
Reviewed-on: #77
2024-03-10 11:46:45 +00:00
SpagettiFisch
4ccc2dde11 Merge branch 'main' of https://git.spafi.eu/Spafi/game
Signed-off-by: SpagettiFisch <63868515+SpagettiFisch@users.noreply.github.com>
2024-03-10 12:42:41 +01:00
SpagettiFisch
67a0937c4b changed NPC talking key to f
Signed-off-by: SpagettiFisch <63868515+SpagettiFisch@users.noreply.github.com>
2024-03-10 12:42:09 +01:00

View file

@ -75,13 +75,13 @@ class NPC(Objects):
self.conversation.draw(screen) self.conversation.draw(screen)
def update(self, keys, objects): def update(self, keys, objects):
if self.lastUpdate + 200 < pg.time.get_ticks(): if self.lastUpdate + 200 < pg.time.get_ticks():
if self.talking: if self.talking:
self.conversation.update(keys, objects) self.conversation.update(keys, objects)
self.lastUpdate = pg.time.get_ticks() self.lastUpdate = pg.time.get_ticks()
else: else:
touches = pg.sprite.spritecollideany(self, objects[0]) touches = pg.sprite.spritecollideany(self, objects[0])
if touches is not None and keys[pg.K_SPACE] and isinstance(touches, MainCharacter): if touches is not None and keys[pg.K_f] and isinstance(touches, MainCharacter):
self.talk(objects) self.talk(objects)
self.lastUpdate = pg.time.get_ticks() self.lastUpdate = pg.time.get_ticks()