Commit fb23ae7e authored by ajil.k's avatar ajil.k

added

parent 8f156139
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
......@@ -34,13 +34,14 @@ base_character = Character("Character", health=100, speed=5, damage=10, skills=1
# Creates a prototype object and register the base character
prototype = CharacterPrototype()
prototype.create_character("normal_character", base_character)
base_character_name = "normal_character"
prototype.create_character(base_character_name, base_character)
# Creates a new character by cloning the base character and updating its attributes
four_star_character = prototype.clone("normal_character", speed=25, damage=25)
five_star_character = prototype.clone("normal_character", health=125, speed=30, damage=50)
# Creates 2 new characters by cloning the base character and updating its attributes
four_star_character = prototype.clone(base_character_name, speed=20, damage=25, skills=15)
five_star_character = prototype.clone(base_character_name, health=125, speed=30, damage=50, skills=20)
# Printing the characters
print("Normal Character attribute:\n", base_character)
print("Base Character attribute:\n", base_character)
print("4 STAR Character attribute:\n", four_star_character)
print("5 STAR Character attribute:\n", five_star_character)
import pyttsx3
# initialize the engine
engine = pyttsx3.init()
# set the voice
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
# say the text
engine.say("Let's Enjoy the moment.")
# run the engine
engine.runAndWait()
# from gtts import gTTS
# import os
#
# # Specify the Malayalam text to be spoken
# text = "ഷിബിലി നീ എന്ത് ചെയ്യുന്നു"
#
# # Create a gTTS object and specify the language as Malayalam
# tts = gTTS(text=text, lang='ml')
#
# # Save the audio as mp3 file
# tts.save("malayalam_audio.mp3")
#
#
# # Use the default media player to play the audio file
# os.system("start malayalam_audio.mp3")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment