Added glitterslikegold and changed the test file
This commit is contained in:
parent
3a52870cc2
commit
d8c5c87462
110
glitterslikegold.py
Normal file
110
glitterslikegold.py
Normal file
@ -0,0 +1,110 @@
|
||||
"""Copy of tomb of doom not scrolling but glittering"""
|
||||
import curses
|
||||
import time
|
||||
import random
|
||||
|
||||
# Using readlines()
|
||||
file1 = open("test", "r")
|
||||
lines = file1.readlines()
|
||||
debug_text = False
|
||||
|
||||
|
||||
def show_debug_text(stdscr, width, height, start_x_file):
|
||||
"""debug text for the tomb of doom"""
|
||||
whstr = "Width: {}, Height: {}".format(width, height)
|
||||
stdscr.addstr(0, 0, whstr, curses.color_pair(1))
|
||||
file_string = "X position of text: {}".format(start_x_file)
|
||||
stdscr.addstr(1, 0, file_string, curses.color_pair(1))
|
||||
|
||||
|
||||
def draw_glitter(stdscr):
|
||||
# Clear and refresh the screen for a blank screen
|
||||
# Set delay to no, to not wait for keyboard press
|
||||
stdscr.nodelay(1)
|
||||
stdscr.clear()
|
||||
stdscr.refresh()
|
||||
glitter_increase = 1
|
||||
rotation = 1
|
||||
# Start colors in curses
|
||||
curses.start_color()
|
||||
curses.init_pair(1, curses.COLOR_CYAN, curses.COLOR_BLACK)
|
||||
curses.init_pair(2, curses.COLOR_RED, curses.COLOR_BLACK)
|
||||
curses.init_pair(3, curses.COLOR_GREEN, curses.COLOR_BLACK)
|
||||
curses.init_pair(4, curses.COLOR_BLUE, curses.COLOR_BLACK)
|
||||
curses.init_pair(5, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
|
||||
curses.init_pair(6, curses.COLOR_YELLOW, curses.COLOR_BLACK)
|
||||
|
||||
while True:
|
||||
# Loop where k is the last character pressed
|
||||
stdscr.clear()
|
||||
height, width = stdscr.getmaxyx()
|
||||
|
||||
# Declaration of strings
|
||||
title = "Curses from the Tomb of Doom, glitter like gold"[: width - 1]
|
||||
subtitle = "Crunk Varia"[: width - 1]
|
||||
|
||||
hwidth = width // 2
|
||||
# Centering calculations
|
||||
start_x_title = int((hwidth) - (len(title) // 2) - len(title) % 2)
|
||||
start_x_subtitle = int(
|
||||
(hwidth) - (len(subtitle) // 2) - len(subtitle) % 2
|
||||
)
|
||||
start_y = int((height) - 2)
|
||||
if debug_text:
|
||||
show_debug_text(stdscr, width, height, glitter_increase)
|
||||
|
||||
line_count = 0
|
||||
for line in lines:
|
||||
ch_count = 0
|
||||
for character in line:
|
||||
if ch_count < width and ch_count > 0:
|
||||
if random.randint(glitter_increase, 100) > 90:
|
||||
stdscr.addch(
|
||||
line_count,
|
||||
ch_count,
|
||||
character,
|
||||
curses.color_pair(rotation),
|
||||
)
|
||||
ch_count += 1
|
||||
line_count += 1
|
||||
|
||||
# Turning on attributes for title
|
||||
stdscr.attron(curses.color_pair(2))
|
||||
stdscr.attron(curses.A_BOLD)
|
||||
|
||||
# Rendering title
|
||||
stdscr.addstr(start_y, start_x_title, title)
|
||||
|
||||
# Turning off attributes for title
|
||||
stdscr.attroff(curses.color_pair(2))
|
||||
stdscr.attroff(curses.A_BOLD)
|
||||
|
||||
stdscr.addstr(start_y + 1, start_x_subtitle, subtitle)
|
||||
# Refresh the screen
|
||||
stdscr.refresh()
|
||||
time.sleep(1.0 / 30)
|
||||
glitter_increase += 1
|
||||
if glitter_increase > 99:
|
||||
glitter_increase = 1
|
||||
rotation += 1
|
||||
|
||||
if rotation > 6:
|
||||
rotation = 1
|
||||
|
||||
key_pressed = stdscr.getch() != -1
|
||||
if key_pressed:
|
||||
raise KeyboardInterrupt()
|
||||
|
||||
|
||||
def main():
|
||||
curses.wrapper(draw_glitter)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except KeyboardInterrupt:
|
||||
curses.endwin()
|
||||
curses.curs_set(1)
|
||||
curses.reset_shell_mode()
|
||||
curses.echo()
|
38
test
38
test
@ -1,12 +1,26 @@
|
||||
███████████████████████████████████████████████████████████████████████████████
|
||||
██╔════════════╗█╔════════════╗█╔════════════╗█╔════════════╗█╔════════════╗███
|
||||
██║ ▄▄▄▄ ▄▄▄ ║█║ ▄▄▄▄▄▄▄▄▄▄ ║█║ ██████████ ║█║ ██████████ ║█║ ██████████ ║███
|
||||
██║ ████ ████ ║█║ ██████████ ║█║ ██████████ ║█║ ▀▀▀▀▀▀▀▀▀▀ ║█║ ██████████ ║███
|
||||
██║ ████ ████ ║█║ ███ ███ ║█║ ██ ███▀ ║█║ ▄▄▄▄▄▄▄▄▄▄ ║█║ ███ ███ ║███
|
||||
██║ ████ ████ ║█║ ██████████ ║█║ ████████ ║█║ ██████ ║█║ ██████████ ║███
|
||||
██║ ████ ████ ║█║ ████▌▐████ ║█║ █████████ ║█║ ██████ ║█║ ████▌▐████ ║███
|
||||
██║ ▓███ ▄████ ║█║ ▓███▌▐████ ║█║ ▓███▌▐███ ║█║ ██████ ║█║ ▓███▌▐████ ║███
|
||||
██║ ▒▓███████▀ ║█║ ▒▓██▌▐████ ║█║ ▒▓██▌▐███ ║█║ ▓█████ ║█║ ▒▓██▌▐████ ║███
|
||||
██║ ░▒▓█████▀ ║█║ ░▒▓█▌▐████ ║█║ ░▒▓█▌▐████ ║█║ ░▒▓█████▄▄ ║█║ ░▒▓█▌▐████ ║███
|
||||
██╚════════════╝█╚════════════╝█╚════════════╝█╚════════════╝█╚════════════╝███
|
||||
███████████████████████████████████████████████████████████████████████████████
|
||||
. . . .
|
||||
. . .
|
||||
┌───┐ ┌───┐ ┌───────────┐ ┌─────────────┐ ┌──────────┐ ┌───────────┐
|
||||
│░░░│ │░░░│ │░░░░░░░░░░░│ │░░░░░░░░░░░░░│ │░░░░░░░░░░│ │░░░░░░░░░░░│ .
|
||||
│░░░│ │░░░│ │░░░░░░░░░░░│ │░░░░░░░░░░░░░│ │░░░░░░░░░░│ │░░░░░░░░░░░│
|
||||
│░░░│ .│░░░│ │░░░░░░░░░░░│ │░░░░░░░░░░░░░│ │░░░░░░░░░░│ │░░░░░░░░░░░│
|
||||
│▒▒▒│ │▒▒▒│ │▒▒▒┌───┐▒▒▒│ │▒▒▒┌─────┐▒▒▒│ └──┐▒▒▒▒┌──┘ │▒▒▒┌───┐▒▒▒│ .
|
||||
│▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│ . ┌┘▒▒▒│ . │▒▒▒▒│ │▒▒▒│ │▒▒▒│
|
||||
│▒▒▒│ │▒▒▒│ │▒▒▒└───┘▒▒▒│ │▒▒▒│ │▒▒▒▒│ │▒▒▒▒│ │▒▒▒└───┘▒▒▒│
|
||||
. │███│ │███│ │███████████│ │███└────┘████│ │████│ │███████████│
|
||||
│███│ │███│ │███████████│ │████████████┌┘ .│████│ │███████████│
|
||||
. │███│ │███│ │███████████│ │███████████ │ │████│ │███████████│
|
||||
│▓▓▓│ │▓▓▓│ │▓▓▓┌───┐▓▓▓│ │▓▓▓┌──┐▓▓▓▓▓│ . │▓▓▓▓│. │▓▓▓┌───┐▓▓▓│
|
||||
│▓▓▓│ │▓▓▓│.│▓▓▓│. │▓▓▓│ │▓▓▓│ └─┐▓▓▓│ │▓▓▓▓│ │▓▓▓│ │▓▓▓│
|
||||
. │▓▓▓│ │▓▓▓│ │▓▓▓│ │▓▓▓│ │▓▓▓│ │▓▓▓│ │▓▓▓▓│ │▓▓▓│ │▓▓▓│
|
||||
│▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒│ │▒▒▒▒│ . │▒▒▒│ . │▒▒▒│ .
|
||||
│▒▒▒▓▓▓▓▒▒▒▓▓▓▓▒▒▒▓▓▓▓▓▒▒▒▓▓│▒▒▒│ │▒▒▒│ │▒▒▒▒│ │▒▒▒│ │▒▒▒│
|
||||
│▒▒▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▓▒▒▒▓▓▓▓█│▒▒▒└─┐┌──┘▒▒▒▒└──┐ │▒▒▒│ │▒▒▒│
|
||||
▓░░░░░░░░░░ ░░░░░░░░░░░░░░░░░▒▒▒▒▓▓░░░░░▓▓░░░░░░░░░░│ │░░░│ │░░░│
|
||||
▓▒░░░░░░░░░░▓▓▓▓░░░▓▓▓▓▓░░░▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░▒▒▒▒░░░│ │░░░│
|
||||
▓▒░░░░░░░░░░▓▓▓▓░░░▓▓▓▓▓░░░▓▓▓░░░░░░░▒▒░░░░░▒▒░░░░░░░░░░▓▓▓▓░░░│ │░░░│
|
||||
▓▒▒░▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▓▓▓▓▓▓▓▓▓▓
|
||||
▓▒░░▒▒▓▓▓▓███████ █████████████░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒
|
||||
▓▒░░▒▒▓▓██████████ Welcome to the Varia House. ██████████████▒▒▒▒▒▒▒▒▒▒░░░░░░░░░
|
||||
▒░░███████████████ ████████████████▓▓▓▓▓▓▓▓▓▓▓▓░░░░░
|
||||
░███████████████████████████████████████████████████████████████████████▓▓▓▓▓░░
|
||||
|
27
variawelcome80.txt
Normal file
27
variawelcome80.txt
Normal file
@ -0,0 +1,27 @@
|
||||
[0;1;40;30m[80C[0m
|
||||
[36m.[30m[19C[36m.[30m[23C[36m.[30m[26C[36m.[30m[6C[0m
|
||||
[30m[10C[36m.[30m[15C[36m.[30m[37C[0;1;0;36m.[30m[15C[0m
|
||||
[30m [1;35m┌───┐[30m [30m [1;35m┌───┐[0;30m [1;35m┌───────────┐[0;30m [1;35m┌─────────────┐[30m [35m┌──────────┐[0;30m [1;35m┌───────────┐[30m [30m
|
||||
[30m [35m│░░░│[30m [35m│░░░│[0;30m [1;35m│░░░░░░░░░░░│[0;30m [1;35m│░░░░░░░░░░░░░│[30m [35m│░░░░░░░░░░│[0;30m [1;35m│░░░░░░░░░░░│[30m [36m.[30m [0m
|
||||
[30m [0;30m [1;35m│░░░│[30m [35m│░░░│[0;30m [1;35m│░░░░░░░░░░░│[0;30m [1;35m│░░░░░░░░░░░░░│[30m [35m│░░░░░░░░░░│[0;30m [1;35m│░░░░░░░░░░░│[30m [0;30m [37m
|
||||
[30m [0;30m [1;35m│░░░│[30m [36m.[35m│░░░│[0;30m [1;35m│░░░░░░░░░░░│[0;30m [1;35m│░░░░░░░░░░░░░│[30m [35m│░░░░░░░░░░│[0;30m [1;35m│░░░░░░░░░░░│[30m [0;30m [37m
|
||||
[30m [1m [0;30m [1;35m│▒▒▒│[30m [35m│▒▒▒│[0;30m [1;35m│▒▒▒┌───┐▒▒▒│[0;30m [1;35m│▒▒▒┌─────┐▒▒▒│[30m [35m└──┐▒▒▒▒┌──┘[0;30m [1;35m│▒▒▒┌───┐▒▒▒│[30m [36m.[0m
|
||||
[30m [1m [0;30m [1;35m│▒▒▒│[30m [35m│▒▒▒│[0;30m [1;35m│▒▒▒│[0;30m [1;35m│▒▒▒│[0;30m [1;35m│▒▒▒│[0;30m [1;36m.[0;30m [1;35m┌┘▒▒▒│[30m [36m.[30m [35m│▒▒▒▒│[0;30m [1;35m│▒▒▒│[0;30m [1;35m│▒▒▒│[0;30m [1m [0;30m [37m
|
||||
[30m [1m [0;30m [1;35m│▒▒▒│[30m [35m│▒▒▒│[0;30m [1;35m│▒▒▒└───┘▒▒▒│[0;30m [1;35m│▒▒▒│[0;30m [1;35m│▒▒▒▒│[30m [35m│▒▒▒▒│[0;30m [1;35m│▒▒▒└───┘▒▒▒│[30m [0;30m [37m
|
||||
[30m [1;36m.[0;30m [1m [30m [1;35m│███│[30m [35m│███│ │███████████│[0;30m [1;35m│███└────┘████│[30m [35m│████│[0;30m [1;35m│███████████│[30m [0;30m [37m
|
||||
[30m [30m [1;35m│███│[30m [35m│███│[30m [1;35m│███████████│[30m [1;35m│████████████┌┘[30m [36m.[35m│████│[30m [1;35m│███████████│[30m [0m
|
||||
[30m [36m.[30m [1;35m│███│[30m [1;35m│███│[30m [1;35m│███████████│[30m [1;35m│███████████[30m [1;35m│[30m[5C[35m│████│[30m [1;35m│███████████│[30m [30m [37m
|
||||
[30m [35m│▓▓▓│[30m [35m│▓▓▓│[30m [1;35m│▓▓▓┌───┐▓▓▓│[30m [1;35m│▓▓▓┌──┐▓▓▓▓▓│[30m [36m.[30m [35m│▓▓▓▓│[36m.[30m [1;35m│▓▓▓┌───┐▓▓▓│[30m [30m [37m
|
||||
[30m[5C[35m│▓▓▓│[30m [35m│▓▓▓│[36m.[35m│▓▓▓│[36m.[30m [1;35m│▓▓▓│[30m [1;35m│▓▓▓│[30m [1;35m└─┐▓▓▓│[30m[5C[35m│▓▓▓▓│[30m [1;35m│▓▓▓│[30m [1;35m│▓▓▓│[30m [30m [37m
|
||||
[30m [36m.[30m [35m│▓▓▓│[30m [35m│▓▓▓│[30m [1;35m│▓▓▓│[30m [1;35m│▓▓▓│[30m [1;35m│▓▓▓│[30m [1;35m│▓▓▓│[30m[5C[35m│▓▓▓▓│[30m [1;35m│▓▓▓│[30m [1;35m│▓▓▓│[30m [30m
|
||||
[30m[5C[0m[1;35m│▒▒▒│[30m [1;35m│▒▒▒│ │▒▒▒│[30m [1;35m│▒▒▒│[30m [1;35m│▒▒▒│[30m [1;35m│▒▒▒│[30m[5C[1;35m│▒▒▒▒│[30m [36m.[30m [1;35m│▒▒▒│[30m [36m.[30m [1;35m│▒▒▒│[30m [36m.[30m [30m
|
||||
[30m [0m[1;35m│▒▒▒[0;42;30m▓▓▓▓[0m[1;35m▒▒▒[42;30m▓▓▓▓[0m[1;35m▒▒▒[0;42;30m▓▓▓▓▓[0m[1;35m▒▒▒[42;30m▓▓[0m[1;35m│▒▒▒│[30m [1;35m│▒▒▒│[30m [1;35m│▒▒▒▒│[30m [1;35m│▒▒▒│[30m [1;35m│▒▒▒│[30m [30m [0m
|
||||
[30m [0m[1;35m│▒▒▒[0;42;30m▒▒▒▒[0m[1;35m▒▒▒[42;30m░░░░[0m[1;35m▒▒▒[0;42;30m▒▒▒▒▒[0m[1;35m▒▒▒[0;42;30m▒▒▓[0m[1;35m▒▒▒[42;30m▓▓▓▓█[0m[1;35m│▒▒▒└─┐┌──┘▒▒▒▒└──┐[0;30m [1;35m│▒▒▒│[0;30m [1;35m│▒▒▒│[30m [0;30m [0m
|
||||
[30m [0;42;30m▓[0m[1;35m░░░░░░░░░░[0;42;30m [0m[1;35m░░░[0;42;30m░░░░░[0m[1;35m░░░[0;42;30m░░░[0m[1;35m░░░[0;42;30m▒▒▒▒▓▓[0m[1;35m░░░░░[0;42;30m▓▓[0m[1;35m░░░░░░░░░░│[30m [0m[1;35m│░░░│[30m [0m[1;35m│░░░│[30m [30m [0m
|
||||
[30m [0;42;30m▓▒[0m[1;35m░░░░░░░░░░[42;32m▓▓▓▓[0m[1;35m░░░[42;32m▓▓▓▓▓[0m[1;35m░░░[42;32m▓▓▓[0m[1;35m░░░[42;32m░░░░░░[0m[1;35m░░░░░[0;42;30m░░[0m[1;35m░░░░░░░░░░[0;42;30m▒▒▒▒[0m[1;35m░░░│[30m [0m[1;35m│░░░│[30m [30m [0m
|
||||
[30m [0;42;30m▓▒[0m[1;35m░░░░░░░░░░[42;32m▓▓▓▓[0m[1;35m░░░[42;32m▓▓▓▓▓[0m[1;35m░░░[42;32m▓▓▓[0m[1;35m░░░[42;32m░░░░▒▒[0m[1;35m░░░░░[0;42;30m▒▒[0m[1;35m░░░░░░░░░░[0;42;30m▓▓▓▓[0m[1;35m░░░│[30m [0m[1;35m│░░░│[30m [30m [0m
|
||||
[30m [0;42;30m▓▒▒[1;32m░▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓[0;32m▓▓▓▓▓▓▓▓▓[42;30m▒▒▒▓▓▓▓▓▓▓▓▓▓[0m
|
||||
[30m [0;42;30m▓▒░[1;32m░▒▒▓▓▓▓███████[0;42;30m[30m__̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡ ̡͌l̡̡̡̡.___[0;1;42;32m█████████████░░░░░░[0;32m▒▒▒[42;30m▒▒▒▒▒▒▒▒▒▒▒[0;37m
|
||||
[0m[42;30m▓▒░[1;32m░▒▒▓▓██████████[0;5;42;32m [30mWelcome to the Varia House.[32m [0;1;42;32m██████████████▒▒▒▒▒▒▒▒▒▒[0;42;30m░░░░░░░░░[0;37m
|
||||
[0m[42;30m▒░[1;32m░███████████████[0;5;42;32m [30mCRUNK [0;1;42;32m████████████████▓▓▓▓▓▓▓▓▓▓▓▓░░░░░[0m
|
||||
[0m[42;30m [1;32m░███████████████████████████████████████████████████████████████████████▓▓▓▓▓░░[0m
|
Loading…
Reference in New Issue
Block a user