project_game/angband.py

44 lines
1.4 KiB
Python

from retro.game import Game
from player import Player
from dungeon import Dungeon
from random import sample
from wall import Wall
from map import (
board_edges,
inner_board,
level_one,
random_empty_position
)
from enemies import (
Orc,
Rat,
Spider
)
print("Welcome to AngBAD (a poor representation of Angband)!\n")
race = input("Choose your race (Human, Elf, Dwarf): ").capitalize()
while race not in ["Human", "Elf", "Dwarf"]:
print("Invalid race. Please choose Human, Elf, or Dwarf.")
race = input("Choose your race (Human, Elf, Dwarf): ").capitalize()
class_ = input("Choose your class (Warrior, Mage, Rogue): ").capitalize()
while class_ not in ["Warrior", "Mage", "Rogue"]:
print("Invalid class. Please choose Warrior, Mage, or Rogue.")
class_ = input("Choose your class (Warrior, Mage, Rogue): ").capitalize()
print(f"\nYou've chosen to play as a {race} {class_}.")
input("Press Enter to continue. Good luck!")
board_size = (50,25)
x,y = board_size
walls = [Wall(position) for position in board_edges(board_size)]
level = [Wall(position) for position in level_one(board_size)]
game = Game(walls + level, {"Race":race, "Class":class_,}, board_size = board_size)
game.add_agent(Player((x//2,y//2),race,class_))
game.add_agent(Orc(random_empty_position(game)))
game.add_agent(Rat(random_empty_position(game)))
game.add_agent(Spider(random_empty_position(game)))
game.play()