Writing Joystick Code: Part 2: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 168: Line 168:
   setprop("controls/engines/engine/mixture",
   setprop("controls/engines/engine/mixture",
     getprop ("controls/engines/engine/mixture") + 0.05)
     getprop ("controls/engines/engine/mixture") + 0.05)
Notice the choice of place to press Enter, and the indent in the second line. Make it ''easy'' for people to read.
Notice where I put the newline and how I indented the second line. Both are designed to make it easy for people to read, as part of being a programmer is making your code legible for others.
 


-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
224

edits