start working on Controller phase, and pulling logic together
This commit is contained in:
@@ -187,12 +187,6 @@ def pickRandomCreature(app):
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def startSkillCheck(app, creature):
|
||||
# Configure a new skill check based on the hooked creature's difficulty.
|
||||
# Difficulty maps to: cursor rotation speed, number of target bars, and
|
||||
@@ -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,8 +240,22 @@ 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:
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
###############################################
|
||||
|
||||
Reference in New Issue
Block a user