fix update position bug

This commit is contained in:
DasMoorhuhn 2024-12-12 20:24:09 +01:00
parent 3e8e04c5fa
commit 4535d43dfe

13
vpet.py
View File

@ -122,7 +122,7 @@ class Activity:
class VPet: class VPet:
def __init__(self, move, pos, draw, x=0, y=40, screen=1): def __init__(self, move, pos, draw, x=0, y=100, screen=1):
self.screen = screen self.screen = screen
self.pos = pos self.pos = pos
self.x_postion = x self.x_postion = x
@ -139,13 +139,16 @@ class VPet:
def action_loop(self): def action_loop(self):
# print(f'Interacting with user: {self.activity.is_interacting_with_user}') # print(f'Interacting with user: {self.activity.is_interacting_with_user}')
self.update_position()
print(self.x_postion, self.y_postion)
if self.activity.is_interacting_with_user: return if self.activity.is_interacting_with_user: return
self.x_postion = self.pos().x() + 3
self.draw(self.frames.idle_1) self.draw(self.frames.idle_1)
self.move(self.x_postion, self.y_postion + 100) self.move(self.x_postion, self.y_postion)
self.x_postion = self.pos().x() + 1
if self.activity.is_sleeping: def update_position(self):
pass self.x_postion = self.pos().x()
self.y_postion = self.pos().y()
def choose_walk_destination(self): def choose_walk_destination(self):
"""Decide, where the VPet should move to""" """Decide, where the VPet should move to"""