fix update position bug
This commit is contained in:
parent
3e8e04c5fa
commit
4535d43dfe
15
vpet.py
15
vpet.py
@ -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
|
|
||||||
|
def update_position(self):
|
||||||
if self.activity.is_sleeping:
|
self.x_postion = self.pos().x()
|
||||||
pass
|
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"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user