From 7a72257633501113d742aa68fcca14940907ba2a Mon Sep 17 00:00:00 2001 From: "Elijah C. Voigt" Date: Mon, 12 Feb 2024 21:38:20 -0800 Subject: [PATCH] Plan out tutorial --- assets/martian.tweak.toml | 39 +++++++++++++++++++++++++ src/main.rs | 2 ++ src/tutorial.rs | 60 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 src/tutorial.rs diff --git a/assets/martian.tweak.toml b/assets/martian.tweak.toml index bc68187..f01513e 100644 --- a/assets/martian.tweak.toml +++ b/assets/martian.tweak.toml @@ -43,6 +43,45 @@ But Can you adapt? Will you be a part of the universal rhyme, and if so, which side are you on? """ +[tutorial] +intro = [ + "Greetings general, and welcome to 'Martian Advanced Rules for Generals: Long-Term engagement strategies'. As a part of your assignment to operation Red Rocks, it is in your best interest to thoroughly utilize this simulation to best prepare you for engagement with, and strategic domination of, Martian forces.", + "…", + "But first things first! How do you play the dang game?", +] + +objective = [ + "The Goal of Martian Chess is to have more points than your opponent when the game ends.", + "You get points by capturing your opponent's pieces.", + "The game ends when one player has no more pieces in their zone.", +] + +ownership = [ +""" +> When player or AI moves a piece across the canal, +This here line is called the canal. And blow me down if she aint a beaut! See herein lies the kicker of Martian warfare: You control any and only the pieces on your side of the canal. When you move a piece across the canal, your opponent assumes control over it. +""", +"Keep playing and try to score some points!", +] + +promotions = """ +> When player has either no drones or no Queens +Oh and one last thing: real nerds occasionally employ the field promotions strategy. Here’s how it works: If you control no drones, you may combine two pawns to make a drone. Similarly, if you control no Queens, you may combine two drones to make a queen. +""" + +outro = """ +Ok I gotta go now, but You now know enough to prevent human extinction. Do you want to finish this practice round? +""" + +[tutorial.pieces] +prompt = "Try picking up a piece" +pawn = "Pawn. The Pawn is worth 1 point, and moves 1 space diagonally. This thing ain’t worth your time. Put it down." +drone = "Drone. The Drone is worth 2 points, and moves 1 or 2 spaces horizontally or vertically. Neat. Back on the board." +queen = "Queen. The Queen is worth 3 Points, and moves any distance in a straight line. Woah, watch where you point that thing. Best put it back down." +jumping = "Note that jumping is not allowed. Martians banned any and all jumping in their society long ago." +end = "Ok, now move some pieces somewheres!" + + [resolution] x = 640 y = 480 diff --git a/src/main.rs b/src/main.rs index 054b6f7..080f874 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,7 @@ mod intro; mod loading; mod menu; mod prelude; +mod tutorial; mod tweak; mod ui; @@ -65,6 +66,7 @@ fn main() { app.add_plugins(ui::UiPlugin); app.add_plugins(tweak::TweakPlugin); app.add_plugins(intro::IntroPlugin); + app.add_plugins(tutorial::TutorialPlugin); app.run(); } diff --git a/src/tutorial.rs b/src/tutorial.rs new file mode 100644 index 0000000..c7a5bc0 --- /dev/null +++ b/src/tutorial.rs @@ -0,0 +1,60 @@ +use crate::prelude::*; + +pub(crate) struct TutorialPlugin; + +impl Plugin for TutorialPlugin { + fn build(&self, app: &mut App) { + app.add_state::(); + } +} + +#[derive(Debug, States, Hash, Default, PartialEq, Eq, Clone)] +enum TutorialState { + #[default] + None, + Intro, + Objective, + PieceIntro, + PieceQueen, + PieceDrone, + PiecePawn, + PieceJump, + PieceEnd, + Ownership, + Promotions, + Outro, +} + +// Assertion: "Tutorial" just starts a regular game with TutorialState set to Intro +// This plays out a usual game, but with tutorial text overlayed +// Once tutorial is done, the game can continue as usual + +// Intro animations, initialize all text windows but make invisible +// This should be run when TutorialState::Intro + +// Start by loading the same game as display3d does + +// Show the intro text when entering Intro TutorialState +// Continue + +// Show objective when entering Objective TutorialState +// Continue + +// Prompt user to click some pieces +// When each piece type is clicked, show relevant text +// Once all pieces are described say jumping text +// Finally end with final text +// Continue + +// When a piece crosses the canal, show ownership text +// Continue + +// A few moves in, show field promotions text +// Continue + +// End with outro text +// Continue + +// Play game out as usual + +// If player early exits, set TutorialState to None \ No newline at end of file