is there any tutorials like this one, but simpler(like no DirectX stuff)?http://www.gamedev.net/reference/programming/features/win32asm1/default.asp
Or if not is there any good simple game sources that are *heavily* commented on, I'm stuck when it comes to coloring an area of a window and drawing and moving stuff.. If not any of this, would someone be kind enough to put a vast of comments on the aliens game that comes with RadASM? Thanks in advance(assuming there's replies to this)
Posted on 2003-06-29 20:35:22 by EEDOK
Try Thomas' site @ www.madwizard.org

He's got a Mosaic Tutorial which guides you step by step doing all the Gui, Mouse Input etc... This tutorial covers pretty much the base of all sorts of BoardGames in general. Once your thru that tutorial you'll be definitively wiser.

Cheers,
JimmyClif
Posted on 2003-06-29 20:42:09 by JimmyClif
Thank you, but is there any simpler ones? Like without 500+ lines of code?
Posted on 2003-06-29 22:22:26 by EEDOK

Thank you, but is there any simpler ones? Like without 500+ lines of code?


Cant be more simple becouse it's not real time.


BTW. is there more advenced tutorial in game programing in asm but without DirectX stuff ??
Posted on 2003-06-30 02:46:53 by AceEmbler
why not trying OpenGL than ?
nehe.gamedev.net

there are source codes for MASM as well
Posted on 2003-06-30 03:35:33 by wizzra
How would I get rid of the bars that come after the numbers in this program?
Some comments on how to clean my code up would also be helpful.


;this is the main file
.586
.model flat,stdcall
option casemap:none

include Window Test.inc

.code


; ---------------------------------------------------------------------------


start:
invoke GetModuleHandleA, NULL
mov hInstance,eax
invoke InitCommonControls
invoke WinMain,hInstance,NULL,NULL,SW_SHOWDEFAULT
invoke ExitProcess,eax

WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD
LOCAL wc:WNDCLASSEX
LOCAL msg:MSG
LOCAL hwnd:HWND
mov wc.cbSize,SIZEOF WNDCLASSEX
mov wc.style, CS_HREDRAW or CS_VREDRAW
mov wc.lpfnWndProc, OFFSET WndProc
mov wc.cbClsExtra,NULL
mov wc.cbWndExtra,NULL
push hInstance
pop wc.hInstance
mov wc.hbrBackground,COLOR_WINDOW-3
mov wc.lpszMenuName, NULL
mov wc.lpszClassName,OFFSET ClassName
invoke LoadIcon, hInstance, ID_ICON
mov wc.hIcon, eax
invoke LoadIcon, hInstance, ID_ICON
mov wc.hIconSm, eax
invoke LoadCursor,NULL,IDC_CROSS
mov wc.hCursor,eax
invoke RegisterClassEx, addr wc
invoke LoadMenu, hInstance, MAINMENU
mov hMenu,eax
INVOKE CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,\
WS_OVERLAPPEDWINDOW-WS_MAXIMIZEBOX-WS_SIZEBOX,\
CW_USEDEFAULT, CW_USEDEFAULT,250,200,NULL,hMenu,\
hInst,NULL
mov hwnd,eax
invoke ShowWindow, hwnd, CmdShow
invoke UpdateWindow, hwnd
.WHILE TRUE
invoke GetMessage, ADDR msg,NULL,0,0
.BREAK .IF (!eax)
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
.ENDW
mov eax,msg.wParam
ret
WinMain endp

WndProc proc hWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
LOCAL hdc:HDC
LOCAL ps:PAINTSTRUCT
LOCAL rect:RECT

mov eax, uMsg
.IF eax==WM_CREATE
invoke InitControls, hWnd
mov HP1,100
mov HP2,100
.ELSEIF eax==WM_DESTROY
invoke PostQuitMessage, NULL
.ELSEIF eax==WM_PAINT
invoke BeginPaint,hWnd, ADDR ps
mov hdc,eax
invoke GetClientRect,hWnd, ADDR rect
add rect.bottom,2
invoke GetStockObject,BLACK_BRUSH
invoke FillRect,hdc,addr rect,eax
invoke SetBkMode,hdc,TRANSPARENT
invoke SetTextColor,hdc,0FFFFFFh
invoke TextOut,hdc,5,0,Addr TestText,SIZEOF TestText-1
invoke TextOut,hdc,5,20,Addr TestText2,SIZEOF TestText2-1
invoke wsprintfA,addr Buffer,offset HPDisplay,HP1
invoke TextOut,hdc,210,0,Addr Buffer,SIZEOF Buffer
invoke wsprintfA,addr Buffer,offset HP2Display,HP2
invoke TextOut,hdc,210,20,Addr Buffer,SIZEOF Buffer
invoke EndPaint,hWnd, ADDR ps
.ELSEIF uMsg==WM_COMMAND
mov eax,wParam
.IF lParam==0
;------------------Menu Functions------------------
.IF ax==ID_EXIT
invoke ExitProcess,NULL
.ENDIF
.ELSE
shr edx, 16
.IF dx==BN_CLICKED
;------------------Button Functions------------------
.IF ax==ID_GO
mov ebx,HP1
mov OldHP1,ebx
sub HP1,1
invoke InvalidateRect,hWin,NULL,TRUE
mov ebx, HP1
.IF OldHP1 <= ebx
invoke MessageBox,hWin,addr Cheater,addr AppName,MB_OK
invoke ExitProcess,NULL
.endif
.ENDIF
.ENDIF
.ENDIF
.ELSE
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.ENDIF
ret
WndProc endp

InitControls proc hWnd:DWORD
invoke CreateWindowEx, NULL, ADDR ClassButton, ADDR Buttonlabel,\
WS_CHILD or WS_VISIBLE or BS_DEFPUSHBUTTON,\
30, 130, 140, 25,\
hWnd, ID_GO, hInstance, NULL
mov hButton, eax


ret
InitControls endp

end start

;The inc file

includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\comctl32.lib
includelib \masm32\lib\comdlg32.lib
include \masm32\include\kernel32.inc
include \masm32\include\comctl32.inc
include \masm32\include\comdlg32.inc
include \masm32\include\user32.inc
include \masm32\include\gdi32.inc
include \masm32\include\windows.inc

WinMain PROTO STDCALL :DWORD,:DWORD,:DWORD,:DWORD
WndProc PROTO STDCALL :DWORD, :DWORD, :DWORD, :DWORD
InitControls Proto Stdcall :DWORD

ButtonID equ 1
ID_GO equ 600
ID_ICON equ 7000
MAINMENU equ 10000
ID_EXIT equ 10002

.data
ClassName db 'DLGCLASS',0
AppName db 'Window Test',0
Text db "this button works",0
ClassButton db "BUTTON",0
Buttonlabel db "Go",0
TestText db "Your Health:",0
TestText2 db "Killme's Health:",0
FontName db "System",0
HPDisplay db "%d",0
HP2Display db "%d",0
Cheater db "sorry but cheating isn't allowed",0

.data?
hInstance HINSTANCE ?
CommandLine LPSTR ?
hWin HWND ?
hMenu dd ?
hButton dd ?
hfont dd ?
Buffer dd ?
HP1 dd ?
HP2 dd ?
OldHP1 dd ?
Posted on 2003-07-01 00:57:35 by EEDOK

why not trying OpenGL than ?
nehe.gamedev.net

there are source codes for MASM as well


No DirectX no OpenGL

just pure API
Posted on 2003-07-01 02:01:44 by AceEmbler

Thank you, but is there any simpler ones? Like without 500+ lines of code?


EEDOK, if you want to learn to program for windows, madwizards tutorial is the best I've seen for explaining how things work.

I really don't think you'll find any easier, or simpler, or commented as well as that.
Posted on 2003-07-24 19:37:51 by djinn
I mean like have just the basics, like a tutorial on windows Text based(not console), or just splitting up bitmaps and drawing tiles and sprites, like you know, babysteps.. Anyhow I'm starting to get mine working, but it really screws up when I try to use 1 sub function for 2 targets, but I can do without that.. But any good tutorials on like Textout and stuff? Cause I keep getting bars :/
Posted on 2003-07-25 23:21:33 by EEDOK