updated image to come from assests folder
renamed image to .jpg file
This commit is contained in:
parent
673cde497a
commit
52696a064c
|
@ -1,5 +1,6 @@
|
||||||
# This is a Python program. You should run it by typing "chest.py"
|
# This is a Python program. You should run it by typing "chest.py"
|
||||||
|
|
||||||
|
import os
|
||||||
from urllib.request import urlretrieve
|
from urllib.request import urlretrieve
|
||||||
import threading
|
import threading
|
||||||
import datetime
|
import datetime
|
||||||
|
@ -36,7 +37,7 @@ guess = input(" > ")
|
||||||
if guess == secret:
|
if guess == secret:
|
||||||
print(" The chest snaps open, releasing several huge air bubbles.")
|
print(" The chest snaps open, releasing several huge air bubbles.")
|
||||||
print(" You look into the chest and see...\n")
|
print(" You look into the chest and see...\n")
|
||||||
urlretrieve("http://chrisproctor.net/images/fork.png", "treasure.png")
|
os.system('cp ./../../../.assets/fork.jpg treasure.jpg')
|
||||||
timer1 = threading.Timer(1.0, treasure)
|
timer1 = threading.Timer(1.0, treasure)
|
||||||
timer2 = threading.Timer(3.0, monster1)
|
timer2 = threading.Timer(3.0, monster1)
|
||||||
timer3 = threading.Timer(5.0, monster2)
|
timer3 = threading.Timer(5.0, monster2)
|
||||||
|
|
|
@ -4,7 +4,7 @@ from datetime import timedelta
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
def reset():
|
def reset():
|
||||||
with open("./bag/treasure.png", "w") as keyfile:
|
with open("./bag/treasure.jpg", "w") as keyfile:
|
||||||
keyfile.write("lost")
|
keyfile.write("lost")
|
||||||
|
|
||||||
print(" You are swimming as fast as you can towards the boat but you can")
|
print(" You are swimming as fast as you can towards the boat but you can")
|
||||||
|
@ -35,7 +35,7 @@ def win():
|
||||||
print(" time to avoid the sea monster's vicious maw.")
|
print(" time to avoid the sea monster's vicious maw.")
|
||||||
print(" You're safe at last!")
|
print(" You're safe at last!")
|
||||||
print(" Now you can finally show off the treasure you risked your life for...")
|
print(" Now you can finally show off the treasure you risked your life for...")
|
||||||
print(" Use open treasure.png to take a peek.")
|
print(" Use open treasure.jpg to take a peek.")
|
||||||
|
|
||||||
|
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
|
@ -45,7 +45,7 @@ if not Path("adventure/seafloor/coral_reef/.timer").exists():
|
||||||
print(" to the ship. More secrets await you in the ocean's depths.")
|
print(" to the ship. More secrets await you in the ocean's depths.")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if not Path("./bag/treasure.png").exists():
|
if not Path("./bag/treasure.jpg").exists():
|
||||||
|
|
||||||
print(" You forgot your treasure bag! Hurry back to get it before the sea monster")
|
print(" You forgot your treasure bag! Hurry back to get it before the sea monster")
|
||||||
print(" hides it away forever!")
|
print(" hides it away forever!")
|
||||||
|
|
Loading…
Reference in New Issue