First, sorry for my English, I’m from Brazil, I do not speak English well and I’m using google translate to write this.
I have a python code in bge that does not show errors, but does not work.
I have the following code:
from bge import logic as g, events c = g.getCurrentController() o = c.owner s = g.getCurrentScene() t = g.keyboard.events X = t[events.XKEY] in [1,1] Z = t[events.ZKEY] in [1,1] if X: s.addObject('A', o) o['b'] = True if o['b'] == True: a = s.objects['A'] elif Z: a['p'] = True
in theory, if I press ‘X’, it adds an ‘A’ object and makes it a true property (b), if this property is true it makes the object ‘A’ a variable (a), and finally if I press’ Z ‘a variable of’ A 'should become true but not work.
Thank you in advance for the help.