Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
ci:
uses: got-feedback/.github/.github/workflows/reusable-ci.yml@main
Comment thread
coderabbitai[bot] marked this conversation as resolved.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Bongo Cat's Rhythm Trainer

A feedBack minigame plugin for practicing rhythms on your real instrument — guitar, bass, piano, or drums. Bongo Cat demos a rhythm pattern in time with the metronome, then you play it back; your hits are picked up through feedBack's note detection and judged against the beat.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

## How it works

- Pick an instrument, mode, and tempo from the minigame modifiers.
- Bongo Cat plays the pattern first (with paw animations synced to the beat), and a notation strip shows what to play.
- Play the pattern back. Each hit is scored discretely (timing judgement per note), with a HUD tracking your accuracy and streak.
- **Learning mode** eases you in and repeats patterns; **Challenge mode** keeps generating new ones and pushes the difficulty.
- Run history is kept per session so you can see your progress over time.

## Modifiers

| Modifier | Values | Default |
|---|---|---|
| Instrument | guitar/bass, piano, drums | guitar/bass |
| Mode | learning, challenge | learning |
| Tempo (BPM) | 60–160 in 20 BPM steps | 80 |
| Calibration | auto, on, off | auto |

## Structure

- `game.js` — plugin entry point
- `src/` — game logic: beat clock, pattern generator, input gate/judge, scoring, run controller, FSM, HUD, notation strip, cat animations
- `src/notedetect-bridge.js` — bridge to feedBack's note-detection plugin
- `routes.py` — server-side routes
- `assets/` — sprites, fonts, styles
- `docs/implementation-artifacts/` — design notes per feature

## Development

```bash
npm install
npm test # vitest
```
10 changes: 8 additions & 2 deletions game.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,20 @@
function configFromModifiers(modifiers) {
modifiers = modifiers || {};
var bpm = parseInt(modifiers.tempo, 10);
// "guitar/bass" is the user-facing modifier value; internally both are
// handled by the guitar (notedetect) input path.
var instrument = modifiers.instrument === "guitar/bass" ? "guitar" : modifiers.instrument;
return {
instrument: modifiers.instrument || "guitar",
instrument: instrument || "guitar",
mode: modifiers.mode || "learning",
bpm: isNaN(bpm) ? 80 : bpm,
calibration: modifiers.calibration || "auto",
};
}

// Exposed for tests only — not part of the SDK surface.
window.feedBackMinigamesBongoCatTest = { configFromModifiers: configFromModifiers };

var controller = null;

function startRun(container, config, sdk) {
Expand All @@ -81,7 +87,7 @@
// Mirrored in plugin.json's minigame block; the manifest copy takes
// precedence in the host's modifier picker.
modifiers: [
{ id: "instrument", label: "Instrument", default: "guitar", values: ["guitar", "piano", "drums"] },
{ id: "instrument", label: "Instrument", default: "guitar/bass", values: ["guitar/bass", "piano", "drums"] },
{ id: "mode", label: "Mode", default: "learning", values: ["learning", "challenge"] },
{ id: "tempo", label: "Tempo (BPM)", default: "80", values: ["60", "80", "100", "120", "140", "160"] },
{ id: "calibration", label: "Calibration", default: "auto", values: ["auto", "on", "off"] },
Expand Down
4 changes: 2 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
{
"id": "instrument",
"label": "Instrument",
"default": "guitar",
"values": ["guitar", "piano", "drums"]
"default": "guitar/bass",
"values": ["guitar/bass", "piano", "drums"]
},
{
"id": "mode",
Expand Down
Loading
Loading