Akció animációk
This commit is contained in:
@@ -13,16 +13,19 @@ enemies = []
|
||||
party_members = []
|
||||
enemy_turn = None
|
||||
battle_music = None
|
||||
enemy_ai_data = {}
|
||||
party_menus = []
|
||||
spells = []
|
||||
inventory = []
|
||||
|
||||
action_queue = []
|
||||
enemy_ai_data = {}
|
||||
cur_action = None
|
||||
action_timer = 0
|
||||
|
||||
party_text = TextRenderer(3, 206, 210)
|
||||
ene_text = TextRenderer(123, 206, 210)
|
||||
menu_text = TextRenderer(3, 76, 210)
|
||||
action_text = TextRenderer(110, 215, 210)
|
||||
|
||||
menu_open = 0
|
||||
menu_queue = []
|
||||
@@ -54,14 +57,14 @@ def menu_action(data):
|
||||
case "unselectable":
|
||||
return
|
||||
case "phys_att":
|
||||
action_queue.append(Action("Physical Attack", user, eparty[0], Damage(166, 0, 0, 0), StatusChange(0, 0, 0)))
|
||||
action_queue.append(Action("Physical Attack", user, eparty[0], Damage(166, 0, 0, 0), StatusChange(0, 0, 0), battle_data.anim_default))
|
||||
close_menu()
|
||||
case _:
|
||||
print(f"Unknown action: {action}")
|
||||
close_menu()
|
||||
|
||||
def update(game, dt):
|
||||
global menu_open
|
||||
global menu_open, cur_action, action_timer
|
||||
|
||||
for e in enemies:
|
||||
if e.ko or e.stone:
|
||||
@@ -82,11 +85,19 @@ def update(game, dt):
|
||||
menu_queue.append(p)
|
||||
p.atb = math.inf
|
||||
|
||||
if len(action_queue) != 0:
|
||||
if len(action_queue) != 0 and cur_action == None:
|
||||
action = action_queue.pop(0)
|
||||
print(f"Executing: {action}")
|
||||
action.execute()
|
||||
cur_action = action
|
||||
action_timer = 0
|
||||
|
||||
if cur_action != None:
|
||||
if cur_action.animation(cur_action, action_text, action_timer, dt):
|
||||
cur_action = None
|
||||
else:
|
||||
action_timer += dt
|
||||
|
||||
|
||||
# Szövegek Frissítése
|
||||
partytext = ""
|
||||
enetext = ""
|
||||
@@ -128,4 +139,5 @@ def draw(game):
|
||||
party_text.render()
|
||||
ene_text.render()
|
||||
menu_text.render()
|
||||
action_text.render()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user