I'll take a look at that, Emerica. Thanks.Zitat:
Zitat von emericaska8r
Printable View
I'll take a look at that, Emerica. Thanks.Zitat:
Zitat von emericaska8r
Hey is this how this works?
Code:
function check(dummy)
if pad:dummy then
screen:print(50, 100, "You just pressed".. dummy, black)
end
end
then if i put something instead of dummy, it just rewrites the function with that worrd like..
check(cross)
would that take out dummy and replace it with cross?.. I think thats how this works
Yes, exept that you forgot the "()".Zitat:
Zitat von montrob
Code:function check(dummy)
if pad:dummy() then
screen:print(50, 100, "You just pressed: ".. dummy, black)
screen.blit() --Remove if not needed.
end
end
check(cross)
Zitat:
Zitat von montrob
really...? cool.Zitat:
Zitat von HaxxBlaster
so, that makes whatever coding the is in the function able to work on any variable, and not just the one mentioned in it?
what else does the inside of the parantheses do when a function is called? I've seen this use before, just never understood it.
yea same as jon frost i think thats cool. I would also like to know more about what all you can do with the inside of the parantheses things.
Lol.. and ive been coding long functions for everysingle thing.. this will make the final of AlphaAttackPSP come alot faster!
you didnt know that?? i thought u did. you can also put multiple variables: such as:Zitat:
Zitat von EminentJonFrost
Code:function meOwnYou(me, you, own, bob, joe, mo, umm, topspin)
and i have a (random) question:
you know how ps2/xbox games are lik 4.7GB most of the times?? well, how much of that 4.7GB are the actual SCRIPTS, as opposed to the images/vids?
just curious.
dont know...Zitat:
Zitat von Grimfate126
Just a snippet of a random question function, might help some one.
Example of how to use:Code:function RandomQuestion(Q1, Q2, Q3, Q4, x, y, Color)
RQnr = math.random(1,4)
if RQnr == 1 then
screen:print(x,y, Q1, Color)
elseif RQnr == 2 then
screen:print(x,y, Q2, Color)
elseif RQnr == 3 then
screen:print(x,y, Q3, Color)
elseif RQnr == 4 then
screen:print(x,y, Q4, Color)
end
screen.flip()
end
Code:if pad:cross() then
RandomQuestion("How are you today?", "Who are you?", "Can you show me some magic?", "Hmm.. What should i do with this?", 20, 20, white)
screen.waitVblankStart(200)
end
cool.