Skip to content

Commit

Permalink
fix: clear issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ar-cyber authored Oct 24, 2024
1 parent 4e4818f commit f55caba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def climb(self):
if self.position > self.max_height:
self.position = self.max_height
console.clear()
console.clear()
if self.position == 1:
console.print(f"Climbed 1 up. You are now at {self.position} metre.")
else:
Expand All @@ -87,13 +88,15 @@ def climb(self):
else:
fall_distance = 1
if self.position > 5:
console.clear()
console.clear()
console.print(f"Fell from height {self.position}. You died!")
self.alive = False
return False
else:
self.position = max(0, self.position - fall_distance)
console.clear()
console.clear()
console.print(f"Waited and fell to position: {self.position}")

self.current_key = random.choice(self.keys)
Expand All @@ -120,6 +123,7 @@ def climb():
return False


console.clear()
console.clear()
console.print("[NOTE]: Successfully launched game.")

Expand All @@ -134,6 +138,7 @@ def climb():
json.dump(db, f)
exit()
console.clear()
console.clear()


def sequence1():
Expand Down Expand Up @@ -181,6 +186,7 @@ def sequence2():
console.print("You decide to climb.")
input("Press enter to continue...")
console.clear()
console.clear()
climb_result = climb() # Climbing system initation
if climb_result:
pass
Expand All @@ -191,6 +197,7 @@ def sequence2():
exit()
console.print("You have reached the top of the cliff.")
console.clear()
console.clear()
with open('save.json', 'w') as f:
json.dump(db, f)
db['stage'] = 3
Expand Down

0 comments on commit f55caba

Please sign in to comment.