Game Development Community

mAbs, posmod, and some other bits.

by rennie moffat · in Torque Game Builder · 11/23/2009 (3:30 pm) · 6 replies

I am just going over this code but some of the ID's confuse me.


For instance, the line...


if (%newXPos < 0) { %posmod=-1; } else { %posmod = 1; }


The {} brackets are used to house %posmod condition/state, I have also seen these, in a string (sort of? don't know exact term but just as here, after a string or whatever was inside (), PLEASE tell me if this terminology is wrong, if it is. I also am not sure what %posmod is supposed to stand for. Position Modified?


Also, mAbs, is this a base mathematical command like sine, cos or something?

Full function...
function movePaddle(%worldPosition) {
		%newXPos = getword(%worldPosition,0);
		if (%newXPos < 0) { %posmod=-1; } else { %posmod = 1; }
		if (mAbs(%newXPos) > 65) %newXPos = %posmod * 65;
}

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.


Thread is locked
#1
11/23/2009 (3:39 pm)
Both the if-statement is mAbs are well defined in the documentation.
#2
11/23/2009 (3:41 pm)
I searched but found no immediate answers I did not feel like looking for something that simple ( i am guessing) when I could concentrate on other things, but thanks for taking the time to tell me to look elsewhere, really appreciate it, very helpful, thanks.


#3
11/23/2009 (6:24 pm)
Quote:I did not feel like looking for something that simple ( i am guessing) when I could concentrate on other things

Wow, now that's arrogant, considering the amount of simple help you request of the community every week. Honest, but arrogant...
#4
11/23/2009 (7:21 pm)
Let me get this straight. Instead of spending 3 minutes looking it up and getting an answer, you'd rather spend 5 minutes writing up a post then wait for an answer? An answer that will likely just be copied out of the documentation?

I'll be blunt. You must have the worst searching skills, because I did a quick search and found "mAbs" in the documentation in about 5 seconds. It also included 3 examples!

The day that you learn that the answer lies within you, not in the forums, will be the day you become a true programmer.
#5
11/23/2009 (8:02 pm)
Edited by moderator: Insulting the community is not the way to get help. Your question was answered and I'm locking this thread. If you wish to discuss it contact moderators@torquepowered.com.
#6
11/23/2009 (8:25 pm)
Quote:You accuse me of being ungrateful and wasting time, when I am sure you could answer a very simple answer quite easily.

So according to the above, if I answered your question, that would mean that you're not ungrateful and that it was worth my time to go search for your answer for you?

Quote:It's not arrogant, just a fact.

That you are aware of the fact that I can answer your question doesn't mean you didn't come off as arrogant when you said you didn't have time to look at the docs, but would rather have others do it for you.

I'm just saying that you should be more considerate of the community members that are currently trying to help you by looking at the docs before you ask the questions you're asking, because the answers are most likely in there.