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]
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.
thanks.. but how i write that?
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..
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
thanks :) :)
its workks :8)
and how i do if the smily tuch star (*) so the star will move?
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 *.
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 :)