attack now with left mouse click

emter conversaton now with f
no change to leave conversation

Signed-off-by: SpagettiFisch <63868515+SpagettiFisch@users.noreply.github.com>
This commit is contained in:
SpagettiFisch 2024-03-07 20:50:09 +01:00
parent a68bba70bb
commit 31a9742a9c

View file

@ -162,7 +162,7 @@ class MainCharacter(Fighter):
self.y -= (2 + self.rect.height - (touches.rect.y - self.y))
return
elif isinstance(touches, NPC):
if keys[pg.K_SPACE]:
if keys[pg.K_f]:
touches.talk(objects)
return
else:
@ -188,7 +188,7 @@ class MainCharacter(Fighter):
def attack(self, obj, mouse):
if self.lastAttack + self.attack_speed * 1000 < pg.time.get_ticks():
moveto = mouse- vec(self.x, self.y)
moveto = mouse - vec(self.x, self.y)
if self.book.current_sp == 'fireball':
weapon = Fireball('fb1', 100, self.x, self.y, moveto, 5)
elif self.book.current_sp == 'windslash':
@ -201,7 +201,7 @@ class MainCharacter(Fighter):
def update(self, keys, mouse, objects):
if not self.talking:
self.walk(keys, objects)
if keys[pg.K_f]:
if pg.mouse.get_pressed()[0]:
self.attack(objects, vec(mouse))
self.speech.update(self)
if self.health.health <= 0: