HUMAN: update time, pausing for now. visuals are looking great!
This commit is contained in:
@@ -149,6 +149,13 @@ def onAppStart(app):
|
|||||||
app.fishingTimer = 0
|
app.fishingTimer = 0
|
||||||
app.hookedFish = None
|
app.hookedFish = None
|
||||||
|
|
||||||
|
#list of interactables with name and their positions
|
||||||
|
#(name, sceneFilter, left, right, top, bottom)
|
||||||
|
app.INTERACTABLES = [
|
||||||
|
("open-shop", "idle", 400, 540, app.grassTop - 130, app.grassTop + 30),
|
||||||
|
("close-shop", "shop", app.width-50, app.width, 0, 50)
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def resetFishingState(app):
|
def resetFishingState(app):
|
||||||
@@ -258,18 +265,11 @@ def onStep(app):
|
|||||||
app.hookedFish = selectedCreature
|
app.hookedFish = selectedCreature
|
||||||
startSkillCheck(app, selectedCreature)
|
startSkillCheck(app, selectedCreature)
|
||||||
case "skill-check":
|
case "skill-check":
|
||||||
app.skillCheckAngle += app.skillCheckSpeed / 5 #this was far too fast
|
app.skillCheckAngle += app.skillCheckSpeed / 6 #this was far too fast
|
||||||
if (app.skillCheckAngle > 360):
|
if (app.skillCheckAngle > 360):
|
||||||
finishSkillCheck(app)
|
finishSkillCheck(app)
|
||||||
|
|
||||||
|
|
||||||
#list of interactables with name and their positions
|
|
||||||
#(name, sceneFilter, left, right, top, bottom)
|
|
||||||
INTERACTABLES = [
|
|
||||||
("open-shop", "idle", 250,350,0,100),
|
|
||||||
("close-shop", "shop", 500, 550, 50, 100)
|
|
||||||
]
|
|
||||||
|
|
||||||
def onMousePress(app, mouseX, mouseY):
|
def onMousePress(app, mouseX, mouseY):
|
||||||
# Primary input router. Behavior depends on app.scene / fishing phase:
|
# Primary input router. Behavior depends on app.scene / fishing phase:
|
||||||
# - dock idle: clicking starts a cast (begin waiting-for-bite).
|
# - dock idle: clicking starts a cast (begin waiting-for-bite).
|
||||||
@@ -282,7 +282,7 @@ def onMousePress(app, mouseX, mouseY):
|
|||||||
case "idle" | "shop": #also had to look this up - pipe operator is dumb. just let me have multiple cases
|
case "idle" | "shop": #also had to look this up - pipe operator is dumb. just let me have multiple cases
|
||||||
interacted = False
|
interacted = False
|
||||||
#check if we clicked a hud element/interactable
|
#check if we clicked a hud element/interactable
|
||||||
for name, sceneFilter, left, right, top, bottom in INTERACTABLES:
|
for name, sceneFilter, left, right, top, bottom in app.INTERACTABLES:
|
||||||
if left < mouseX < right and top < mouseY < bottom \
|
if left < mouseX < right and top < mouseY < bottom \
|
||||||
and sceneFilter == app.scene:
|
and sceneFilter == app.scene:
|
||||||
interacted = True
|
interacted = True
|
||||||
@@ -339,6 +339,7 @@ def checkSkillHit(app):
|
|||||||
#if we fail, we either didnt hit or missed a past bar, either way we can jump straight to the fail screen
|
#if we fail, we either didnt hit or missed a past bar, either way we can jump straight to the fail screen
|
||||||
app.hookedFish = None
|
app.hookedFish = None
|
||||||
app.scene = "result"
|
app.scene = "result"
|
||||||
|
print("failed",targetPos,targetLen,app.skillCheckAngle)
|
||||||
|
|
||||||
|
|
||||||
def finishSkillCheck(app):
|
def finishSkillCheck(app):
|
||||||
@@ -427,7 +428,12 @@ def redrawAll(app):
|
|||||||
# - the catch-display popup.
|
# - the catch-display popup.
|
||||||
# Delegates each piece to the helpers below.
|
# Delegates each piece to the helpers below.
|
||||||
drawBackground(app)
|
drawBackground(app)
|
||||||
if app.scene == "waiting-for-bite": drawBobber(app)
|
if app.scene == "waiting-for-bite":
|
||||||
|
drawBobber(app)
|
||||||
|
if app.scene == "shop":
|
||||||
|
drawShopEntities(app)
|
||||||
|
if app.scene == "skill-check":
|
||||||
|
drawSkillCheck(app)
|
||||||
|
|
||||||
|
|
||||||
drawDebug(app)
|
drawDebug(app)
|
||||||
@@ -461,7 +467,10 @@ def drawBackground(app):
|
|||||||
#image cred: https://www.artstation.com/artwork/xzLbe2
|
#image cred: https://www.artstation.com/artwork/xzLbe2
|
||||||
#salesman
|
#salesman
|
||||||
drawImage("https://gitea.lockeshor.com/lockeshor/15112-fishing-miniproject/raw/branch/main/sprites/salesman.png",
|
drawImage("https://gitea.lockeshor.com/lockeshor/15112-fishing-miniproject/raw/branch/main/sprites/salesman.png",
|
||||||
300, app.grassTop - 140, width = 70, height= 140)
|
400, app.grassTop - 130, width = 140, height= 160)
|
||||||
|
|
||||||
|
#cash
|
||||||
|
drawLabel(f"${app.save["cash"]}",app.width - 5,5,align="right-top",size=26,fill='darkgoldenrod',font='orbitron')
|
||||||
|
|
||||||
|
|
||||||
def drawBobber(app):
|
def drawBobber(app):
|
||||||
@@ -472,19 +481,50 @@ def drawBobber(app):
|
|||||||
#cast line
|
#cast line
|
||||||
drawLine(172, 64, 370, 280, fill="white")
|
drawLine(172, 64, 370, 280, fill="white")
|
||||||
|
|
||||||
|
#bobber?
|
||||||
|
|
||||||
|
|
||||||
def drawShopEntities(app):
|
def drawShopEntities(app):
|
||||||
# Draw the clickable shop/UI sprites standing on the grass (per the spec).
|
# Draw the clickable shop/UI sprites standing on the grass (per the spec).
|
||||||
# Positions here must line up with the hit-testing done in onMousePress so
|
# Positions here must line up with the hit-testing done in onMousePress so
|
||||||
# clicks land on the right entity.
|
# clicks land on the right entity.
|
||||||
pass
|
|
||||||
|
#dimming
|
||||||
|
drawRect(0,0,app.width,app.height,opacity=50)
|
||||||
|
#menu background
|
||||||
|
drawRect(50,50,app.width-100,app.height-100,fill='bisque',border='lightCoral',borderWidth=5)
|
||||||
|
#exit "X"
|
||||||
|
drawLine(app.width-45, 5, app.width-5, 45, fill='red', lineWidth=5)
|
||||||
|
drawLine(app.width-5, 5, app.width-45, 45, fill='red', lineWidth=5)
|
||||||
|
|
||||||
|
|
||||||
def drawSkillCheck(app):
|
def drawSkillCheck(app):
|
||||||
# Draw the active skill-check overlay: the circle, the target bars placed
|
# Draw the active skill-check overlay: the circle, the target bars placed
|
||||||
# around it (count/length from difficulty), and the rotating cursor at its
|
# around it (count/length from difficulty), and the rotating cursor at its
|
||||||
# current angle. Optionally show which bars are already cleared. Read-only.
|
# current angle. Optionally show which bars are already cleared. Read-only.
|
||||||
pass
|
|
||||||
|
#IMPORTANT: circle is like unit circle for drawing, but we want it to have 0 at the top. transformations will be needed
|
||||||
|
|
||||||
|
#radius of circle
|
||||||
|
r = 90
|
||||||
|
|
||||||
|
#basic path
|
||||||
|
#REMINDER: cx, cy, r
|
||||||
|
drawCircle(300, 130, r, fill=None,border='dimGray')
|
||||||
|
|
||||||
|
#bars
|
||||||
|
for barPos, barLen in app.skillCheckBars:
|
||||||
|
drawArc(300,130, r * 2 + 20, r * 2 + 20, -barPos + 90 - barLen, barLen, fill="white")
|
||||||
|
|
||||||
|
#cover up center of bars
|
||||||
|
drawCircle(300, 130, r - 10, fill=app.background)
|
||||||
|
|
||||||
|
#cursor
|
||||||
|
#REMINDER: width and height are for oval (so r * 2)
|
||||||
|
#REMINDER: cx, cy, width, height, startangle, sweepangle
|
||||||
|
drawArc(300,130, r * 2 + 20, r * 2 + 20, -app.skillCheckAngle + 90, 2, fill="red")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def drawCatchDisplay(app):
|
def drawCatchDisplay(app):
|
||||||
@@ -505,7 +545,7 @@ def drawDebug(app):
|
|||||||
mX: {gmouseX}, mY: {gmouseY}
|
mX: {gmouseX}, mY: {gmouseY}
|
||||||
Scene: {app.scene}
|
Scene: {app.scene}
|
||||||
fishingTimer: {rounded(app.fishingTimer)}
|
fishingTimer: {rounded(app.fishingTimer)}
|
||||||
hookedFish: {app.hookedFish["name"]}
|
hookedFish: {app.hookedFish["name"] if app.hookedFish else "N/A"}
|
||||||
"""
|
"""
|
||||||
debugLines = debugStr.splitlines()
|
debugLines = debugStr.splitlines()
|
||||||
size = 16
|
size = 16
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
{"cash": 86.0, "owned_baits": ["Worms"], "owned_upgrades": [], "current_bait": "Worms", "catch_log": []}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
###############################################
|
###############################################
|
||||||
Total Time: 190 minutes
|
Total Time: 330 minutes
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
###############################################
|
###############################################
|
||||||
@@ -53,7 +53,7 @@ Description: finish up (mostly) basic functions and move onto controller, work o
|
|||||||
###############################################
|
###############################################
|
||||||
Date: 08-Oct
|
Date: 08-Oct
|
||||||
Start Time: 7:20pm
|
Start Time: 7:20pm
|
||||||
End Time: 1:20am
|
End Time: 9:40pm
|
||||||
Duration: 40 minutes
|
Duration: 140 minutes
|
||||||
Description: finish up (mostly) basic functions and move onto controller, work out a bunch of finer logic and complex math
|
Description: get a decent chunk of the visuals done and finish logic, much closer to being done
|
||||||
###############################################
|
###############################################
|
||||||
|
|||||||
Reference in New Issue
Block a user