News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

problem in my program.. plz help

Started by tamarpe, March 28, 2007, 02:22:45 PM

Previous topic - Next topic

tamarpe

i use in tasm...
i have a smily, and thinks that need to block my smily and frame
but if i walk on the blocks or frame, my smily eat tham..
what i need to write to block my smily if he walk on the frame or the blocks?
thanks..
here my program-

[attachment deleted by admin]

MichaelW

Before you move the smiley, check the color of the square that the smiley will move into, and if the color is red, then don't move the smiley.
eschew obfuscation

tamarpe


tamarpe

my frames is stars(*)
its what i write in when he walks right

right: ; move to right
cmp al, 'd'
jnz up2
cmp [bx+2],  '*'
jz  next
mov [bx], si
add bx, 2
mov [bx], dx
next:
jmp again

is steel not working..

MichaelW

The frame is '*' but the "hook" on the left is 'S'. You could change them both to the same character, or use something like this to compare the attribute byte (this is MASM syntax, I'm not sure what TASM will require):

CMP BYTE PTR [BX-2+1], 44H
JEĀ  RIGHT

eschew obfuscation

tamarpe

thanks :) :)
its workks  :8)
and how i do if the smily tuch star (*) so the star will move?

MichaelW

You could check the character or attribute (color) or both at [bx] and move the * before you draw the smiley at that location. You still have DI free, so it could be loaded with the character and attribute for the *.
eschew obfuscation

tamarpe

cmp byte ptr [bx+2],  '*'
jz  next2

and where i do the stars i write-
next2:
add bx,2
mov [bx],ax

why is not working?
thanks :)