Skip to content

Commit

Permalink
feat(game/display/Gauge): improve gauge progression
Browse files Browse the repository at this point in the history
  • Loading branch information
dtinth committed Oct 30, 2016
1 parent 1268981 commit 34012b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/game/audio/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import PlayerAudio from './player-audio'

export class GameAudio {
Expand Down
12 changes: 7 additions & 5 deletions src/game/display/Gauge.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,18 @@ function hopeGauge () {
return {
update (playerState) {
const stats = playerState.stats
const maxPossibleScore = stats.maxPossibleScore
const realHope = Math.max(0, maxPossibleScore - 500000) / 55555
const progress = stats.numJudgments / stats.totalCombo
const hopeS = Math.min(1, realHope * (progress * progress + 0.75 * progress + 0.25))
const getHope = (min, max1, max2) => {
const max = max1 + (max2 - max1) * progress
const maxPossibleScore = stats.maxPossibleScore
return Math.max(0, (maxPossibleScore - min) / (max - min))
}
const hopeS = Math.min(1, getHope(500000, 555555, 510000) * 0.5)
primary = hopeS
if (hopeS > 0) {
secondary = 0
} else {
const realHopeA = Math.max(0, maxPossibleScore - 450000) / 50000
const hopeA = Math.min(1, realHopeA * (0.67 * progress * progress + 0.33 * progress))
const hopeA = getHope(450000, 500000, 500000)
secondary = hopeA
}
},
Expand Down

0 comments on commit 34012b2

Please sign in to comment.