A86: Sprite hits sprite
[Prev][Next][Index][Thread]
A86: Sprite hits sprite
What would I put in my program to make it so that one sprite hits another one
and adds to the score? I know how to do the score part but the sprite hitting
the other sprite part is unknown to me. I have this:
Bug_Move:
push hl
push bc
ld b,15
ld a,(NUM)
ld c,a
ld hl,Bug
call FastSprite
ld a,(NUM)
inc a
halt
halt
halt
halt
halt
halt
halt
halt
halt
ld (NUM),a
call FastSprite
ld a,b
ld (Bug_b),a
ld a,c
ld (Bug_c),a
pop bc
pop hl
ld a,(Bug_b)
cp b
jr z,EAT
jp Main_Prog
EAT:
ld a,(Bug_c)
cp b
jr z,EAT2
jp Main_Prog
EAT2:
ld a,(Score)
inc a
ld (Score),a
ld a,1
ld (_penRow),a
ld (_penCol),a
push hl
ld hl,Eaten
call _vputs
halt
halt
ld hl,Blank
call _vputs
pop hl
Also, how do I display the value of a, for example, to the screen. Something
to the effect of Outpt(1,1,a)
THANX
Dan
Follow-Ups: