push fail.png and catch display logic

This commit is contained in:
2026-10-09 00:16:35 -04:00
parent f0a3d5af55
commit 1010be435a
2 changed files with 30 additions and 1 deletions
+30 -1
View File
@@ -148,6 +148,7 @@ def onAppStart(app):
#FISHING
app.fishingTimer = 0
app.hookedFish = None
app.timeSinceInit = 0
#list of interactables with name and their positions
#(name, sceneFilter, left, right, top, bottom)
@@ -278,6 +279,8 @@ def onStep(app):
# - skill-check: advance the cursor's angle around the circle each step.
# - otherwise (idle, viewing a catch, in shop): do nothing time-based.
app.timeSinceInit += 1
#had to look up how to do switch-case statement in python, I know it from JS though
match app.scene:
case "waiting-for-bite":
@@ -470,6 +473,8 @@ def redrawAll(app):
drawShopEntities(app)
if app.scene == "skill-check":
drawSkillCheck(app)
if app.scene == "result":
drawCatchDisplay(app)
drawDebug(app)
@@ -588,7 +593,31 @@ def drawCatchDisplay(app):
# Draw the "you caught it!" popup: the creature's sprite coming out of the
# water, plus its name, description, and stats (length, weight, value).
# Stays up until dismissed by a click (handled in onMousePress). Read-only.
pass
#dimming
drawRect(0,0,app.width,app.height,opacity=70)
#draw creature/error
imgWidth = 200
imgHeight = 150
if app.hookedFish != None:
drawImage(BASE_IMAGE_URL + f"fish/{creature["sprite-file"]}",
app.width // 2,
app.height // 2,
align = "center",
width=imgWidth,
height=imgHeight,
rotateAngle = math.sin(app.timeSinceInit) * 10)
else:
#Image Cred: https://freepngimg.com/png/13474-fail-stamp-free-download-png
drawImage(BASE_IMAGE_URL + "fail.png",
app.width // 2,
app.height // 2,
align = "center",
width=imgWidth,
height=imgHeight,
)#rotateAngle = math.sin(app.timeSinceInit) * 10)
def drawHud(app):
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB