Browse Source

How do I even do this. It has three states, either segfault, prints black, or prints semi-properly. What??

master
Jared Dunbar 5 years ago
parent
commit
cfb5d6426f
  1. 49
      main.py

49
main.py

@ -0,0 +1,49 @@
#!/usr/bin/python
#
# Jared Dunbar
#
# 7 Hour Rogue Like, November 12, 2016
from time import sleep as sleep
import sys
import curses
from curses import wrapper
# Curses config
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.keypad(True)
curses.start_color()
# Debug flags
FAST = False # disables slow printing (you know, dev)
def game(something):
# Clear screen
stdscr.clear()
curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)
stdscr.addstr(0,0, "test", curses.color_pair(1))
# intro
string = "You enter a strange land, the trees are scragly and dark.\n"
for char in string:
stdscr.addch(char, curses.color_pair(1))
stdscr.refresh()
if not FAST: sleep(0.1)
sleep(2)
string = "The sky is grey and gringy.\n"
for char in string:
stdscr.addch(char, curses.color_pair(1))
stdscr.refresh()
if not FAST: sleep(0.1)
sleep(2)
string = "You walk along a path, aproaching a mountain through this dead forest.\n"
for char in string:
stdscr.addch(char, curses.color_pair(1))
stdscr.refresh()
if not FAST: sleep(0.1)
sleep(2)
wrapper(game)
Loading…
Cancel
Save