From 1a988e6a6769d7a9bbc9956da80ee2dfc2200d64 Mon Sep 17 00:00:00 2001 From: Niclas Dobbertin Date: Tue, 9 Jan 2024 08:29:40 +0100 Subject: character-action-button structure start --- characters.py | 26 ++++++++++++++++++++++++++ ui.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 characters.py create mode 100644 ui.py diff --git a/characters.py b/characters.py new file mode 100644 index 0000000..6166323 --- /dev/null +++ b/characters.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 + +import ui +from enum import Enum + +Status = Enum("Status", ["NEUTRAL", "DOWN", "ATTACKING", "HIT"]) + + +class Action: + def __init__(self, name, button): + self.name = name + self.button = button + + +class Cowboy: + hp = 1000 + frame_advantage = 0 + status = Status.NEUTRAL + position = (0,0) + + all_actions = ( + Action("slash", ui.Button("attack1")), + Action("jump", ui.Button("move1")), + Action("block", ui.Button("move2")), + Action("hold", ui.Button("hold")), + ) diff --git a/ui.py b/ui.py new file mode 100644 index 0000000..e119350 --- /dev/null +++ b/ui.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 + +RESOLUTION = "x19201080" + +class Button: + def __init__(self, name) -> None: + self.position = button_locations[RESOLUTION][name] + + +button_locations = { + "x19201080": { + "move1": (0, 0), + "move2": (0, 1), + "move3": (0, 2), + "move4": (0, 3), + "move5": (0, 4), + "move6": (0, 5), + "attack1": (1, 0), + "attack2": (1, 1), + "attack3": (1, 2), + "attack4": (1, 3), + "attack5": (1, 4), + "attack6": (1, 5), + "special1": (1, 0), + "special2": (1, 1), + "special3": (1, 2), + "special4": (1, 3), + "special5": (1, 4), + "special6": (1, 5), + "hold": (2, 5), + } +} -- cgit v1.2.3