Jobb sétálás animáció
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 496 B After Width: | Height: | Size: 481 B |
@@ -36,12 +36,12 @@ class BalthasarRenderer:
|
||||
|
||||
def update(self):
|
||||
self.anim_timer += 1
|
||||
if self.anim_timer > 30:
|
||||
if self.anim_timer >= 30:
|
||||
self.anim_timer = 0
|
||||
|
||||
def render(self, game, _):
|
||||
sprite_h = self.direction if self.direction < 3 else 2
|
||||
sprite_v = 1 if (self.walking and self.anim_timer <= 15) else 0
|
||||
sprite_v = ((self.anim_timer // 15) + 1) if self.walking else 0
|
||||
flip_h = self.direction == DIR_LEFT
|
||||
|
||||
sprite = assets.sprites["balthasar"].get_texture(arcade.LBWH(B_SPRITE_WIDHT*sprite_h, B_SPRITE_HEIGHT*sprite_v, B_SPRITE_WIDHT, B_SPRITE_HEIGHT))
|
||||
@@ -172,4 +172,4 @@ class TestObject:
|
||||
|
||||
def on_interact(self, start_battle_func):
|
||||
print("never gonna give you up")
|
||||
start_battle_func(0)
|
||||
start_battle_func(0)
|
||||
|
||||
Reference in New Issue
Block a user