diff --git a/DESIGN.md b/DESIGN.md index d10cdb7..4882b1f 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -203,8 +203,8 @@ Current directives: `TILESET`, `SIZE`, `SPAWN`, `GRAVITY`, `WIND`, `BG_COLOR`, ` | Action | Key | Status | |-----------|--------------|---------------| | Move | Arrow keys | Implemented | -| Jump | Z | Implemented | -| Shoot | X / Space | Implemented | +| Jump | Z / Space | Implemented | +| Shoot | X | Implemented | | Aim up | UP (+ shoot) | Implemented | | Aim diag | UP+LEFT/RIGHT (+ shoot) | Implemented | | Dash | C | Implemented | diff --git a/Makefile b/Makefile index e8b5f82..f5abe6d 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,13 @@ OBJ_ALL := $(SRC_ALL:src/%.c=$(OBJ_DIR)/%.o) all: $(BIN) -$(BIN): $(OBJ_ALL) | outdirs +# On WASM builds the shell template is baked into the output HTML, +# so re-link whenever it changes. +ifdef WASM +EXTRA_LINK_DEPS := web/shell.html +endif + +$(BIN): $(OBJ_ALL) $(EXTRA_LINK_DEPS) | outdirs $(CC) $(OBJ_ALL) -o $@ $(LDFLAGS) outdirs: diff --git a/src/engine/input.c b/src/engine/input.c index d2126d4..2f2dfe8 100644 --- a/src/engine/input.c +++ b/src/engine/input.c @@ -40,7 +40,7 @@ static SDL_Scancode s_bindings[ACTION_COUNT] = { /* Alternate bindings (0 = no alternate) */ static SDL_Scancode s_alt_bindings[ACTION_COUNT] = { - [ACTION_SHOOT] = SDL_SCANCODE_SPACE, + [ACTION_JUMP] = SDL_SCANCODE_SPACE, }; void input_init(void) { diff --git a/web/shell.html b/web/shell.html index 6b2c415..db7625d 100644 --- a/web/shell.html +++ b/web/shell.html @@ -60,6 +60,17 @@ max-width: 1300px; } #hint { color: #666; } + #game-controls { + display: flex; + align-items: center; + gap: 8px; + margin-top: 8px; + font-size: 12px; + color: #666; + flex-wrap: wrap; + justify-content: center; + max-width: 1300px; + } .ctrl-btn { color: #4ecdc4; background: transparent; @@ -100,7 +111,7 @@ -
+ +
+ Arrows=move + | + Z/Space=jump + | + X=shoot + | + C=dash + | + Up=aim up +
Loading...
{{{ SCRIPT }}}