Hello,
The topic says it all.
Yesterday, I've managed to figure it out how to assign the three skills to each character. The problem is that I did it using some alerts when I pressed the keys, but now I want some sounds to be plaied.
It is possible to make a bidimensional sound array and play it? I'll put the code below to have a more detailed view on what I'm talking about.
So, the below code, when you press A or S, it will show an alert with the specific weapons of each character.
So, in stead of alerts, I want to do exactly the same things, but this time using sounds instead of alerts.
Should I create a bidimensional sound array? And how to make it working properly?
string[] character_skills_initialisation(int x)
{
string[][] character_skills;
character_skills.resize(3);
for(int s=0; s<2; s++)
character_skills[s].resize(3);
character_skills[0][0]="topor";
character_skills[0][1]= "sabie";
character_skills[0][2]= "cutit";
character_skills[1][0]= "catana";
character_skills[1][1]= "sabie";
character_skills[1][2]= "sapa";
return character_skills[x];
}
void fight(int character_name)
{
string[] a={" "," "," "};
a=character_skills_initialisation(character_name);
while(true)
{
if(key_pressed(KEY_Q)) exit();
if(key_pressed(KEY_A))
{
alert("hello", a[0]);
}
if(key_pressed(KEY_S))
{
alert("hello", a[1]);
}
if(key_pressed(KEY_ESCAPE))
{
personaj_menu();
}
wait(5);
}
}