objektum interakció

This commit is contained in:
markojozsef
2026-10-14 12:47:39 +02:00
parent 88c1ed0f0c
commit d428aed8c8
2 changed files with 49 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
import assets
import arcade
# Main character(balthasar) renderer
# Main character renderer
DIR_DOWN = 0
DIR_UP = 1
DIR_RIGHT = 2
@@ -17,6 +17,7 @@ class BalthasarRenderer:
self.direction = DIR_UP
self.walking = False
self.anim_timer = 0
self.interactive = False
self.x = 0
self.y = 0
self.w = B_SPRITE_WIDHT
@@ -51,7 +52,6 @@ class BalthasarRenderer:
)
# Overworld Map
OVERWORLD_LB_X = 0
OVERWORLD_LB_Y = 0
OVERWORLD_TILE_WIDTH = 16
@@ -153,13 +153,13 @@ class OverworldMap:
)
# Teszt objektum
class TestObject:
def __init__(self, x, y):
self.x = x
self.y = y
self.w = 16
self.h = 16
self.interactive = True
def get_aabb(self):
return self.x, self.y, self.x + self.w, self.y + self.h
@@ -169,3 +169,7 @@ class TestObject:
arcade.LBWH(self.x, self.y, 16, 16).move(*translation),
arcade.color.PURPLE,
)
def on_interact(self, start_battle_func):
print("never gonna give you up")
start_battle_func(0)