update your position every 10 ticks

This commit is contained in:
Waylon Walker 2023-06-10 19:12:52 -05:00
parent 8b7a24b908
commit e904501021
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4

View file

@ -70,11 +70,10 @@ class Client:
if self.moving_right:
self.hero.x += speed
HeroUpdate(
**{k: v for k, v in self.hero.dict().items() if v is not None}
).update()
if self.ticks % 10 == 0:
HeroUpdate(
**{k: v for k, v in self.hero.dict().items() if v is not None}
).update()
self.others = [hero for hero in HeroRead.list() if hero.id != self.hero.id]
def render(self):