update your position every 10 ticks
This commit is contained in:
parent
8b7a24b908
commit
e904501021
1 changed files with 3 additions and 4 deletions
|
|
@ -70,11 +70,10 @@ class Client:
|
||||||
if self.moving_right:
|
if self.moving_right:
|
||||||
self.hero.x += speed
|
self.hero.x += speed
|
||||||
|
|
||||||
|
if self.ticks % 10 == 0:
|
||||||
HeroUpdate(
|
HeroUpdate(
|
||||||
**{k: v for k, v in self.hero.dict().items() if v is not None}
|
**{k: v for k, v in self.hero.dict().items() if v is not None}
|
||||||
).update()
|
).update()
|
||||||
|
|
||||||
if self.ticks % 10 == 0:
|
|
||||||
self.others = [hero for hero in HeroRead.list() if hero.id != self.hero.id]
|
self.others = [hero for hero in HeroRead.list() if hero.id != self.hero.id]
|
||||||
|
|
||||||
def render(self):
|
def render(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue