ASCII art for plants now shown

pull/1/head
Jake Funke 2017-03-17 22:03:32 +00:00
parent 81590dd3f3
commit 67c8f3dfc8
30 changed files with 324 additions and 6 deletions

View File

@ -1,5 +1,5 @@
# botany # botany
![Screencap](http://tilde.town/~curiouser/botanybeta.png) ![Screencap](http://tilde.town/~curiouser/botanybeta2.png)
by Jake Funke - jifunks@gmail.com - tilde.town/~curiouser - http://jakefunke.online/ by Jake Funke - jifunks@gmail.com - tilde.town/~curiouser - http://jakefunke.online/
@ -11,9 +11,9 @@ Check in and water your plant every 24h to keep it growing. 5 days without water
*(work in progress)* *(work in progress)*
## getting started ## getting started
botany is designed for unix-based systems. Clone into a local directory using `git clone https://github.com/jifunks/botany.git`. botany is designed for unix-based systems. Clone into a local directory using `$ git clone https://github.com/jifunks/botany.git`.
Run with `python botany.py`. Run with `$ python botany.py`.
*Note - botany.py must initially be run by the user who cloned/unzipped *Note - botany.py must initially be run by the user who cloned/unzipped
botany.py - this initalizes the shared data file permissions.* botany.py - this initalizes the shared data file permissions.*
@ -25,7 +25,8 @@ If your plant goes 5 days without water, it will die!
## features ## features
* Curses-based menu system * Curses-based menu system, optimized for 80x24 terminal
* ASCII art display of plant
* Persistent aging system that allows your plant to grow even when app is closed * Persistent aging system that allows your plant to grow even when app is closed
* Community leaderboard (for shared unix servers) created in program directory `garden_file.json` * Community leaderboard (for shared unix servers) created in program directory `garden_file.json`
* Data file is created in the user's home (~) directory, along with a JSON file that can be used in other apps. * Data file is created in the user's home (~) directory, along with a JSON file that can be used in other apps.
@ -46,7 +47,7 @@ If your plant goes 5 days without water, it will die!
* *Plant mutation happens more frequently than it will in final version.* * *Plant mutation happens more frequently than it will in final version.*
### to-dos ### to-dos
* Add ASCII plant display * Add day/night ASCII art
* Finish garden display ('garden' function) * Finish garden display ('garden' function)
* Allows you to water neighbor's plants * Allows you to water neighbor's plants
* Plant end of life (seeding/pollination) * Plant end of life (seeding/pollination)
@ -60,6 +61,7 @@ If your plant goes 5 days without water, it will die!
## requirements ## requirements
* Unix-based OS (Mac, Linux) * Unix-based OS (Mac, Linux)
* Python 2.x * Python 2.x
* Recommended: 80x24 minimum terminal, fixed-width font
## credits ## credits
* thank you tilde.town for inspiration! * thank you tilde.town for inspiration!

10
art/agave1.txt 100644
View File

@ -0,0 +1,10 @@
. , , .
|\ |`, || /| .,
|\v| \v /|v/| |/ |
\| \\\/ /| / V /
\_| \ / / ,/
. , _ .\ \ |,/_/., _ .
^ ' ` '

10
art/aloe1.txt 100644
View File

@ -0,0 +1,10 @@
. . .
|\.,n/|./|
\\\/ /| /
'| \ / /
. , _ . .\ |,/_ ., _ .
^ ' ` '

10
art/baobab1.txt 100644
View File

@ -0,0 +1,10 @@
&& & & & &&
^ \ | ^ | ^/
^|^ |^ ^|^/
| * |
|. ; `|
| . |
. , _ .(. ) _ .
^ ' ` '

12
art/bee.txt 100644
View File

@ -0,0 +1,12 @@
_
/_)
(8_))}- .
\_) '.
.--. .
: '. .'
'---'`;
.
_.'
.'
' _
'._. , ' `, .

View File

@ -0,0 +1,10 @@
_.
//\\ //\
} }\\ // \\
\V/{
||
||{
. , _ . ., || _ ., _ .
^ ' ` '

10
art/cactus1.txt 100644
View File

@ -0,0 +1,10 @@
_\_\/
-( / )-
\_/
. , _ . .,@@@ _ ., _ .
^ ' ` '

10
art/cannabis1.txt 100644
View File

@ -0,0 +1,10 @@
^
l%
%\| _
|/ %
%\| /%
. , _ . ., l/ _ ., _ .
^ ' ` '

10
art/columbine1.txt 100644
View File

@ -0,0 +1,10 @@
\ | | /
| \|&|
&\/&/
. , _ . ., &/ _ ., _ .
^ ' ` '

10
art/columbine3.txt 100644
View File

@ -0,0 +1,10 @@
\ % /
| |% %
%\/ /%
. , _ . ., l/ _ ., _ .
^ ' ` '

10
art/daffodil1.txt 100644
View File

@ -0,0 +1,10 @@
\
|/>
< |
\|
. , _ . ., l, _ ., _ .
^ ' ` '

10
art/fern1.txt 100644
View File

@ -0,0 +1,10 @@
\|/,
.\|/ |/
\|/ l/
. , _ . ., l /_ ., _ .
^ ' ` '

10
art/ficus1.txt 100644
View File

@ -0,0 +1,10 @@
& \ & &
&\|,/ |/& &&
&|/& / & &
\ { |___/_&
{ {/ / &
`, \{______/_&
} }{ \_&
}{{
. , , -=-~{ .-^- _ _ .
^ '

10
art/ficus2.txt 100644
View File

@ -0,0 +1,10 @@
&&&\/& &&&
&\|,/ |/& &&
&&/ / /_& &&
\ { |_____/_&
{ / / &&&
`, \{___________/_&&
} }{ \____&
}{{ `&\&&
{}{ &&
. , , -=-~{ .-^- _ _ .

10
art/flytrap1.txt 100644
View File

@ -0,0 +1,10 @@
C % c
(\C/
. , _ . ., l, _ ., _ .
^ ' ` '

10
art/iris1.txt 100644
View File

@ -0,0 +1,10 @@
_, . ,
/ \ \V / /\
|\ \\v/ |`
/\ v ||/ \
\\v//
. , _ . .,\V/ _ ., _ .
^ ' ` '

10
art/jadeplant1.txt 100644
View File

@ -0,0 +1,10 @@
. ,
o%O %,o
\%o'
. , _ . ., l, _ ., _ .
^ ' ` '

10
art/lithops1.txt 100644
View File

@ -0,0 +1,10 @@
__ __
. , _ . ( | ) ., _ .
^ ' ` '

7
art/moon.txt 100644
View File

@ -0,0 +1,7 @@
_.._
.' .-'`
/ /
| |
\ '.___.;
'._ _.'
``

10
art/moss1.txt 100644
View File

@ -0,0 +1,10 @@
/\ __
_/ / \
_/ / / `--.
__/ ' _ \_ \
/ / _/ ##- \ \ \
._ / _ . .#### _|., _ .|
^ ' ` '

10
art/moss2.txt 100644
View File

@ -0,0 +1,10 @@
/\ __
_/##/ \
_/ /##/####`--.
__/ ' _###\_ ### \
/ / #_/###-#\####\ \
._ / _#########_|#,#_ .|
^ ' ` '

10
art/palm1.txt 100644
View File

@ -0,0 +1,10 @@
_ , . _
/ \`\ / /^\
| /\ ||/ \ |
| /\||\ |
||
. , _ . .,|_| _ ., _ .
^ ' ` '

10
art/pansy1.txt 100644
View File

@ -0,0 +1,10 @@
\ o /
o| |o o
\/ /
. , _ . ., l/ _ ., _ .
^ ' ` '

10
art/poppy1.txt 100644
View File

@ -0,0 +1,10 @@
O
|
\o
|o
\/
. , _ . ., l, _ ., _ .
^ ' ` '

10
art/sage1.txt 100644
View File

@ -0,0 +1,10 @@
'\+/` /`
'\|/`|/`
\|/ |/`
. , _ . . ,l-/`,., _ .
^ ' ` '

10
art/seed.txt 100644
View File

@ -0,0 +1,10 @@
. , _ . . _ , _ ., _ .
^ ' o ` '

10
art/seedling.txt 100644
View File

@ -0,0 +1,10 @@
. ;
\|
. , _ . ., l, _ ., _ .
^ ' ` '

View File

@ -0,0 +1,10 @@
+
|/
\|
|/
\|
. , _ . ., l, _ ., _ .
^ ' ` '

10
art/sunflower1.txt 100644
View File

@ -0,0 +1,10 @@
O
\//
||
||/
\||
. , _ . ., || _ ., _ .
^ ' ` '

View File

@ -106,6 +106,42 @@ class CursedMenu(object):
self.screen.addstr(ypos+y,xpos,line, curses.A_NORMAL) self.screen.addstr(ypos+y,xpos,line, curses.A_NORMAL)
# self.screen.refresh() # self.screen.refresh()
def draw_plant_ascii(self, this_plant):
ypos = 1
xpos = int((self.maxx-37)/2 + 25)
plant_art_dict = {
0: 'poppy',
1: 'cactus',
2: 'aloe',
3: 'flytrap',
4: 'jadeplant',
5: 'fern',
6: 'daffodil',
7: 'sunflower',
8: 'baobab',
9: 'lithops',
10: 'cannabis',
11: 'pansy',
12: 'iris',
13: 'agave',
14: 'ficus',
15: 'moss',
16: 'sage',
17: 'snapdragon',
18: 'columbine',
19: 'brugmansia',
20: 'palm',
}
if this_plant.stage == 0:
self.ascii_render('seed.txt', ypos, xpos)
elif this_plant.stage == 1:
self.ascii_render('seedling.txt', ypos, xpos)
elif this_plant.stage >= 2:
# this_filename = plant_art_dict[this_plant.species]+str(this_plant.stage)+'.txt'
this_filename = plant_art_dict[this_plant.species]+'1.txt'
self.ascii_render(this_filename, ypos, xpos)
def draw_default(self): def draw_default(self):
# draws default menu # draws default menu
clear_bar = " " * (int(self.maxx*2/3)) clear_bar = " " * (int(self.maxx*2/3))
@ -140,7 +176,8 @@ class CursedMenu(object):
self.screen.addstr(5,13, " - you can't water a dead plant :(", curses.A_NORMAL) self.screen.addstr(5,13, " - you can't water a dead plant :(", curses.A_NORMAL)
# This draws cute ascii from files # This draws cute ascii from files
self.ascii_render("bee.txt",-1,self.maxx-23) self.draw_plant_ascii(self.plant)
# self.ascii_render("sun.txt",-2,self.maxx-14)
def update_plant_live(self): def update_plant_live(self):
# updates plant data on menu screen, live! # updates plant data on menu screen, live!