Fandom

CraftStudio Wiki

CodeReferenceStandard

56pages on
this wiki
Add New Page
Comments0 Share

When contributing or editing example code in the Wiki, you should follow the standards set fourth below. Most of these standards have been taken from existing examples written by the creator.

  • Use spaces instead of tabs
  • A tab should equal four spaces
  • Pad parenthesized expressions with spaces
if CraftStudio.Input.IsButtonDown( "Fire" ) then
-- and not
if CraftStudio.Input.IsButtonDown("Fire") then
  • There should be no space before a parenthesized expression
if CraftStudio.Input.IsButtonDown( "Fire" ) then
-- and not
if CraftStudio.Input.IsButtonDown ( "Fire" ) then
  • It's suggested that all isolated code samples should be inside of a behavior function. Use Awake as the default if you're not sure which to use
function Behavior:Awake()
     print ("Hello world!")
end

-- and not just...
print ("Hello world!")

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.