I’m not good at much, the programs were done by some on here, and some of it myself using the video site. Now that the game engine has been cancelled by the foundation, some of what I had used isn’t up anymore.
But that isn’t much of point really worth mentioning. I at least was able to produce something thanks to blender and the bricks. I wouldn’t of made anything I had imagined years ago.
I tried to learn python in the past, some helped via email, and it didn’t work out. This was before blender usage.
As for getting a program going,
Your telling me that alone is what I need to get the player and AI to interact and produced an event of If this or that result?
from bge import logic
# what is the controller that is being executed right now?
controller = logic.getCurrentController()
# what is the object that owns that controller?
owner = controller.owner
# scripts can be triggered when a logic brick is going from positive to negative
if all(sensor.positive for sensor in controller.sensors):
ray_length = 2 # blender units
ray_target = owner.worldPosition + owner.getAxisVect((0, ray_length, 0))
# we are going to cast a ray from owner to some distance in front of it (+y)
# the ray will return something if it hits an object with a "life" property
hit, point, normal = owner.rayCast(ray_target, None, ray_length, 'life')
if hit:
# from that point, hit is an object
hit['life'] -= 1
if hit['life'] < 0:
# oh no, hit is dead!
hit.endObject()