feat(engine,core): add elapsed-time tick system and Zen GameMode
Phase 6 part 4 (partial): - GameState now tracks elapsed_seconds via tick_elapsed_time in GamePlugin (per-second increment while not won). Pure helper advance_elapsed makes the tick logic directly testable without mocking Bevy Time. - New GameMode enum (Classic / Zen) on GameState. Zen mode suppresses scoring in move_cards and undo. GameState::new_with_mode allows callers to construct non-Classic games; the existing GameState::new still defaults to Classic. mode is serde(default) for backwards-compatible persistence. - NewGameRequestEvent gains an optional mode field; handle_new_game honours it (falling back to the current game's mode when None). - InputPlugin: pressing Z starts a fresh Zen-mode game. Time Attack, Challenge mode, level-5 unlock gating, and unlock UI are still deferred. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -69,7 +69,13 @@ fn handle_keyboard(
|
||||
undo.send(UndoRequestEvent);
|
||||
}
|
||||
if keys.just_pressed(KeyCode::KeyN) {
|
||||
new_game.send(NewGameRequestEvent { seed: None });
|
||||
new_game.send(NewGameRequestEvent::default());
|
||||
}
|
||||
if keys.just_pressed(KeyCode::KeyZ) {
|
||||
new_game.send(NewGameRequestEvent {
|
||||
seed: None,
|
||||
mode: Some(solitaire_core::game_state::GameMode::Zen),
|
||||
});
|
||||
}
|
||||
if keys.just_pressed(KeyCode::KeyD) {
|
||||
draw.send(DrawRequestEvent);
|
||||
|
||||
Reference in New Issue
Block a user