You do not need an animation that long. It is hard to handle (at least in my eyes). As said you can play fractions of frames.
The easiest is to use whatever you get as input (1:1). Somehow I doubt you get a turn of 750 from the wheels. As there might be technical problem s(e.g. like sometimes not playing negative frames) you can apply a conversion from what you get from wheels (turn angle) to what want to play (frames). Rather than a script you can use the mini language of the property actuator. Even your 0…750…1500 range would work that way “(turn*1500)+750”.
I know the template have some strange influence from some C developers. In Script mode everything is executed from top to button. That includes any function definition. Different than in other programming languages (like C) in Python a function can only be called after the function was defined. The result is the reader needs to jump other your function definitions to see what happens and than he needs to jump back. Due to the meaningless “main” he can’t even guess what it is supposed to do.
Here is how to write a proper script:
myScriptFromTemplate
some code
def main (): <- get rid of this line
code block <- unindent this code
main() <- get rid of this code
the result is
myPureScript
some code
code block
It is not just smaller. It is much easier to read.
Finally you do not need these templates. They might look like a good start-up, but only when you know nothing. I do not think they are good, as they teach the wrong things to beginners. It is good to see in this forum how that spreads around. Cryptic abbreviations and meaningless descriptors are not good for any code.
Keep in mind … scripts belong to small code blocks. If your code is supposed to do a lot of things, it is better to encapsulate the different operations in separate functions. Due to the above issues I strongly suggest to move them into a module. This allows to concepts:
A) use module mode
myModule.py
def demonstrateBgeCallableFunctionWithController(controller):
print("Callable from BGE controller. Called with", controller, "by", controller.owner)
def demonstrateBgeCallableFunctionWithoutController():
print("Callable from BGE controller. Called without argument if needed get it from context (bge.logic).")
def demonstrateNonCallableFunction(a, b, c=None):
print("Can't be called from a BGE controller, but any other Python code block")
B) place your functions in a different module file (moduleName.py) and import it into your script:
myUtilities.py
def demonstrateFunction():
print("demonstrating a function")
myscript
import myUtilities
demonstrateFunction()
The methods can be mixed. E.g. you can import a module from another module. It is the same code.
Be aware: you can 't import a script.