Skip to content

Commit

Permalink
added credits and bgm
Browse files Browse the repository at this point in the history
  • Loading branch information
aruhant committed Feb 7, 2024
1 parent 8018935 commit 83936ea
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
Binary file added app/assets/audio/title.m4a
Binary file not shown.
1 change: 1 addition & 0 deletions app/assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
}
1 change: 1 addition & 0 deletions app/assets/translations/hi-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "आपने लंका को सफलतापूर्वक दहन कर दिया है!"
}
8 changes: 4 additions & 4 deletions app/lib/title_screen/level_intro.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand All @@ -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())),
),
),
Expand Down
16 changes: 16 additions & 0 deletions app/lib/title_screen/title_screen.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -19,6 +20,7 @@ class _TitleScreenState extends State<TitleScreen> {
@override
void initState() {
super.initState();
AudioController.playBgm('title');
_controller = VideoPlayerController.asset('assets/splash/splash.mp4')
..initialize().then((_) {
_controller?.play();
Expand Down Expand Up @@ -50,6 +52,20 @@ class _TitleScreenState extends State<TitleScreen> {
children: <Widget>[
LanguagePicker(),
const SizedBox(height: 20),
ElevatedButton(
style: ButtonStyle(
backgroundColor:
MaterialStateProperty.all<Color>(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:
Expand Down

0 comments on commit 83936ea

Please sign in to comment.