Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include \masm32\include\masm32rt.inc
- ;lior noa ofek hani ilai guy bli a harel elad matan
- ;orel ido amir noam tal
- include drd.inc
- includelib drd.lib
- .data
- hdloc byte "bob.bmp"
- matanooshka Img<>
- posX dword 100
- drcX dword 1
- .code
- main proc
- invoke drd_init, 1000, 600, 8
- invoke drd_imageLoadFile,offset hdloc,offset matanooshka
- invoke drd_imageSetTransparent,offset matanooshka,0
- gameloop:
- invoke Sleep,5
- invoke GetAsyncKeyState,VK_RIGHT
- cmp eax,0
- jne IFSMALLER
- invoke GetAsyncKeyState,VK_LEFT
- cmp eax,0
- jne IFGREATER
- mov ebx,drcX
- add posX,ebx
- cmp posX,800
- jg IFGREATER
- RETGREATER:
- cmp posX,100
- jl IFSMALLER
- RETSMALLER:
- invoke drd_pixelsClear,0h
- invoke drd_imageDraw,offset matanooshka,posX,300
- invoke drd_flip
- invoke drd_processMessages
- jmp gameloop
- IFGREATER:
- mov drcX,-1
- jmp RETGREATER
- IFSMALLER:
- mov drcX,1
- jmp RETSMALLER
- ret
- main endp
- end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement