Hello! I have built a prototype game in Blender Game Engine using Python to make the modules. I am interested in learning how to take python things I normally do and turn them into c# for Unity.
First question: I have these modules in my game:
-battle_functions.py
-battle_script_.py
-hud_script_.py
-hud_module.py
-player_movement.py
-fighter_class.py
-module for each monster.py
-world_functions.py
-world_script.py
-camera_functions.py
Is it safe to say that each of these modules will directly translate into a c# script? Because of Monobehaviour Update(), I think I can consolidate, for example, hud_script_ into hud_module.
I am going to give you an example function from my BGE turn based RPG game’s battle_functions.py module
Please rewrite this, or explain how to rewrite in c#. I think it would help me start to understand where to begin in rewriting the code.
#this is not within a python class, it is just a function in a module
def get_target_obj(target):
target_obj = [ob for ob in logic.getSceneList()[0].objects if 'battleID' in ob and ob['battleID'] == target]
if check_confused(get_actor_obj()) == True:
new_target = random.choice(get_battler())
return new_target
else:
return target_obj[0]