start working on Controller phase, and pulling logic together

This commit is contained in:
2026-10-08 01:25:56 -04:00
parent 9860908777
commit 5cc27ae5fa
2 changed files with 40 additions and 10 deletions
+31 -9
View File
@@ -185,12 +185,6 @@ def pickRandomCreature(app):
catch = [c for c in app.creatures if c["name"] == possibleCatch[0]][0]
return catch
def startSkillCheck(app, creature):
@@ -226,7 +220,8 @@ def startSkillCheck(app, creature):
#speed is set, bars are set, scene is good, should be fine?
def beginFishing(app):
pass
@@ -245,9 +240,23 @@ 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.
pass
#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":
app.fishingTimer -= 1
if app.fishingTimer < 1:
startSkillCheck(app, pickRandomCreature(app))
case "skill-check":
app.skillCheckAngle += app.skillCheckSpeed
#list of interactables with name and their positions
#(name, left, right, top, bottom)
INTERACTABLES = [
("")
]
def onMousePress(app, mouseX, mouseY):
# Primary input router. Behavior depends on app.scene / fishing phase:
# - dock idle: clicking starts a cast (begin waiting-for-bite).
@@ -256,7 +265,20 @@ def onMousePress(app, mouseX, mouseY):
# - catch popup showing: dismiss the popup and reset fishing.
# - shop / UI sprites clicked: open the shop or trigger that UI action.
# Keep this as dispatch only - defer the real work to helper functions.
pass
match app.scene:
case "idle":
interacted = False
#check if we clicked a hud element/interactable
for name, left, right, top, buttom in INTERACTABLES:
if left < mouseX < right and top < mouseY < bottom:
interacted = True
match name:
case "shop":
#... do something
pass
if not interacted:
beginFishing(app)
def onKeyPress(app, key):
+9 -1
View File
@@ -1,5 +1,5 @@
###############################################
Total Time: 150 minutes
Total Time: 190 minutes
###############################################
###############################################
@@ -41,3 +41,11 @@ End Time: 1:50pm
Duration: 20 minutes
Description: continuing work with making upgrades take effect for skill checks
###############################################
###############################################
Date: 08-Oct
Start Time: 12:40am
End Time: 1:20am
Duration: 40 minutes
Description: finish up (mostly) basic functions and move onto controller, work out a bunch of finer logic and complex math
###############################################