0
The same action but in 4 different languages.
What would the code look like in the following languages: C, C++, C# And Java, if a person when the R key has been pressed, the weapon they are holding reloads?
1 ответ
+ 1
C#:
private static void onKeyDown(......)
{
if (e.KeyCode == KeyCode.R)
{
thePlayerClass.theWeapon.reload();
}
}
Im assuming you know how handling events work, and also that you have a player class containing the weapon the player holds, and also that the weapon has a reload method.