Advertisement
King0fGamesYami

Let is snow!

Dec 16th, 2015
909
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. --snow generator
  2. local snowflake, maxx, maxy, bShifted = "%", term.getSize()
  3. local snowWin = window.create( term.current(), 1, 1, maxx + 1, maxy )
  4. snowWin.setBackgroundColor( colors.lightBlue )
  5. snowWin.clear()
  6. while true do
  7.     snowWin.setVisible( false )
  8.     snowWin.setCursorPos( math.random( 1, maxx ), 1 )
  9.     snowWin.write( snowflake )
  10.     snowWin.scroll( -1 )
  11.     snowWin.reposition( bShifted and 1 or 0, 1 )
  12.     bShifted = not bShifted
  13.     snowWin.setVisible( true )
  14.     sleep( 0.1 )
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement