I'm programming a game, and I have an empty that I want to be dropping enemies randomly throughout the map. I have the following logic bricks and Python script right now:
import bge
def main():
cont = bge.logic.getCurrentController()
own = cont.owner
sens = cont.sensors['mySensor']
if sens.positive:
own.worldPosition = [own['xPos'], own['yPos'], 30]
main()
My empty is staying in the same place, but it is at least adding enemies every second. How can I make the empty go to the random positions that are being generated by random actuator (I would have used the random module but it wasn't working last time I tried it).