Re: A86: Missle Shooting Problems


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

Re: A86: Missle Shooting Problems






Super Llama wrote:

> 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

maybe push then pop?

>     add a,8
>     sub 168 ;To see if its all the way to the right

there are 128 pixels on the screen

>     jp z,TravelAll  ;if it is clear the old one and stop moving it
>     jp MissleLaunch ;otherwise move the missle

just jp nz,MissleLaunch

>
>
> TravelAll:

>    ld ix,Missle

>     call PutSprite
>     jp Move
>
> MissleLaunch:
>     ld a,b
>     add a,8
>     ld b,a

why 8? how about inc b

>     ld ix,Missle
>     call PutSprite
>     jp Attack
>
> ClearSprite:
>     ld ix,Missle
>     call PutSprite
>     ret

this will work only if you fixed the putsprite routine to use xor

>
>
> 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

It might be too fast for you to see.  Try also using c instead of b.


Follow-Ups: References: