objektum interakció
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user