Guest User

Untitled

a guest
Apr 8th, 2014
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import graphics, sdl, sdl_image, colors
  2. import os, strutils
  3.  
  4. var surface: graphics.PSurface = newScreenSurface(640, 480)
  5. var event: TEvent
  6. var x:int=0
  7.  
  8. block game_loop:
  9.  
  10. while true:
  11. sleep(50)
  12. surface.FillRect((0,0,640,480), colBlack);
  13. surface.drawCircle((x, 100), 60, colRed)
  14. SDL.UpdateRect(surface.s, 0, 0, 640, 480)
  15. x=x+1
  16.  
  17. if event.kind == KEYDOWN:
  18. echo "hello"
  19. break game_loop
  20. if event.kind == QUITEV:
  21. echo "hello"
  22. break game_loop
Add Comment
Please, Sign In to add comment