Game Development Community

Arguments

by rennie moffat · in General Discussion · 08/12/2009 (11:16 am) · 2 replies

can be defined as..."what we want to pass while calling a particular function."

going on that i would say this...
onMouseDown(%this, %worldPos, %clicks, %modifier)
in this case all that is inside the () are arguments, being passed on.

but if we are to go into the function, we look at the methods. What I am wondering is, do the methods contain arguments? And perhaps more accurately in my case, can functions be methods?

ex.
function setAPosition::onMouseDown(%this, %worldPos, %clicks, %modifier)
{
setTagetPosition(%x, %y, %speed)
}

or is that just gobble dee gook for the computer? Should what is inside the function be more of a command and less of an abstraction?

I hope I am making sense here.

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.


#1
08/12/2009 (12:58 pm)
The inside of a function are the variables, logic, and additional functions that you would use to work with those arguments in order to get the game to do what you want to do. I wouldn't overthink it any more than that ;)

Also, you probably want to use the forum search function before you post a question, as well as read up on scripting, since many of the questions you're posting are already explained elsewhere.
#2
08/12/2009 (1:00 pm)
ok thank you.