|
8086 Assembly Language Game Programming. Check if two rectangles have collided
Note : You need the collisiondetectionproc proceure. Its there in this website.
;---------------------------------------------------------------------
;CollusionDetection Macro:
; Description:
; Checks For Collusion Detection (Rectangular)
;---------------------------------------------------------------------
CollusionDetection macro Obj1L,Obj1T,Obj1R,Obj1B,Obj2L,Obj2T,Obj2R,Obj2B
push ax
mov ax,Obj1L
mov Object1Left,ax
mov ax,Obj1T
mov Object1Top,ax
mov ax,Obj1R
mov Object1Right,ax
mov ax,Obj1B
mov Object1Bottom,ax
mov ax,Obj2L
mov Object2Left,ax
mov ax,Obj2T
mov Object2Top,ax
mov ax,Obj2R
mov Object2Right,ax
mov ax,Obj2B
mov Object2Bottom,ax
call CollusionDetectionProc
pop ax
endm
|