()
| 10 | const milestoneThresholds = [10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 25000, 50000, 100000]; |
| 11 | |
| 12 | function createState() { |
| 13 | return { |
| 14 | credits: 0, |
| 15 | limit: 100, |
| 16 | character: "mr", |
| 17 | dead: false, |
| 18 | achievements: [], |
| 19 | fruit: null, |
| 20 | fruitVersion: 0, |
| 21 | entitlement: null, |
| 22 | runVersion: 0, |
| 23 | }; |
| 24 | } |
| 25 | |
| 26 | function nextMilestone(credits) { |
| 27 | return milestoneThresholds.find((threshold) => threshold > credits) || milestoneThresholds[milestoneThresholds.length - 1]; |