A86: Missle Shooting Problems


[Prev][Next][Index][Thread]

A86: Missle Shooting Problems




Ok i am trying to make a game that lets you shoot "missles" at a little guy
moving across the screen, and this code will not work no matter what i do,
and I was wondering if anyone could help me.

Attack:
    pop bc
    call ClearSprite ;To get rid off the old missle
    ld a,b
    push bc
    add a,8
    sub 168 ;To see if its all the way to the right
    jp z,TravelAll  ;if it is clear the old one and stop moving it
    jp MissleLaunch ;otherwise move the missle

TravelAll:
    ld ix,0
    ld ix,Missle
    call PutSprite
    jp Move

MissleLaunch:
    ld a,b
    add a,8
    ld b,a
    ld ix,0
    ld ix,Missle
    call PutSprite
    jp Attack

ClearSprite:
    ld ix,0
    ld ix,Missle
    call PutSprite
    ret

This should move the missle from wherever you are on the left side of the
screen all the way to the left, but it doesn't.

I am using the PutSprite routine where "bc = xy" and ix = the current image,
any help would be appreciated thanks.

Thanks,

Super Llama


Follow-Ups: