I don't have experience on python. I want move object and move something like this: How to make it works like that ? I don't have much time to learn all python commands because i just want it simple. Thank you.
Simple script, need more work but its good start.
from bge import logic logic.mouse.visible = True def main(cont): #cont = currentController cont.owner.worldPosition.x = logic.mouse.position**2 # owner likely the cube
just add a cube and in logic nodes add always sensor + python controller.
"logic.mouse.visible = True" show the mouse when bge its runnig so you can see the mouse position on screen. For clarify: my script name is "script.py" so im using python controller to run a module name main from my script ("def main()"), so every tick it run main().
and the script should be like this:
from bge import logic logic.mouse.visible = True def main(cont): #cont = currentController cont.owner.worldPosition.x = logic.mouse.position**2 # owner likely the cube main()
OR just this:
from bge import logic cube = logic.getCurrentController().owner cube.worldPosition.x = logic.mouse.position**2
so this script NEED MORE WORK, to get it work like you want you need to work on it, and dont need to learn a bunch of things.
And for the last tip. mouse position go from 0.0 to 1.0 and when mouse position its > 0.5 will go to the left of the screen (your right) and the other way if its < 0.5. Finally if you show your work and not just and example without trying yourself to solve it, i cant help you anymore because the idea its to you learn something and not just copy.