onUpdate position in script
by rennie moffat · in Torque Game Builder · 08/10/2009 (1:10 pm) · 4 replies
For a general playerClass.cs which requires an onUpdate callback, I have a question regaruding this code.
A. should this be positioned in a specific position with in the playerClass.cs file? ie, top, bottom middle, right after... and if so why?
function playerClass::onUpdate(%this)
{
%this.updateHorizontal();
%this.updateVertical();
%this.setCurrentAnimation();
}A. should this be positioned in a specific position with in the playerClass.cs file? ie, top, bottom middle, right after... and if so why?
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.
#2
How big can a file get.. or perhaps, what is too big?
08/10/2009 (1:30 pm)
What do you mean by that?How big can a file get.. or perhaps, what is too big?
#3
Where you define a function does not matter. As long as the object has already been defined, all its methods can be defined in any order. Just make sure they are defined and its sourcefile is exec'd before you call them.
08/10/2009 (3:05 pm)
Too big is a machine-dependent thing. I don't think there is any limit, except the practical.Where you define a function does not matter. As long as the object has already been defined, all its methods can be defined in any order. Just make sure they are defined and its sourcefile is exec'd before you call them.
#4
I had read earlier tho, in one tutorial I was following along with and I remember it saying that where you placed this Xcode in the XX.cs file, was very important. This is not true tho?
Also, when placing a datablock in the main.cs, as some tuts do, would I place a datablock in the onStart Function?
08/10/2009 (3:12 pm)
Ok, I had read earlier tho, in one tutorial I was following along with and I remember it saying that where you placed this Xcode in the XX.cs file, was very important. This is not true tho?
Also, when placing a datablock in the main.cs, as some tuts do, would I place a datablock in the onStart Function?
Torque 3D Owner Ronny Bangsund
Torque Cheerleaders