daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Dec 11th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. include \masm32\include\masm32rt.inc
  2. include drd.inc
  3. .data
  4. hdloc byte "bob.bmp"
  5. matanooshka Img<>
  6. posX dword 100
  7. drcX dword 1
  8. .code
  9.  
  10. main proc
  11.     invoke drd_init,  1000, 600, 8
  12.     invoke drd_imageLoadFile,offset hdloc,offset matanooshka
  13.     invoke drd_imageSetTransparent,offset matanooshka,0
  14.     gameloop:
  15.         invoke Sleep,5
  16.  
  17.         invoke GetAsyncKeyState,VK_RIGHT
  18.         cmp eax,0
  19.         jne IFSMALLER
  20.  
  21.         invoke GetAsyncKeyState,VK_LEFT
  22.         cmp eax,0
  23.         jne IFGREATER
  24.  
  25.         mov ebx,drcX
  26.         add posX,ebx
  27.        
  28.         cmp posX,800
  29.         jg  IFGREATER
  30.         RETGREATER:
  31.  
  32.         cmp posX,100
  33.         jl  IFSMALLER
  34.         RETSMALLER:
  35.  
  36.         invoke drd_pixelsClear,0h
  37.         invoke drd_imageDraw,offset matanooshka,posX,300
  38.         invoke drd_flip
  39.         invoke drd_processMessages
  40.     jmp gameloop
  41.  
  42.     IFGREATER:
  43.     mov drcX,-1
  44.     jmp RETGREATER
  45.  
  46.     IFSMALLER:
  47.     mov drcX,1
  48.     jmp RETSMALLER
  49. ret
  50. main endp
  51. end main
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top