diff --git a/app/assets/audio/title.m4a b/app/assets/audio/title.m4a new file mode 100644 index 0000000..9cc8847 Binary files /dev/null and b/app/assets/audio/title.m4a differ diff --git a/app/assets/translations/en-US.json b/app/assets/translations/en-US.json index 772a6dc..201efc6 100644 --- a/app/assets/translations/en-US.json +++ b/app/assets/translations/en-US.json @@ -7,6 +7,7 @@ "next_level": "Next Level", "coming_soon": "Coming Soon!", "close": "Close", + "credits": "Credits", "lanka_dahan_intro": "As the sun dipped below the horizon, casting an amber glow over the ancient city of Lanka, you, Fearless Hanuman, found yourself ensnared. Ravana, the ten-headed demon king, had captured you—the mighty ape warrior. His eyes gleamed with malice as he spoke:\n\n“कपीनां किल लाङ्गूलमिष्टं भवति भूषणम्।\nतदस्य दीप्यतां शीघ्रं तेन दग्धेन गच्छतु।।5.53.3।।”\n\nTranslation: “The tail of a monkey is dear to them. It is like an ornament to them. Set it blaze swiftly with fire, and let him go.”\n\nBut you are Hanuman—the wind-swift, the leaper of oceans, the loyal servant of Lord Rama. You have the blessings of Maa Sita. \nThe flames would dance upon your fur, but it is as cold as ice.\nAs your heart beats with courage, and mischief twinkled in your eyes. \nYou would turn Lanka into an inferno, a beacon of defiance.\nCross the sprawling city, avoid detection, and unleash the flames of retribution. \n\nRemember, Fearless Hanuman, you have but one chance. If captured, the level resets. The city awaits your wrath, and Lanka trembles in anticipation.\n\nNote: Inspired by the epic Ramayana, this game level is a fictional adaptation.", "win_message": "You have successfully destroyed Lanka!" } \ No newline at end of file diff --git a/app/assets/translations/hi-IN.json b/app/assets/translations/hi-IN.json index 34c3a7b..2cd413e 100644 --- a/app/assets/translations/hi-IN.json +++ b/app/assets/translations/hi-IN.json @@ -7,6 +7,7 @@ "next_level": "अगला अध्याय", "coming_soon": "जल्द ही आ रहा है", "close": "ठीक है", + "credits": "श्रेय", "lanka_dahan_intro": "As the sun dipped below the horizon, casting an amber glow over the ancient city of Lanka, you, Fearless Hanuman, found yourself ensnared. Ravana, the ten-headed demon king, had captured you—the mighty ape warrior. His eyes gleamed with malice as he spoke:\n\n“कपीनां किल लाङ्गूलमिष्टं भवति भूषणम्।\nतदस्य दीप्यतां शीघ्रं तेन दग्धेन गच्छतु।।5.53.3।।”\n\nTranslation: “The tail of a monkey is dear to them. It is like an ornament to them. Set it blaze swiftly with fire, and let him go.”\n\nBut you are Hanuman—the wind-swift, the leaper of oceans, the loyal servant of Lord Rama. You have the blessings of Maa Sita. \nThe flames would dance upon your fur, but it is as cold as ice.\nAs your heart beats with courage, and mischief twinkled in your eyes. \nYou would turn Lanka into an inferno, a beacon of defiance.\nCross the sprawling city, avoid detection, and unleash the flames of retribution. \n\nRemember, Fearless Hanuman, you have but one chance. If captured, the level resets. The city awaits your wrath, and Lanka trembles in anticipation.\n\nNote: Inspired by the epic Ramayana, this game level is a fictional adaptation.", "win_message": "आपने लंका को सफलतापूर्वक दहन कर दिया है!" } \ No newline at end of file diff --git a/app/lib/title_screen/level_intro.dart b/app/lib/title_screen/level_intro.dart index f58c3e8..eb17f13 100644 --- a/app/lib/title_screen/level_intro.dart +++ b/app/lib/title_screen/level_intro.dart @@ -4,7 +4,8 @@ import 'package:flutter/material.dart'; import 'package:ramayana/game/game_engine.dart'; class LevelIntro extends StatelessWidget { - const LevelIntro({Key? key, required String level}) : super(key: key); + const LevelIntro({Key? key, required this.level}) : super(key: key); + final String level; @override Widget build(BuildContext context) { @@ -19,7 +20,7 @@ class LevelIntro extends StatelessWidget { child: AnimatedTextKit( isRepeatingAnimation: false, animatedTexts: [ - TypewriterAnimatedText('lanka_dahan_intro'.tr(), + TypewriterAnimatedText('${level}_intro'.tr(), textStyle: const TextStyle( fontSize: 14, color: Colors.white, @@ -34,8 +35,7 @@ class LevelIntro extends StatelessWidget { onPressed: () => Navigator.push( context, MaterialPageRoute( - builder: (context) => - GameEngine(level: 'lanka_dahan'))), + builder: (context) => GameEngine(level: level))), child: Text('start_game'.tr())), ), ), diff --git a/app/lib/title_screen/title_screen.dart b/app/lib/title_screen/title_screen.dart index 2b4dd7b..93a2bdf 100644 --- a/app/lib/title_screen/title_screen.dart +++ b/app/lib/title_screen/title_screen.dart @@ -1,4 +1,5 @@ import 'package:easy_localization/easy_localization.dart'; +import 'package:flame_audio/flame_audio.dart'; import 'package:flutter/material.dart'; import 'package:ramayana/game/game_engine.dart'; import 'package:ramayana/level_picker/world_selector.dart'; @@ -19,6 +20,7 @@ class _TitleScreenState extends State { @override void initState() { super.initState(); + AudioController.playBgm('title'); _controller = VideoPlayerController.asset('assets/splash/splash.mp4') ..initialize().then((_) { _controller?.play(); @@ -50,6 +52,20 @@ class _TitleScreenState extends State { children: [ LanguagePicker(), const SizedBox(height: 20), + ElevatedButton( + style: ButtonStyle( + backgroundColor: + MaterialStateProperty.all(Colors.white54)), + onPressed: () => Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + LevelIntro(level: 'credits'))), + child: Text( + 'credits'.tr(), + style: TextStyle(color: Colors.black87), + )), + const SizedBox(height: 20), IconButton( style: ButtonStyle( backgroundColor: