Browse Source

Minor formatting;

bjorn 5 years ago
parent
commit
b9cf21b881
1 changed files with 24 additions and 26 deletions
  1. 24 26
      examples/Thread/main.lua

+ 24 - 26
examples/Thread/main.lua

@@ -1,36 +1,34 @@
 function lovr.load()
 function lovr.load()
-    --This holds the thread code
-    --This must be wrapped with [[]] or "" to
-    --allow the engine to run it as a .lua file
-    thread_code = [[
-        local lovr = { thread = require 'lovr.thread' }
-        local channel = lovr.thread.getChannel("test")
-        local x = 0
-        while true do
-            x = x + 1
-            channel:push(x)
-        end
-    ]]
+  -- This holds the thread code
+  -- This must be wrapped with [[]] or "" to
+  -- allow the engine to run it as a .lua file
+  thread_code = [[
+    local lovr = { thread = require 'lovr.thread' }
+    local channel = lovr.thread.getChannel("test")
+    local x = 0
+    while true do
+      x = x + 1
+      channel:push(x)
+    end
+  ]]
 
 
-    --Create a new test channel
-    channel = lovr.thread.getChannel("test")
+  -- Create a new test channel
+  channel = lovr.thread.getChannel('test')
 
 
-    --Create a new thread called "thread" using
-    --the code above
-    thread = lovr.thread.newThread(thread_code)
+  -- Create a new thread called "thread" using
+  -- the code above
+  thread = lovr.thread.newThread(thread_code)
 
 
-    --Start the thread
-    thread:start()
+  -- Start the thread
+  thread:start()
 end
 end
 
 
-
 function lovr.update(dt)
 function lovr.update(dt)
-    --Read and delete the message
-    message = channel:pop()
+  -- Read and delete the message
+  message = channel:pop()
 end
 end
 
 
-
 function lovr.draw()
 function lovr.draw()
-    --Display the message on screen/headset
-    lovr.graphics.print(tostring(message), 0, 1.7, -5)
-end
+  -- Display the message on screen/headset
+  lovr.graphics.print(tostring(message), 0, 1.7, -5)
+end