View Single Post
Super Moderator
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default Parameters - 04-13-2017, 12:31 AM

Originally Posted by justmyway2 View Post
Hello all,

Would someone be able to explain parameter and arguments to someone that had no coding background? I have been struggling to pick up on this even though other class posts help a bit. If it could be put in terms like the "For Dummies" books that would be beneficial.

When you write a method parameters can be used to pass information to the method. This information can be used and changed within the method without affecting the original values. This allows your method more flexibility.
In the example program I have created a World.lightOn method that takes 4 parameters

Type Name Use
Boolean fromDark If true turn brightness to 0 before starting.
Number time Time to take to change the brightness.
Number maxBrightness How bright to make the light.
Color lightColor What color the light gives off.
So using this new method you can change the light intensity and color by changing the parameters passed in.

Hope this helps
Attached Files
File Type: a2w lightParametersDemo.a2w (247.4 KB, 1 views)

Mark Henwood
Reply With Quote