diff --git a/dungeonbattle/menus.py b/dungeonbattle/menus.py new file mode 100644 index 0000000..e188864 --- /dev/null +++ b/dungeonbattle/menus.py @@ -0,0 +1,14 @@ +class Menu: + + def __init__(self, values:list): + self.values = values + self.position = 0 + + def go_up(self): + self.position = max(0, self.position -1) + + def go_down(self): + self.position = min(len(self.values)-1, self.position +1) + + def validate(self): + return self.values[self.position] \ No newline at end of file