Created
January 14, 2014 23:26
-
-
Save ryonagana/8427989 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import re | |
import random | |
import utils | |
from colorama import Back, Fore, Style, init | |
from utils import term | |
init(autoreset=True) | |
class Dungeon_Tile: | |
shape = '' | |
def __init__(self,new_shape): | |
self.shape = new_shape | |
def get(self): | |
return self.shape | |
def set(self, shape): | |
self.shape = shape | |
class Dungeon: | |
_map_size = (0,0) | |
_tiles = [] | |
def __init__(self, map_x, map_y, max_features, room_chance): | |
self._map_size = (map_x,map_y) | |
random.seed() | |
for x in range(0,self._map_size[0]): | |
self._tiles.append([]) | |
for y in range(0,self._map_size[1]): | |
self._tiles[x].append(Dungeon_Tile('#')) | |
def draw(self): | |
for x in range(0, self._map_size[0]): | |
for y in range(0, self._map_size[1]): | |
with term.location(x,y): | |
print self._tiles[x][y].get() | |
#term.location(x,y) | |
class MainGame: | |
def __init__(self): | |
self.life = 1000.0 | |
self.starve = -1 | |
self.gold = 0.0 | |
def Look(self): | |
pass | |
def Loop(self): | |
try: | |
while self.life > 0: | |
#self.Render() | |
self.Look() | |
except KeyboardInterrupt, msg: | |
print msg | |
print (Fore.RED + "Game Over Bro.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment