Advertisement
ssoni

ASCII Shoot

Mar 24th, 2021
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.94 KB | None | 0 0
  1. import sys
  2. import time
  3. import os
  4. from os import system
  5.  
  6. def up():
  7.     sys.stdout.write("\033[F")
  8.  
  9. def down():
  10.     sys.stdout.write("\033[E")
  11.  
  12. def bofl():
  13.     sys.stdout.write("\r")
  14.  
  15. def clear():
  16.     os.system('clear')
  17.  
  18. def printChar(c):
  19.     sys.stdout.write('\b')  #Write a backspace
  20.     sys.stdout.write(c)
  21.     sys.stdout.flush()      #force the print NOW (before the next print)
  22.     time.sleep(.1)
  23.  
  24. def printGun():
  25.     sys.stdout.write('   __,_____\n')
  26.     sys.stdout.write('  / __.==--"\n')
  27.     sys.stdout.write(' /#(-\n')
  28.     sys.stdout.write(' `-\'\n')
  29.  
  30. def shoot(x):
  31.     up()
  32.     up()
  33.     up()
  34.     for n in range (1,x):
  35.         sys.stdout.write('  / __.==--"' + ' '*n + '*\n')
  36.         up()
  37.         time.sleep(.1)
  38.     down()
  39.     down()
  40.     down()
  41.  
  42. clear()
  43. printGun()
  44. shoot(25)
  45.  
  46. chars = ["|", "/", "-", "\\"]
  47.  
  48. for x in range (1,100):
  49.     for c in chars:
  50.         printChar(c)
  51.     #sys.stdout.write('\b  ')
  52.  
  53.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement