daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Dec 11th, 2018 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. include \masm32\include\masm32rt.inc
  2. ;lior noa ofek hani ilai guy bli a harel elad matan
  3. ;orel ido amir noam tal
  4. include drd.inc
  5. includelib drd.lib
  6. .data
  7. hdloc byte "bob.bmp"
  8. matanooshka Img<>
  9. posX dword 100
  10. drcX dword 1
  11. .code
  12.  
  13. main proc
  14.     invoke drd_init,  1000, 600, 8
  15.     invoke drd_imageLoadFile,offset hdloc,offset matanooshka
  16.     invoke drd_imageSetTransparent,offset matanooshka,0
  17.     gameloop:
  18.         invoke Sleep,5
  19.  
  20.         invoke GetAsyncKeyState,VK_RIGHT
  21.         cmp eax,0
  22.         jne IFSMALLER
  23.  
  24.         invoke GetAsyncKeyState,VK_LEFT
  25.         cmp eax,0
  26.         jne IFGREATER
  27.  
  28.         mov ebx,drcX
  29.         add posX,ebx
  30.        
  31.         cmp posX,800
  32.         jg  IFGREATER
  33.         RETGREATER:
  34.  
  35.         cmp posX,100
  36.         jl  IFSMALLER
  37.         RETSMALLER:
  38.  
  39.         invoke drd_pixelsClear,0h
  40.         invoke drd_imageDraw,offset matanooshka,posX,300
  41.         invoke drd_flip
  42.         invoke drd_processMessages
  43.     jmp gameloop
  44.  
  45.     IFGREATER:
  46.     mov drcX,-1
  47.     jmp RETGREATER
  48.  
  49.     IFSMALLER:
  50.     mov drcX,1
  51.     jmp RETSMALLER
  52. ret
  53. main endp
  54. 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