I am currently developing a Sidescroll Script for my Game Orbito. At the moment the whole Movement is solved via logic bricks. This is something I want to change. I am making good progress! I want to make this script very generic and customizable. I think when it is once finished I will publish it as an template!
Here are some little points I am going to implement.
-usual left/right movement (speed and acceleration can be set via propertys)
-jump and doublejump (can be enabled and disabled via a property)
Other things may follow.
I have a question concerning intializing variables. How can I create variables that do not get overwritten each tic the script is executed?
For example I have a rotation value of my character with a default setting of rot = 90
And I have a function that changes this value to rot = 180. But when the script is executed again it gets set to rot = 90 again.
It sure is possible but I do not know how. In unity 3d you have an Update()… So everything that is not in it will only be executed once.
Thanks in advance!