Closed pandaxin8 closed 4 months ago
Story
class to encapsulate each story segment, including text, speaker, optional choices, and any related media (images, sounds)Story
objects to represent the entire narrative, which allows for segmented progressionclass StorySegment {
final String id;
final String text;
final String character;
final String? imagePath;
final List<String>? choices;
StorySegment({
required this.id,
required this.text,
required this.character,
this.imagePath,
this.choices,
});
// ... Additional methods and properties as needed ...
}
DialogueBox
widget to display the text and character information. This widget should adapt to the content's length and the screen's size.Next
and Skip
buttons in the DialogueBox
, triggering events to advance or skip the narrative.StatefulWidget
to manage the current index in the narrative list, updating the UI as the player moves through the story.class NarrativeController extends StatefulWidget {
@override
_NarrativeControllerState createState() => _NarrativeControllerState();
}
class _NarrativeControllerState extends State<NarrativeController> {
int currentIndex = 0;
List<StorySegment> storySegments = []; // Initialize with your story data
void nextSegment() {
if (currentIndex < storySegments.length - 1) {
setState(() {
currentIndex++;
});
} else {
// End of narrative logic
}
}
void skipStory() {
// Logic to skip to the end or a specific part of the story
}
@override
Widget build(BuildContext context) {
return DialogueBox(
segment: storySegments[currentIndex],
onNext: nextSegment,
onSkip: skipStory,
);
}
}
Successfully structured the intro narrative into Firestore documents, representing key story segments for the game's introduction. Each segment details the setting, character focus, narrative text, associated imagery, and player choices where applicable.
Key milestones
Next, we will proceed with implementing the dialogue management system to display these story segments in the game, allowing players to progress through the narrative at their own pace.
StorySegments
Description: Develop a system for managing and displaying the narrative script in a player-friendly manner. This system should: