lewislovesgames

OpenPrograms:Holo

Aug 30th, 2015
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. -- Generates a heightmap and 'moves' across it over time, creating
  2. -- the effect of a flowing terrain.
  3.  
  4. local component = require("component")
  5. local noise = require("noise")
  6. local holo = component.hologram
  7. local keyboard = require("keyboard")
  8. print("Press Ctrl+W to stop")
  9.  
  10. holo.clear()
  11. local i = 0
  12. while true do
  13. os.sleep(0.1)
  14. i = i + 0.05
  15. for x = 1, 16 * 3 do
  16. for z = 1, 16 * 3 do
  17. local yMax = 15 + noise.fbm(x/(16*3) + i, 1, z/(16*3) + i) * 28
  18. holo.fill(x, z, yMax, 1)
  19. holo.fill(x, z, yMax + 1, 32, 0)
  20. if keyboard.isKeyDown(keyboard.keys.w) and keyboard.isControlDown() then
  21. os.exit()
  22. end
  23. end
  24. end
  25. end
Add Comment
Please, Sign In to add comment