push fail.png and catch display logic
This commit is contained in:
@@ -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)
|
||||
@@ -277,6 +278,8 @@ def onStep(app):
|
||||
# creature and transition into the skill check.
|
||||
# - 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:
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user