Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import graphics, sdl, sdl_image, colors
- import os, strutils
- var surface: graphics.PSurface = newScreenSurface(640, 480)
- var event: TEvent
- var x:int=0
- block game_loop:
- while true:
- sleep(50)
- while pollEvent(addr event) > 0:
- surface.FillRect((0,0,640,480), colBlack);
- surface.drawCircle((x, 100), 60, colRed)
- SDL.UpdateRect(surface.s, 0, 0, 640, 480)
- x=x+1
- if event.kind == KEYDOWN:
- echo "hello"
- break game_loop
- if event.kind == QUITEV:
- echo "hello"
- break game_loop
Add Comment
Please, Sign In to add comment