testfile.lua 383 B

1234567891011121314151617
  1. engine.log("Log Message from Lua ;D")
  2. engine.set_color (1., 0., 0.)
  3. function on_touch(x, y)
  4. engine.log ("got touch at " .. tostring(x) .. "," .. tostring(y))
  5. engine.set_color (0., 1., 0.)
  6. end
  7. function update(dt)
  8. r,g,b = engine.get_color()
  9. r = math.max(0., r - dt * 0.4)
  10. g = math.max(0., g - dt * 0.4)
  11. b = math.max(0., b - dt * 0.4)
  12. engine.set_color (r, g, b)
  13. end