Hi, I've tried to create a code for a game translation myself.
Unfortunately, it's not working. The translation_counter is working but it's not getting the right translation to it. How can I fix this?
Unfortunately, it's not working. The translation_counter is working but it's not getting the right translation to it. How can I fix this?
Code:
//Create Code
//Set Total Translations
total_translations = 3;
//Set translation counter
translation_counter = 0;
//Set Translations
translation[0,0] = "Play";
translation[1,0] = "Speel";
translation[2,0] = "Spielen";
translation[0,1] = "Options";
translation[1,1] = "Instellingen";
translation[2,1] = "Einstellungen";
//Switch Between Translation
switch (translation_counter){
case 0: //English
{
lang_play = translation[0,0];
lang_options = translation[0,1];
break;
}
case 1: //Dutch
{
lang_play = translation[1,0];
lang_options = translation[1,1];
break;
}
case 2: //German
{
lang_play = translation[2,0];
lang_options = translation[2,1];
break;
}
default: break;
}
Code:
//Step Code
if keyboard_check_pressed(vk_right) or keyboard_check_pressed(ord("D"))
{
translation_counter += 1;
}
if keyboard_check_pressed(vk_left) or keyboard_check_pressed(ord("A"))
{
translation_counter -= 1;
}
if translation_counter < 0
{
translation_counter = total_translations;
}
if translation_counter > 3
{
translation_counter = 0;
}
Code:
//Draw Code
//Draw translation_counter
draw_set_color(c_white);
draw_set_font(font0);
draw_text(room_width/2,room_height/2,string(translation_counter));
draw_text(room_width/2,room_height/2 - 100 ,string(lang_play));